Commit e92ae76f by wuwenlong

Merge remote-tracking branch 'origin/dev' into dev

parents 93722f45 9254f200
package com.baosight.hggp.common;
import com.baosight.iplat4j.core.ei.EiBlock;
import java.util.ArrayList;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
/**
* @author LiuYang
* @version 1.0 2024/5/21
*/
public enum RunStatusEnum {
KJ(1,"开机"),
TJ(0,"停机");
private Integer code;
private String value;
RunStatusEnum(Integer code, String value) {
this.code = code;
this.value = value;
}
public static EiBlock generatorEiBlock() {
EiBlock block = new EiBlock("run_status_block_id");
List<Map<String, Object>> rows = new ArrayList<Map<String, Object>>() {{
add(new HashMap<String, Object>() {{
put(HGConstants.TEXT_FIELD, KJ.value);
put(HGConstants.VALUE_FIELD, KJ.code);
}});
add(new HashMap<String, Object>() {{
put(HGConstants.TEXT_FIELD, TJ.value);
put(HGConstants.VALUE_FIELD, TJ.code);
}});
}};
block.setRows(rows);
return block;
}
public Integer getCode() {
return code;
}
public void setCode(Integer code) {
this.code = code;
}
public String getValue() {
return value;
}
public void setValue(String value) {
this.value = value;
}
}
package com.baosight.hggp.hg.sb.domain;
import com.baosight.iplat4j.core.util.NumberUtils;
import com.baosight.iplat4j.core.ei.EiColumn;
import com.baosight.iplat4j.core.data.DaoEPBase;
import java.util.HashMap;
import java.util.Map;
import com.baosight.iplat4j.core.util.StringUtils;
/**
* Project: <br>
* Title:Hgsb008.java <br>
* Description: <br>
*
* Copyrigth:Baosight Software LTD.co Copyright (c) 2019. <br>
*
* @version 1.0
* @history 2024-05-20 16:01:54 create
*/
public class HGSB008 extends DaoEPBase {
private static final long serialVersionUID = 1L;
public static final String FIELD_ID = "id"; /* ID*/
public static final String FIELD_ACCOUNT_CODE = "accountCode"; /* 账套*/
public static final String FIELD_DEP_CODE = "depCode"; /* 部门编码*/
public static final String FIELD_CREATED_BY = "createdBy"; /* 创建人*/
public static final String FIELD_CREATED_NAME = "createdName"; /* 创建人名称*/
public static final String FIELD_CREATED_TIME = "createdTime"; /* 创建时间*/
public static final String FIELD_UPDATED_BY = "updatedBy"; /* 修改人*/
public static final String FIELD_UPDATED_NAME = "updatedName"; /* 修改人名称*/
public static final String FIELD_UPDATED_TIME = "updatedTime"; /* 修改时间*/
public static final String FIELD_DELETE_FLAG = "deleteFlag"; /* 是否删除 0-否1-是*/
public static final String FIELD_COMPANY_CODE = "companyCode"; /* 公司编码*/
public static final String FIELD_COMPANY_NAME = "companyName"; /* 公司名称*/
public static final String FIELD_FACTORY_CODE = "factoryCode"; /* 工厂代码*/
public static final String FIELD_FACTORY_NAME = "factoryName"; /* 工厂名称*/
public static final String FIELD_GROUP_CODE = "groupCode"; /* 设备区域编码*/
public static final String FIELD_GROUP_NAME = "groupName"; /* 设备区域名称*/
public static final String FIELD_DEVICE_TYPE = "deviceType"; /* 设备类型*/
public static final String FIELD_DEVICE_CODE = "deviceCode"; /* 设备编码*/
public static final String FIELD_DEVICE_NAME = "deviceName"; /* 设备名称*/
public static final String FIELD_DEVICE_MODEL = "deviceModel"; /* 设备型号*/
public static final String FIELD_LOG_DATE = "logDate"; /* 日志日期*/
public static final String FIELD_STATUS = "status"; /* 运行状态 0-停机 1-开机*/
public static final String FIELD_LATELY_START_TIME = "latelyStartTime"; /* 最近开机时间*/
public static final String FIELD_LATELY_ENT_TIME = "latelyEntTime"; /* 最近停机时间*/
public static final String FIELD_START_DURA = "startDura"; /* 开机时长*/
public static final String FIELD_END_DURA = "endDura"; /* 关机时长*/
public static final String COL_ID = "ID"; /* ID*/
public static final String COL_ACCOUNT_CODE = "ACCOUNT_CODE"; /* 账套*/
public static final String COL_DEP_CODE = "DEP_CODE"; /* 部门编码*/
public static final String COL_CREATED_BY = "CREATED_BY"; /* 创建人*/
public static final String COL_CREATED_NAME = "CREATED_NAME"; /* 创建人名称*/
public static final String COL_CREATED_TIME = "CREATED_TIME"; /* 创建时间*/
public static final String COL_UPDATED_BY = "UPDATED_BY"; /* 修改人*/
public static final String COL_UPDATED_NAME = "UPDATED_NAME"; /* 修改人名称*/
public static final String COL_UPDATED_TIME = "UPDATED_TIME"; /* 修改时间*/
public static final String COL_DELETE_FLAG = "DELETE_FLAG"; /* 是否删除 0-否1-是*/
public static final String COL_COMPANY_CODE = "COMPANY_CODE"; /* 公司编码*/
public static final String COL_COMPANY_NAME = "COMPANY_NAME"; /* 公司名称*/
public static final String COL_FACTORY_CODE = "FACTORY_CODE"; /* 工厂代码*/
public static final String COL_FACTORY_NAME = "FACTORY_NAME"; /* 工厂名称*/
public static final String COL_GROUP_CODE = "GROUP_CODE"; /* 设备区域编码*/
public static final String COL_GROUP_NAME = "GROUP_NAME"; /* 设备区域名称*/
public static final String COL_DEVICE_TYPE = "DEVICE_TYPE"; /* 设备类型*/
public static final String COL_DEVICE_CODE = "DEVICE_CODE"; /* 设备编码*/
public static final String COL_DEVICE_NAME = "DEVICE_NAME"; /* 设备名称*/
public static final String COL_DEVICE_MODEL = "DEVICE_MODEL"; /* 设备型号*/
public static final String COL_LOG_DATE = "LOG_DATE"; /* 日志日期*/
public static final String COL_STATUS = "STATUS"; /* 运行状态 0-停机 1-开机*/
public static final String COL_LATELY_START_TIME = "LATELY_START_TIME"; /* 最近开机时间*/
public static final String COL_LATELY_ENT_TIME = "LATELY_ENT_TIME"; /* 最近停机时间*/
public static final String COL_START_DURA = "START_DURA"; /* 开机时长*/
public static final String COL_END_DURA = "END_DURA"; /* 关机时长*/
public static final String QUERY = "HGSB008.query";
public static final String COUNT = "HGSB008.count";
public static final String INSERT = "HGSB008.insert";
public static final String UPDATE = "HGSB008.update";
public static final String DELETE = "HGSB008.delete";
private Long id = new Long(0); /* ID*/
private String accountCode = " "; /* 账套*/
private String depCode = " "; /* 部门编码*/
private String createdBy = " "; /* 创建人*/
private String createdName = " "; /* 创建人名称*/
private String createdTime = " "; /* 创建时间*/
private String updatedBy = " "; /* 修改人*/
private String updatedName = " "; /* 修改人名称*/
private String updatedTime = " "; /* 修改时间*/
private Integer deleteFlag = 0; /* 是否删除 0-否1-是*/
private String companyCode = " "; /* 公司编码*/
private String companyName = " "; /* 公司名称*/
private String factoryCode = " "; /* 工厂代码*/
private String factoryName = " "; /* 工厂名称*/
private String groupCode = " "; /* 设备区域编码*/
private String groupName = " "; /* 设备区域名称*/
private String deviceType = " "; /* 设备类型*/
private String deviceCode = " "; /* 设备编码*/
private String deviceName = " "; /* 设备名称*/
private String deviceModel = " "; /* 设备型号*/
private String logDate = " "; /* 日志日期*/
private Integer status = 0; /* 运行状态 0-停机 1-开机*/
private String latelyStartTime = " "; /* 最近开机时间*/
private String latelyEntTime = " "; /* 最近停机时间*/
private String startDura = " "; /* 开机时长*/
private String endDura = " "; /* 关机时长*/
/**
* initialize the metadata.
*/
public void initMetaData() {
EiColumn eiColumn;
eiColumn = new EiColumn(FIELD_ID);
eiColumn.setPrimaryKey(true);
eiColumn.setDescName("ID");
eiMetadata.addMeta(eiColumn);
eiColumn = new EiColumn(FIELD_ACCOUNT_CODE);
eiColumn.setDescName("账套");
eiMetadata.addMeta(eiColumn);
eiColumn = new EiColumn(FIELD_DEP_CODE);
eiColumn.setDescName("部门编码");
eiMetadata.addMeta(eiColumn);
eiColumn = new EiColumn(FIELD_CREATED_BY);
eiColumn.setDescName("创建人");
eiMetadata.addMeta(eiColumn);
eiColumn = new EiColumn(FIELD_CREATED_NAME);
eiColumn.setDescName("创建人名称");
eiMetadata.addMeta(eiColumn);
eiColumn = new EiColumn(FIELD_CREATED_TIME);
eiColumn.setDescName("创建时间");
eiMetadata.addMeta(eiColumn);
eiColumn = new EiColumn(FIELD_UPDATED_BY);
eiColumn.setDescName("修改人");
eiMetadata.addMeta(eiColumn);
eiColumn = new EiColumn(FIELD_UPDATED_NAME);
eiColumn.setDescName("修改人名称");
eiMetadata.addMeta(eiColumn);
eiColumn = new EiColumn(FIELD_UPDATED_TIME);
eiColumn.setDescName("修改时间");
eiMetadata.addMeta(eiColumn);
eiColumn = new EiColumn(FIELD_DELETE_FLAG);
eiColumn.setDescName("是否删除 0-否1-是");
eiMetadata.addMeta(eiColumn);
eiColumn = new EiColumn(FIELD_COMPANY_CODE);
eiColumn.setDescName("公司编码");
eiMetadata.addMeta(eiColumn);
eiColumn = new EiColumn(FIELD_COMPANY_NAME);
eiColumn.setDescName("公司名称");
eiMetadata.addMeta(eiColumn);
eiColumn = new EiColumn(FIELD_FACTORY_CODE);
eiColumn.setDescName("工厂代码");
eiMetadata.addMeta(eiColumn);
eiColumn = new EiColumn(FIELD_FACTORY_NAME);
eiColumn.setDescName("工厂名称");
eiMetadata.addMeta(eiColumn);
eiColumn = new EiColumn(FIELD_GROUP_CODE);
eiColumn.setDescName("设备区域编码");
eiMetadata.addMeta(eiColumn);
eiColumn = new EiColumn(FIELD_GROUP_NAME);
eiColumn.setDescName("设备区域名称");
eiMetadata.addMeta(eiColumn);
eiColumn = new EiColumn(FIELD_DEVICE_TYPE);
eiColumn.setDescName("设备类型");
eiMetadata.addMeta(eiColumn);
eiColumn = new EiColumn(FIELD_DEVICE_CODE);
eiColumn.setDescName("设备编码");
eiMetadata.addMeta(eiColumn);
eiColumn = new EiColumn(FIELD_DEVICE_NAME);
eiColumn.setDescName("设备名称");
eiMetadata.addMeta(eiColumn);
eiColumn = new EiColumn(FIELD_DEVICE_MODEL);
eiColumn.setDescName("设备型号");
eiMetadata.addMeta(eiColumn);
eiColumn = new EiColumn(FIELD_LOG_DATE);
eiColumn.setDescName("日志日期");
eiMetadata.addMeta(eiColumn);
eiColumn = new EiColumn(FIELD_STATUS);
eiColumn.setDescName("运行状态 0-停机 1-开机");
eiMetadata.addMeta(eiColumn);
eiColumn = new EiColumn(FIELD_LATELY_START_TIME);
eiColumn.setDescName("最近开机时间");
eiMetadata.addMeta(eiColumn);
eiColumn = new EiColumn(FIELD_LATELY_ENT_TIME);
eiColumn.setDescName("最近停机时间");
eiMetadata.addMeta(eiColumn);
eiColumn = new EiColumn(FIELD_START_DURA);
eiColumn.setDescName("开机时长");
eiMetadata.addMeta(eiColumn);
eiColumn = new EiColumn(FIELD_END_DURA);
eiColumn.setDescName("关机时长");
eiMetadata.addMeta(eiColumn);
}
/**
* the constructor.
*/
public HGSB008() {
initMetaData();
}
/**
* get the id - ID.
* @return the id
*/
public Long getId() {
return this.id;
}
/**
* set the id - ID.
*
* @param id - ID
*/
public void setId(Long id) {
this.id = id;
}
/**
* get the accountCode - 账套.
* @return the accountCode
*/
public String getAccountCode() {
return this.accountCode;
}
/**
* set the accountCode - 账套.
*
* @param accountCode - 账套
*/
public void setAccountCode(String accountCode) {
this.accountCode = accountCode;
}
/**
* get the depCode - 部门编码.
* @return the depCode
*/
public String getDepCode() {
return this.depCode;
}
/**
* set the depCode - 部门编码.
*
* @param depCode - 部门编码
*/
public void setDepCode(String depCode) {
this.depCode = depCode;
}
/**
* get the createdBy - 创建人.
* @return the createdBy
*/
public String getCreatedBy() {
return this.createdBy;
}
/**
* set the createdBy - 创建人.
*
* @param createdBy - 创建人
*/
public void setCreatedBy(String createdBy) {
this.createdBy = createdBy;
}
/**
* get the createdName - 创建人名称.
* @return the createdName
*/
public String getCreatedName() {
return this.createdName;
}
/**
* set the createdName - 创建人名称.
*
* @param createdName - 创建人名称
*/
public void setCreatedName(String createdName) {
this.createdName = createdName;
}
/**
* get the createdTime - 创建时间.
* @return the createdTime
*/
public String getCreatedTime() {
return this.createdTime;
}
/**
* set the createdTime - 创建时间.
*
* @param createdTime - 创建时间
*/
public void setCreatedTime(String createdTime) {
this.createdTime = createdTime;
}
/**
* get the updatedBy - 修改人.
* @return the updatedBy
*/
public String getUpdatedBy() {
return this.updatedBy;
}
/**
* set the updatedBy - 修改人.
*
* @param updatedBy - 修改人
*/
public void setUpdatedBy(String updatedBy) {
this.updatedBy = updatedBy;
}
/**
* get the updatedName - 修改人名称.
* @return the updatedName
*/
public String getUpdatedName() {
return this.updatedName;
}
/**
* set the updatedName - 修改人名称.
*
* @param updatedName - 修改人名称
*/
public void setUpdatedName(String updatedName) {
this.updatedName = updatedName;
}
/**
* get the updatedTime - 修改时间.
* @return the updatedTime
*/
public String getUpdatedTime() {
return this.updatedTime;
}
/**
* set the updatedTime - 修改时间.
*
* @param updatedTime - 修改时间
*/
public void setUpdatedTime(String updatedTime) {
this.updatedTime = updatedTime;
}
/**
* get the deleteFlag - 是否删除 0-否1-是.
* @return the deleteFlag
*/
public Integer getDeleteFlag() {
return this.deleteFlag;
}
/**
* set the deleteFlag - 是否删除 0-否1-是.
*
* @param deleteFlag - 是否删除 0-否1-是
*/
public void setDeleteFlag(Integer deleteFlag) {
this.deleteFlag = deleteFlag;
}
/**
* get the companyCode - 公司编码.
* @return the companyCode
*/
public String getCompanyCode() {
return this.companyCode;
}
/**
* set the companyCode - 公司编码.
*
* @param companyCode - 公司编码
*/
public void setCompanyCode(String companyCode) {
this.companyCode = companyCode;
}
/**
* get the companyName - 公司名称.
* @return the companyName
*/
public String getCompanyName() {
return this.companyName;
}
/**
* set the companyName - 公司名称.
*
* @param companyName - 公司名称
*/
public void setCompanyName(String companyName) {
this.companyName = companyName;
}
/**
* get the factoryCode - 工厂代码.
* @return the factoryCode
*/
public String getFactoryCode() {
return this.factoryCode;
}
/**
* set the factoryCode - 工厂代码.
*
* @param factoryCode - 工厂代码
*/
public void setFactoryCode(String factoryCode) {
this.factoryCode = factoryCode;
}
/**
* get the factoryName - 工厂名称.
* @return the factoryName
*/
public String getFactoryName() {
return this.factoryName;
}
/**
* set the factoryName - 工厂名称.
*
* @param factoryName - 工厂名称
*/
public void setFactoryName(String factoryName) {
this.factoryName = factoryName;
}
/**
* get the groupCode - 设备区域编码.
* @return the groupCode
*/
public String getGroupCode() {
return this.groupCode;
}
/**
* set the groupCode - 设备区域编码.
*
* @param groupCode - 设备区域编码
*/
public void setGroupCode(String groupCode) {
this.groupCode = groupCode;
}
/**
* get the groupName - 设备区域名称.
* @return the groupName
*/
public String getGroupName() {
return this.groupName;
}
/**
* set the groupName - 设备区域名称.
*
* @param groupName - 设备区域名称
*/
public void setGroupName(String groupName) {
this.groupName = groupName;
}
/**
* get the deviceType - 设备类型.
* @return the deviceType
*/
public String getDeviceType() {
return this.deviceType;
}
/**
* set the deviceType - 设备类型.
*
* @param deviceType - 设备类型
*/
public void setDeviceType(String deviceType) {
this.deviceType = deviceType;
}
/**
* get the deviceCode - 设备编码.
* @return the deviceCode
*/
public String getDeviceCode() {
return this.deviceCode;
}
/**
* set the deviceCode - 设备编码.
*
* @param deviceCode - 设备编码
*/
public void setDeviceCode(String deviceCode) {
this.deviceCode = deviceCode;
}
/**
* get the deviceName - 设备名称.
* @return the deviceName
*/
public String getDeviceName() {
return this.deviceName;
}
/**
* set the deviceName - 设备名称.
*
* @param deviceName - 设备名称
*/
public void setDeviceName(String deviceName) {
this.deviceName = deviceName;
}
/**
* get the deviceModel - 设备型号.
* @return the deviceModel
*/
public String getDeviceModel() {
return this.deviceModel;
}
/**
* set the deviceModel - 设备型号.
*
* @param deviceModel - 设备型号
*/
public void setDeviceModel(String deviceModel) {
this.deviceModel = deviceModel;
}
/**
* get the logDate - 日志日期.
* @return the logDate
*/
public String getLogDate() {
return this.logDate;
}
/**
* set the logDate - 日志日期.
*
* @param logDate - 日志日期
*/
public void setLogDate(String logDate) {
this.logDate = logDate;
}
/**
* get the status - 运行状态 0-停机 1-开机.
* @return the status
*/
public Integer getStatus() {
return this.status;
}
/**
* set the status - 运行状态 0-停机 1-开机.
*
* @param status - 运行状态 0-停机 1-开机
*/
public void setStatus(Integer status) {
this.status = status;
}
/**
* get the latelyStartTime - 最近开机时间.
* @return the latelyStartTime
*/
public String getLatelyStartTime() {
return this.latelyStartTime;
}
/**
* set the latelyStartTime - 最近开机时间.
*
* @param latelyStartTime - 最近开机时间
*/
public void setLatelyStartTime(String latelyStartTime) {
this.latelyStartTime = latelyStartTime;
}
/**
* get the latelyEntTime - 最近停机时间.
* @return the latelyEntTime
*/
public String getLatelyEntTime() {
return this.latelyEntTime;
}
/**
* set the latelyEntTime - 最近停机时间.
*
* @param latelyEntTime - 最近停机时间
*/
public void setLatelyEntTime(String latelyEntTime) {
this.latelyEntTime = latelyEntTime;
}
/**
* get the startDura - 开机时长.
* @return the startDura
*/
public String getStartDura() {
return this.startDura;
}
/**
* set the startDura - 开机时长.
*
* @param startDura - 开机时长
*/
public void setStartDura(String startDura) {
this.startDura = startDura;
}
/**
* get the endDura - 关机时长.
* @return the endDura
*/
public String getEndDura() {
return this.endDura;
}
/**
* set the endDura - 关机时长.
*
* @param endDura - 关机时长
*/
public void setEndDura(String endDura) {
this.endDura = endDura;
}
/**
* get the value from Map.
*
* @param map - source data map
*/
@Override
public void fromMap(Map map) {
setId(NumberUtils.toLong(StringUtils.toString(map.get(FIELD_ID)), id));
setAccountCode(StringUtils.defaultIfEmpty(StringUtils.toString(map.get(FIELD_ACCOUNT_CODE)), accountCode));
setDepCode(StringUtils.defaultIfEmpty(StringUtils.toString(map.get(FIELD_DEP_CODE)), depCode));
setCreatedBy(StringUtils.defaultIfEmpty(StringUtils.toString(map.get(FIELD_CREATED_BY)), createdBy));
setCreatedName(StringUtils.defaultIfEmpty(StringUtils.toString(map.get(FIELD_CREATED_NAME)), createdName));
setCreatedTime(StringUtils.defaultIfEmpty(StringUtils.toString(map.get(FIELD_CREATED_TIME)), createdTime));
setUpdatedBy(StringUtils.defaultIfEmpty(StringUtils.toString(map.get(FIELD_UPDATED_BY)), updatedBy));
setUpdatedName(StringUtils.defaultIfEmpty(StringUtils.toString(map.get(FIELD_UPDATED_NAME)), updatedName));
setUpdatedTime(StringUtils.defaultIfEmpty(StringUtils.toString(map.get(FIELD_UPDATED_TIME)), updatedTime));
setDeleteFlag(NumberUtils.toInteger(StringUtils.toString(map.get(FIELD_DELETE_FLAG)), deleteFlag));
setCompanyCode(StringUtils.defaultIfEmpty(StringUtils.toString(map.get(FIELD_COMPANY_CODE)), companyCode));
setCompanyName(StringUtils.defaultIfEmpty(StringUtils.toString(map.get(FIELD_COMPANY_NAME)), companyName));
setFactoryCode(StringUtils.defaultIfEmpty(StringUtils.toString(map.get(FIELD_FACTORY_CODE)), factoryCode));
setFactoryName(StringUtils.defaultIfEmpty(StringUtils.toString(map.get(FIELD_FACTORY_NAME)), factoryName));
setGroupCode(StringUtils.defaultIfEmpty(StringUtils.toString(map.get(FIELD_GROUP_CODE)), groupCode));
setGroupName(StringUtils.defaultIfEmpty(StringUtils.toString(map.get(FIELD_GROUP_NAME)), groupName));
setDeviceType(StringUtils.defaultIfEmpty(StringUtils.toString(map.get(FIELD_DEVICE_TYPE)), deviceType));
setDeviceCode(StringUtils.defaultIfEmpty(StringUtils.toString(map.get(FIELD_DEVICE_CODE)), deviceCode));
setDeviceName(StringUtils.defaultIfEmpty(StringUtils.toString(map.get(FIELD_DEVICE_NAME)), deviceName));
setDeviceModel(StringUtils.defaultIfEmpty(StringUtils.toString(map.get(FIELD_DEVICE_MODEL)), deviceModel));
setLogDate(StringUtils.defaultIfEmpty(StringUtils.toString(map.get(FIELD_LOG_DATE)), logDate));
setStatus(NumberUtils.toInteger(StringUtils.toString(map.get(FIELD_STATUS)), status));
setLatelyStartTime(StringUtils.defaultIfEmpty(StringUtils.toString(map.get(FIELD_LATELY_START_TIME)), latelyStartTime));
setLatelyEntTime(StringUtils.defaultIfEmpty(StringUtils.toString(map.get(FIELD_LATELY_ENT_TIME)), latelyEntTime));
setStartDura(StringUtils.defaultIfEmpty(StringUtils.toString(map.get(FIELD_START_DURA)), startDura));
setEndDura(StringUtils.defaultIfEmpty(StringUtils.toString(map.get(FIELD_END_DURA)), endDura));
}
/**
* set the value to Map.
*/
@Override
public Map toMap() {
Map map = new HashMap();
map.put(FIELD_ID, StringUtils.toString(id, eiMetadata.getMeta(FIELD_ID)));
map.put(FIELD_ACCOUNT_CODE, StringUtils.toString(accountCode, eiMetadata.getMeta(FIELD_ACCOUNT_CODE)));
map.put(FIELD_DEP_CODE, StringUtils.toString(depCode, eiMetadata.getMeta(FIELD_DEP_CODE)));
map.put(FIELD_CREATED_BY, StringUtils.toString(createdBy, eiMetadata.getMeta(FIELD_CREATED_BY)));
map.put(FIELD_CREATED_NAME, StringUtils.toString(createdName, eiMetadata.getMeta(FIELD_CREATED_NAME)));
map.put(FIELD_CREATED_TIME, StringUtils.toString(createdTime, eiMetadata.getMeta(FIELD_CREATED_TIME)));
map.put(FIELD_UPDATED_BY, StringUtils.toString(updatedBy, eiMetadata.getMeta(FIELD_UPDATED_BY)));
map.put(FIELD_UPDATED_NAME, StringUtils.toString(updatedName, eiMetadata.getMeta(FIELD_UPDATED_NAME)));
map.put(FIELD_UPDATED_TIME, StringUtils.toString(updatedTime, eiMetadata.getMeta(FIELD_UPDATED_TIME)));
map.put(FIELD_DELETE_FLAG, StringUtils.toString(deleteFlag, eiMetadata.getMeta(FIELD_DELETE_FLAG)));
map.put(FIELD_COMPANY_CODE, StringUtils.toString(companyCode, eiMetadata.getMeta(FIELD_COMPANY_CODE)));
map.put(FIELD_COMPANY_NAME, StringUtils.toString(companyName, eiMetadata.getMeta(FIELD_COMPANY_NAME)));
map.put(FIELD_FACTORY_CODE, StringUtils.toString(factoryCode, eiMetadata.getMeta(FIELD_FACTORY_CODE)));
map.put(FIELD_FACTORY_NAME, StringUtils.toString(factoryName, eiMetadata.getMeta(FIELD_FACTORY_NAME)));
map.put(FIELD_GROUP_CODE, StringUtils.toString(groupCode, eiMetadata.getMeta(FIELD_GROUP_CODE)));
map.put(FIELD_GROUP_NAME, StringUtils.toString(groupName, eiMetadata.getMeta(FIELD_GROUP_NAME)));
map.put(FIELD_DEVICE_TYPE, StringUtils.toString(deviceType, eiMetadata.getMeta(FIELD_DEVICE_TYPE)));
map.put(FIELD_DEVICE_CODE, StringUtils.toString(deviceCode, eiMetadata.getMeta(FIELD_DEVICE_CODE)));
map.put(FIELD_DEVICE_NAME, StringUtils.toString(deviceName, eiMetadata.getMeta(FIELD_DEVICE_NAME)));
map.put(FIELD_DEVICE_MODEL, StringUtils.toString(deviceModel, eiMetadata.getMeta(FIELD_DEVICE_MODEL)));
map.put(FIELD_LOG_DATE, StringUtils.toString(logDate, eiMetadata.getMeta(FIELD_LOG_DATE)));
map.put(FIELD_STATUS, StringUtils.toString(status, eiMetadata.getMeta(FIELD_STATUS)));
map.put(FIELD_LATELY_START_TIME, StringUtils.toString(latelyStartTime, eiMetadata.getMeta(FIELD_LATELY_START_TIME)));
map.put(FIELD_LATELY_ENT_TIME, StringUtils.toString(latelyEntTime, eiMetadata.getMeta(FIELD_LATELY_ENT_TIME)));
map.put(FIELD_START_DURA, StringUtils.toString(startDura, eiMetadata.getMeta(FIELD_START_DURA)));
map.put(FIELD_END_DURA, StringUtils.toString(endDura, eiMetadata.getMeta(FIELD_END_DURA)));
return map;
}
}
package com.baosight.hggp.hg.sb.service;
import com.baosight.hggp.common.DdynamicEnum;
import com.baosight.hggp.common.RunStatusEnum;
import com.baosight.hggp.core.constant.CommonConstant;
import com.baosight.hggp.hg.sb.domain.HGSB008;
import com.baosight.hggp.util.CommonMethod;
import com.baosight.hggp.util.DateUtils;
import com.baosight.hggp.util.contants.ACConstants;
import com.baosight.iplat4j.core.ei.EiConstant;
import com.baosight.iplat4j.core.ei.EiInfo;
import com.baosight.iplat4j.core.service.impl.ServiceEPBase;
import org.apache.commons.lang3.StringUtils;
import java.util.Arrays;
/**
* @author LiuYang
* @version 1.0 2024/5/20
*/
public class ServiceHGSB008 extends ServiceEPBase {
@Override
public EiInfo initLoad(EiInfo inInfo) {
inInfo.setCell(EiConstant.queryBlock, ACConstants.ROW_CODE_0,HGSB008.FIELD_DELETE_FLAG, CommonConstant.YesNo.NO_0);
inInfo = super.query(inInfo,HGSB008.QUERY,new HGSB008());
CommonMethod.initBlock(inInfo,
Arrays.asList(DdynamicEnum.COMPANY_BOX_BLOCK_ID,DdynamicEnum.DEVICE_CODE_BOX_BLOCK_ID),null
);
inInfo.setBlock(RunStatusEnum.generatorEiBlock());
return inInfo;
}
@Override
public EiInfo query(EiInfo inInfo) {
String logDate = inInfo.getCellStr(EiConstant.queryBlock,ACConstants.ROW_CODE_0,HGSB008.FIELD_LOG_DATE);
if (StringUtils.isNotEmpty(logDate)) {
inInfo.setCell(EiConstant.queryBlock,ACConstants.ROW_CODE_0,HGSB008.FIELD_LOG_DATE, DateUtils.formatShort(logDate));
}
inInfo.setCell(EiConstant.queryBlock, ACConstants.ROW_CODE_0,HGSB008.FIELD_DELETE_FLAG, CommonConstant.YesNo.NO_0);
return super.query(inInfo,HGSB008.QUERY,new HGSB008());
}
}
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE sqlMap PUBLIC "-//ibatis.apache.org//DTD SQL Map 2.0//EN" "http://ibatis.apache.org/dtd/sql-map-2.dtd"> <!-- table information
Generate time : 2024-05-20 16:01:54
Version : 1.0
schema : hggp
tableName : HGSB008
ID BIGINT NOT NULL primarykey,
ACCOUNT_CODE VARCHAR,
DEP_CODE VARCHAR,
CREATED_BY VARCHAR,
CREATED_NAME VARCHAR,
CREATED_TIME VARCHAR,
UPDATED_BY VARCHAR,
UPDATED_NAME VARCHAR,
UPDATED_TIME VARCHAR,
DELETE_FLAG TINYINT,
COMPANY_CODE VARCHAR,
COMPANY_NAME VARCHAR,
FACTORY_CODE VARCHAR,
FACTORY_NAME VARCHAR,
GROUP_CODE VARCHAR,
GROUP_NAME VARCHAR,
DEVICE_TYPE VARCHAR,
DEVICE_CODE VARCHAR,
DEVICE_NAME VARCHAR,
DEVICE_MODEL VARCHAR,
LOG_DATE VARCHAR,
STATUS TINYINT,
LATELY_START_TIME VARCHAR,
LATELY_ENT_TIME VARCHAR,
START_DURA VARCHAR,
END_DURA VARCHAR
-->
<sqlMap namespace="HGSB008">
<typeAlias alias="HGSB008" type="com.baosight.hggp.hg.sb.domain.HGSB008"/>
<typeAlias alias="HashMap" type="java.util.HashMap"/>
<sql id="condition">
<isNotEmpty prepend=" AND " property="id">
ID = #id#
</isNotEmpty>
<isNotEmpty prepend=" AND " property="accountCode">
ACCOUNT_CODE = #accountCode#
</isNotEmpty>
<isNotEmpty prepend=" AND " property="depCode">
DEP_CODE = #depCode#
</isNotEmpty>
<isNotEmpty prepend=" AND " property="createdBy">
CREATED_BY = #createdBy#
</isNotEmpty>
<isNotEmpty prepend=" AND " property="createdName">
CREATED_NAME = #createdName#
</isNotEmpty>
<isNotEmpty prepend=" AND " property="createdTime">
CREATED_TIME = #createdTime#
</isNotEmpty>
<isNotEmpty prepend=" AND " property="updatedBy">
UPDATED_BY = #updatedBy#
</isNotEmpty>
<isNotEmpty prepend=" AND " property="updatedName">
UPDATED_NAME = #updatedName#
</isNotEmpty>
<isNotEmpty prepend=" AND " property="updatedTime">
UPDATED_TIME = #updatedTime#
</isNotEmpty>
<isNotEmpty prepend=" AND " property="deleteFlag">
DELETE_FLAG = #deleteFlag#
</isNotEmpty>
<isNotEmpty prepend=" AND " property="companyCode">
COMPANY_CODE = #companyCode#
</isNotEmpty>
<isNotEmpty prepend=" AND " property="companyName">
COMPANY_NAME LIKE CONCAT('%', #companyName#, '%')
</isNotEmpty>
<isNotEmpty prepend=" AND " property="factoryCode">
FACTORY_CODE = #factoryCode#
</isNotEmpty>
<isNotEmpty prepend=" AND " property="factoryName">
FACTORY_NAME LIKE CONCAT('%', #factoryName#, '%')
</isNotEmpty>
<isNotEmpty prepend=" AND " property="groupCode">
GROUP_CODE = #groupCode#
</isNotEmpty>
<isNotEmpty prepend=" AND " property="groupName">
GROUP_NAME LIKE CONCAT('%', #groupName#, '%')
</isNotEmpty>
<isNotEmpty prepend=" AND " property="deviceType">
DEVICE_TYPE = #deviceType#
</isNotEmpty>
<isNotEmpty prepend=" AND " property="deviceCode">
DEVICE_CODE = #deviceCode#
</isNotEmpty>
<isNotEmpty prepend=" AND " property="deviceName">
DEVICE_NAME LIKE CONCAT('%', #deviceName#, '%')
</isNotEmpty>
<isNotEmpty prepend=" AND " property="deviceModel">
DEVICE_MODEL LIKE CONCAT('%', #deviceModel#, '%')
</isNotEmpty>
<isNotEmpty prepend=" AND " property="logDate">
LOG_DATE = #logDate#
</isNotEmpty>
<isNotEmpty prepend=" AND " property="status">
STATUS = #status#
</isNotEmpty>
<isNotEmpty prepend=" AND " property="latelyStartTime">
LATELY_START_TIME = #latelyStartTime#
</isNotEmpty>
<isNotEmpty prepend=" AND " property="latelyEntTime">
LATELY_ENT_TIME = #latelyEntTime#
</isNotEmpty>
<isNotEmpty prepend=" AND " property="startDura">
START_DURA = #startDura#
</isNotEmpty>
<isNotEmpty prepend=" AND " property="endDura">
END_DURA = #endDura#
</isNotEmpty>
</sql>
<select id="query" parameterClass="HashMap" resultClass="HGSB008">
SELECT
ID as "id", <!-- ID -->
ACCOUNT_CODE as "accountCode", <!-- 账套 -->
DEP_CODE as "depCode", <!-- 部门编码 -->
CREATED_BY as "createdBy", <!-- 创建人 -->
CREATED_NAME as "createdName", <!-- 创建人名称 -->
CREATED_TIME as "createdTime", <!-- 创建时间 -->
UPDATED_BY as "updatedBy", <!-- 修改人 -->
UPDATED_NAME as "updatedName", <!-- 修改人名称 -->
UPDATED_TIME as "updatedTime", <!-- 修改时间 -->
DELETE_FLAG as "deleteFlag", <!-- 是否删除 0-否1-是 -->
COMPANY_CODE as "companyCode", <!-- 公司编码 -->
COMPANY_NAME as "companyName", <!-- 公司名称 -->
FACTORY_CODE as "factoryCode", <!-- 工厂代码 -->
FACTORY_NAME as "factoryName", <!-- 工厂名称 -->
GROUP_CODE as "groupCode", <!-- 设备区域编码 -->
GROUP_NAME as "groupName", <!-- 设备区域名称 -->
DEVICE_TYPE as "deviceType", <!-- 设备类型 -->
DEVICE_CODE as "deviceCode", <!-- 设备编码 -->
DEVICE_NAME as "deviceName", <!-- 设备名称 -->
DEVICE_MODEL as "deviceModel", <!-- 设备型号 -->
LOG_DATE as "logDate", <!-- 日志日期 -->
STATUS as "status", <!-- 运行状态 0-停机 1-开机 -->
LATELY_START_TIME as "latelyStartTime", <!-- 最近开机时间 -->
LATELY_ENT_TIME as "latelyEntTime", <!-- 最近停机时间 -->
START_DURA as "startDura", <!-- 开机时长 -->
END_DURA as "endDura" <!-- 关机时长 -->
FROM ${hggpSchema}.HGSB008 WHERE 1=1
<include refid="condition" />
<dynamic prepend="ORDER BY">
<isNotEmpty property="orderBy">
$orderBy$
</isNotEmpty>
<isEmpty property="orderBy">
LOG_DATE desc, CREATED_TIME desc, ID asc
</isEmpty>
</dynamic>
</select>
<select id="count" resultClass="int">
SELECT COUNT(*) FROM ${hggpSchema}.HGSB008 WHERE 1=1
<include refid="condition" />
</select>
<!--
<isNotEmpty prepend=" AND " property="id">
ID = #id#
</isNotEmpty>
<isNotEmpty prepend=" AND " property="accountCode">
ACCOUNT_CODE = #accountCode#
</isNotEmpty>
<isNotEmpty prepend=" AND " property="depCode">
DEP_CODE = #depCode#
</isNotEmpty>
<isNotEmpty prepend=" AND " property="createdBy">
CREATED_BY = #createdBy#
</isNotEmpty>
<isNotEmpty prepend=" AND " property="createdName">
CREATED_NAME = #createdName#
</isNotEmpty>
<isNotEmpty prepend=" AND " property="createdTime">
CREATED_TIME = #createdTime#
</isNotEmpty>
<isNotEmpty prepend=" AND " property="updatedBy">
UPDATED_BY = #updatedBy#
</isNotEmpty>
<isNotEmpty prepend=" AND " property="updatedName">
UPDATED_NAME = #updatedName#
</isNotEmpty>
<isNotEmpty prepend=" AND " property="updatedTime">
UPDATED_TIME = #updatedTime#
</isNotEmpty>
<isNotEmpty prepend=" AND " property="deleteFlag">
DELETE_FLAG = #deleteFlag#
</isNotEmpty>
<isNotEmpty prepend=" AND " property="companyCode">
COMPANY_CODE = #companyCode#
</isNotEmpty>
<isNotEmpty prepend=" AND " property="companyName">
COMPANY_NAME = #companyName#
</isNotEmpty>
<isNotEmpty prepend=" AND " property="factoryCode">
FACTORY_CODE = #factoryCode#
</isNotEmpty>
<isNotEmpty prepend=" AND " property="factoryName">
FACTORY_NAME = #factoryName#
</isNotEmpty>
<isNotEmpty prepend=" AND " property="groupCode">
GROUP_CODE = #groupCode#
</isNotEmpty>
<isNotEmpty prepend=" AND " property="groupName">
GROUP_NAME = #groupName#
</isNotEmpty>
<isNotEmpty prepend=" AND " property="deviceType">
DEVICE_TYPE = #deviceType#
</isNotEmpty>
<isNotEmpty prepend=" AND " property="deviceCode">
DEVICE_CODE = #deviceCode#
</isNotEmpty>
<isNotEmpty prepend=" AND " property="deviceName">
DEVICE_NAME = #deviceName#
</isNotEmpty>
<isNotEmpty prepend=" AND " property="deviceModel">
DEVICE_MODEL = #deviceModel#
</isNotEmpty>
<isNotEmpty prepend=" AND " property="logDate">
LOG_DATE = #logDate#
</isNotEmpty>
<isNotEmpty prepend=" AND " property="status">
STATUS = #status#
</isNotEmpty>
<isNotEmpty prepend=" AND " property="latelyStartTime">
LATELY_START_TIME = #latelyStartTime#
</isNotEmpty>
<isNotEmpty prepend=" AND " property="latelyEntTime">
LATELY_ENT_TIME = #latelyEntTime#
</isNotEmpty>
<isNotEmpty prepend=" AND " property="startDura">
START_DURA = #startDura#
</isNotEmpty>
<isNotEmpty prepend=" AND " property="endDura">
END_DURA = #endDura#
</isNotEmpty>
-->
<insert id="insert">
INSERT INTO ${hggpSchema}.HGSB008 (ID, <!-- ID -->
ACCOUNT_CODE, <!-- 账套 -->
DEP_CODE, <!-- 部门编码 -->
CREATED_BY, <!-- 创建人 -->
CREATED_NAME, <!-- 创建人名称 -->
CREATED_TIME, <!-- 创建时间 -->
UPDATED_BY, <!-- 修改人 -->
UPDATED_NAME, <!-- 修改人名称 -->
UPDATED_TIME, <!-- 修改时间 -->
DELETE_FLAG, <!-- 是否删除 0-否1-是 -->
COMPANY_CODE, <!-- 公司编码 -->
COMPANY_NAME, <!-- 公司名称 -->
FACTORY_CODE, <!-- 工厂代码 -->
FACTORY_NAME, <!-- 工厂名称 -->
GROUP_CODE, <!-- 设备区域编码 -->
GROUP_NAME, <!-- 设备区域名称 -->
DEVICE_TYPE, <!-- 设备类型 -->
DEVICE_CODE, <!-- 设备编码 -->
DEVICE_NAME, <!-- 设备名称 -->
DEVICE_MODEL, <!-- 设备型号 -->
LOG_DATE, <!-- 日志日期 -->
STATUS, <!-- 运行状态 0-停机 1-开机 -->
LATELY_START_TIME, <!-- 最近开机时间 -->
LATELY_ENT_TIME, <!-- 最近停机时间 -->
START_DURA, <!-- 开机时长 -->
END_DURA <!-- 关机时长 -->
)
VALUES (#id#, #accountCode#, #depCode#, #createdBy#, #createdName#, #createdTime#, #updatedBy#, #updatedName#, #updatedTime#, #deleteFlag#, #companyCode#, #companyName#, #factoryCode#, #factoryName#, #groupCode#, #groupName#, #deviceType#, #deviceCode#, #deviceName#, #deviceModel#, #logDate#, #status#, #latelyStartTime#, #latelyEntTime#, #startDura#, #endDura#)
</insert>
<delete id="delete">
DELETE FROM ${hggpSchema}.HGSB008 WHERE
ID = #id#
</delete>
<update id="update">
UPDATE ${hggpSchema}.HGSB008
SET
ACCOUNT_CODE = #accountCode#, <!-- 账套 -->
DEP_CODE = #depCode#, <!-- 部门编码 -->
CREATED_BY = #createdBy#, <!-- 创建人 -->
CREATED_NAME = #createdName#, <!-- 创建人名称 -->
CREATED_TIME = #createdTime#, <!-- 创建时间 -->
UPDATED_BY = #updatedBy#, <!-- 修改人 -->
UPDATED_NAME = #updatedName#, <!-- 修改人名称 -->
UPDATED_TIME = #updatedTime#, <!-- 修改时间 -->
DELETE_FLAG = #deleteFlag#, <!-- 是否删除 0-否1-是 -->
COMPANY_CODE = #companyCode#, <!-- 公司编码 -->
COMPANY_NAME = #companyName#, <!-- 公司名称 -->
FACTORY_CODE = #factoryCode#, <!-- 工厂代码 -->
FACTORY_NAME = #factoryName#, <!-- 工厂名称 -->
GROUP_CODE = #groupCode#, <!-- 设备区域编码 -->
GROUP_NAME = #groupName#, <!-- 设备区域名称 -->
DEVICE_TYPE = #deviceType#, <!-- 设备类型 -->
DEVICE_CODE = #deviceCode#, <!-- 设备编码 -->
DEVICE_NAME = #deviceName#, <!-- 设备名称 -->
DEVICE_MODEL = #deviceModel#, <!-- 设备型号 -->
LOG_DATE = #logDate#, <!-- 日志日期 -->
STATUS = #status#, <!-- 运行状态 0-停机 1-开机 -->
LATELY_START_TIME = #latelyStartTime#, <!-- 最近开机时间 -->
LATELY_ENT_TIME = #latelyEntTime#, <!-- 最近停机时间 -->
START_DURA = #startDura#, <!-- 开机时长 -->
END_DURA = #endDura# <!-- 关机时长 -->
WHERE
ID = #id#
</update>
</sqlMap>
package com.baosight.hggp.hg.sc.service;
import com.baosight.hggp.common.DdynamicEnum;
import com.baosight.hggp.core.constant.CommonConstant;
import com.baosight.hggp.core.dao.DaoUtils;
import com.baosight.hggp.core.tools.EDTools;
import com.baosight.hggp.hg.ds.domain.HGDS002;
import com.baosight.hggp.hg.sc.domain.HGSC099;
import com.baosight.hggp.hg.sj.domain.HGSJ003;
import com.baosight.hggp.util.FileUtils;
import com.baosight.hggp.util.LogUtils;
import com.baosight.hggp.util.contants.ACConstants;
import com.baosight.iplat4j.core.ProjectInfo;
import com.baosight.iplat4j.core.ei.EiConstant;
import com.baosight.iplat4j.core.ei.EiInfo;
import com.baosight.iplat4j.core.exception.PlatException;
import com.baosight.iplat4j.core.service.impl.ServiceEPBase;
import com.baosight.iplat4j.core.service.soa.XServiceManager;
import org.springframework.util.CollectionUtils;
import java.util.*;
import java.util.stream.Collectors;
/**
* @Author wwl
* @Date 2024/5/6 19:48
*/
public class ServiceHGSC004B extends ServiceEPBase {
/**
* 画面初始化
*
* @param inInfo
* @return
*/
public EiInfo initLoad(EiInfo inInfo) {
try {
inInfo.addBlock(EiConstant.resultBlock).addBlockMeta(new HGSC099().eiMetadata);
} catch (PlatException e) {
LogUtils.setDetailMsg(inInfo, e, "初始化失败");
}
return inInfo;
}
/**
* 查询操作
*
* @param inInfo
* @return
*/
@Override
public EiInfo query(EiInfo inInfo) {
try {
// 项目环境
String projectEnv = ProjectInfo.getProjectEnv();
List<Map<String, Object>> EDCM01List = EDTools.EdCm01.list("hggp.sc.bizType");
if(!CollectionUtils.isEmpty(EDCM01List)){
List<String> bizTypes = new ArrayList<>();
for(Map<String, Object> map : EDCM01List){
bizTypes.add(map.get("itemCode").toString());
}
inInfo.setCell(EiConstant.queryBlock, ACConstants.ROW_CODE_0, "bizTypes",bizTypes);
}
if (CommonConstant.projectEnv.RUN.equalsIgnoreCase(projectEnv)) {
inInfo = super.query(inInfo, "HGSC099.queryRun", new HGSC099());
} else {
inInfo = super.query(inInfo, "HGSC099.queryDev", new HGSC099());
}
} catch (Throwable e) {
LogUtils.setDetailMsg(inInfo, e, "查询失败");
}
return inInfo;
}
/**
* 新增操作
*
* @param inInfo
* @return
*/
@Override
public EiInfo insert(EiInfo inInfo) {
try {
List<Map> resultRows = inInfo.getBlock(EiConstant.resultBlock).getRows();
for (int i = 0; i < resultRows.size(); i++) {
HGSC099 hgsc099 = new HGSC099();
hgsc099.fromMap(resultRows.get(i));
DaoUtils.insert(HGSC099.INSERT, hgsc099);
}
inInfo.setStatus(EiConstant.STATUS_DEFAULT);
inInfo.setMsg("操作成功!本次对[" + resultRows.size() + "]条数据新增成功!");
} catch (Exception e) {
LogUtils.setDetailMsg(inInfo, e, "新增失败");
}
return inInfo;
}
/**
* 删除操作
*
* @param inInfo
* @return
*/
public EiInfo delete(EiInfo inInfo) {
try {
List<Map> resultRows = inInfo.getBlock(EiConstant.resultBlock).getRows();
for (int i = 0; i < resultRows.size(); i++) {
HGSC099 hgsc099 = new HGSC099();
hgsc099.fromMap(resultRows.get(i));
DaoUtils.update(HGSC099.DELETE, hgsc099);
if (!hgsc099.getDocId().isEmpty()) {
this.delectDoc(hgsc099.getDocId());
}
}
inInfo = this.query(inInfo);
inInfo.setStatus(EiConstant.STATUS_DEFAULT);
inInfo.setMsg("操作成功!本次对[" + resultRows.size() + "]条数据删除成功!");
} catch (Exception e) {
LogUtils.setDetailMsg(inInfo, e, "删除失败");
}
return inInfo;
}
/**
* 删除文件
* @param docId 文件ID
*/
public void delectDoc(String docId){
Map<String,Object> map = new HashMap<>();
map.put("docId",docId);
List<HGDS002> list = this.dao.query(HGDS002.QUERY,map);
if (list.size() > 0) {
String realPath = list.get(0).getRealPath();
// 项目环境
String projectEnv = ProjectInfo.getProjectEnv();
if (projectEnv.equals(CommonConstant.projectEnv.RUN)) {
EiInfo queryInfo = new EiInfo();
queryInfo.set(HGSC099.FIELD_doc_id,list.get(0).getDocId());
//获取文档信息
queryInfo.set(EiConstant.serviceId,"S_EU_0102");
EiInfo docInfo = XServiceManager.call(queryInfo);
//数据库
Map docInfoMap = docInfo.getMap("docMap");
if (docInfoMap.size() > 0) {
EiInfo eiInfo = new EiInfo();
eiInfo.set("data",docInfoMap.get("url")+"-"+0);
eiInfo.set(EiConstant.serviceId,"S_EU_0105");
//调用接口
EiInfo outInfo = XServiceManager.call(eiInfo);
if(outInfo.getStatus() == EiConstant.STATUS_FAILURE){
LogUtils.setDetailMsg(outInfo, new Throwable(), "查询部件类型失败");
outInfo.setMsg("失败");
}
}
}else {
FileUtils.deleteFile(realPath);
}
this.dao.delete(HGDS002.DELETE,map);
}
}
}
package com.baosight.hggp.hg.sc.service;
import com.baosight.iplat4j.core.ei.EiInfo;
import com.baosight.iplat4j.core.service.impl.ServiceBase;
/**
*
*/
public class ServiceHGSC004C extends ServiceBase {
/**
* 画面初始化.
*/
public EiInfo initLoad(EiInfo inInfo) {
return inInfo;
}
/**
* 附件上传.
*/
public EiInfo form(EiInfo inInfo) {
return inInfo;
}
}
...@@ -4,16 +4,16 @@ ...@@ -4,16 +4,16 @@
Version : 1.0 Version : 1.0
schema : hggp schema : hggp
tableName : HGSC099 tableName : HGSC099
id BIGINT NOT NULL primarykey, id BIGINT NOT NULL primarykey,
account_code VARCHAR NOT NULL, account_code VARCHAR NOT NULL,
mat_id BIGINT, mat_id BIGINT,
doc_id VARCHAR, doc_id VARCHAR,
created_by VARCHAR, created_by VARCHAR,
created_name VARCHAR, created_name VARCHAR,
created_time VARCHAR, created_time VARCHAR,
updated_by VARCHAR, updated_by VARCHAR,
updated_name VARCHAR, updated_name VARCHAR,
updated_time VARCHAR, updated_time VARCHAR,
biz_type VARCHAR biz_type VARCHAR
--> -->
<sqlMap namespace="HGSC099"> <sqlMap namespace="HGSC099">
...@@ -72,6 +72,9 @@ ...@@ -72,6 +72,9 @@
<isNotEmpty prepend=" AND " property="matId"> <isNotEmpty prepend=" AND " property="matId">
A.MAT_ID = #matId# A.MAT_ID = #matId#
</isNotEmpty> </isNotEmpty>
<isNotEmpty prepend=" AND " property="bizTypes">
A.BIZ_TYPE IN <iterate close=")" open="(" conjunction="," property="bizTypes">#bizTypes[]#</iterate>
</isNotEmpty>
<isNotEmpty prepend=" AND " property="docId"> <isNotEmpty prepend=" AND " property="docId">
A.DOC_ID = #docId# A.DOC_ID = #docId#
</isNotEmpty> </isNotEmpty>
......
$(function () {
$(".row").children().attr("class", "col-md-3");
/* 页面查询框的尺寸设置 */
$.extend(true, IPLATUI.Config, {
EFGrid: {
height: $(document).height() - $("#inqu").height() - $("#ef_form_head").height() - 100,
}
});
IPLATUI.EFGrid = {
"result": {
pageable: {
pageSize: 10,
pageSizes: [10, 20, 50, 100],
},
columns: [{
field: "status",
template: function (item) {
let template = '';
if (item.status == 1){
template = "<span style='color: #67c20b;font-weight: bold'>开机</span>";
}else if (item.status == 0){
template = "<span style='color: red;font-weight: bold'>关机</span>";
}
return template;
}
}
],
exportGrid: {
exportFileName: function (gridInstance) {
// 导出的文件名包含时间戳 yyyy-MM-dd HH:mm:ss
return "设备监控_" + kendo.toString(new Date(), IPLAT.FORMAT.DATE_14_PR);
},
exportFileType: "xls", // 默认值是xls,可选值为pdf[规划中]
exportBlockId: "result", // 默认值和blockId相同,导出的EiInfo中的指定数据块被导出
},
loadComplete: function(grid) {
// 此 grid 对象
$("#QUERY").on("click", function () {
grid.dataSource.page(1);
});
}
}
}
});
\ No newline at end of file
<%--
Created by IntelliJ IDEA.
User: 1
Date: 2024/5/20
Time: 17:13
To change this template use File | Settings | File Templates.
--%>
<!DOCTYPE html>
<%@ page contentType="text/html;charset=UTF-8" language="java" %>
<%@ taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c" %>
<%@ taglib prefix="EF" tagdir="/WEB-INF/tags/EF" %>
<c:set var="ctx" value="${pageContext.request.contextPath}"/>
<EF:EFPage title="设备监控">
<EF:EFRegion id="inqu" title="查询条件">
<div class="row">
<EF:EFSelect blockId="inqu_status" row="0" ename="companyCode" cname="公司名称" colWidth="3" filter="contains">
<EF:EFOption label="全部" value=""/>
<EF:EFOptions blockId="companyBox_block_id" textField="textField" valueField="valueField"/>
</EF:EFSelect>
<EF:EFDatePicker blockId="inqu_status" row="0" ename="logDate" cname="日期" role="date"
format="yyyy-MM-dd" parseFormats="['yyyyMMdd']" colWidth="3"/>
<EF:EFInput blockId="inqu_status" row="0" ename="deviceName" cname="设备名称" placeholder="模糊查询" colWidth="3"/>
<EF:EFSelect blockId="inqu_status" row="0" ename="status" cname="运行状态" colWidth="3" filter="contains">
<EF:EFOption label="全部" value=""/>
<EF:EFOptions blockId="run_status_block_id" textField="textField" valueField="valueField"/>
</EF:EFSelect>
</div>
</EF:EFRegion>
<EF:EFRegion id="result" title="设备监控">
<EF:EFGrid blockId="result" autoDraw="override" isFloat="true">
<EF:EFColumn ename="id" primaryKey="true" cname="内码" hidden="true"/>
<EF:EFColumn ename="accountCode" cname="账套" hidden="true"/>
<EF:EFComboColumn ename="companyCode" cname="公司名称"
columnTemplate="#=textField#" itemTemplate="#=textField#"
textField="textField" valueField="valueField"
maxLength="16" readonly="true" width="120" required="true"
align="center" filter="contains" sort="true">
<EF:EFOptions blockId="companyBox_block_id" textField="textField" valueField="valueField"/>
</EF:EFComboColumn>
<EF:EFColumn ename="logDate" cname="日期" width="120" align="center" editType="date"
dateFormat="yyyy-MM-dd" parseFormats="['yyyyMMdd']" readonly="true" required="true"/>
<EF:EFComboColumn ename="deviceCode" cname="设备名称"
columnTemplate="#=textField#" itemTemplate="#=textField#"
textField="textField" valueField="valueField"
maxLength="16" readonly="true" width="120" required="true"
align="center" filter="contains" sort="true">
<EF:EFOptions blockId="deviceCodeBox_block_id" textField="textField" valueField="valueField"/>
</EF:EFComboColumn>
<EF:EFComboColumn ename="status" cname="运行状态"
columnTemplate="#=textField#" itemTemplate="#=textField#"
textField="textField" valueField="valueField"
maxLength="16" readonly="true" width="120"
align="center" filter="contains" sort="true">
<EF:EFOptions blockId="run_status_block_id" textField="textField" valueField="valueField"/>
</EF:EFComboColumn>
<EF:EFColumn ename="latelyStartTime" cname="最近开始日期" width="120" align="center" editType="datetime"
dateFormat="yyyy-MM-dd hh:mm:ss " parseFormats="['yyyyMMddHHmmss']" readonly="true" required="true"/>
<EF:EFColumn ename="startDura" cname="开机时长" width="120" align="center" editType="date"
dateFormat="hh时mm分" parseFormats="['hhmmss']" readonly="true" required="true"/>
<EF:EFColumn ename="latelyEntTime" cname="最近停机日期" width="120" align="center" editType="datetime"
dateFormat="yyyy-MM-dd hh:mm:ss " parseFormats="['yyyyMMddHHmmss']" readonly="true" required="true"/>
<EF:EFColumn ename="endDura" cname="关机时长" width="120" align="center" editType="date"
dateFormat="hh时mm分" parseFormats="['hhmmss']" readonly="true" required="true"/>
</EF:EFGrid>
</EF:EFRegion>
</EF:EFPage>
<style>
.my-head {
display: flex;
padding-right: 12px;
background: #ffffff;
box-shadow: 0px 1px 6px 0px rgba(0, 0, 0, 0.12);
margin-bottom: 3px;
}
#my-front {
width: 50%;
display: flex;
align-items: center;
text-align: center;
justify-content: flex-start;
}
#my-behind {
width: 50%;
display: flex;
align-items: center;
text-align: center;
justify-content: flex-end;
padding-right: 4px;
}
.my-button {
border: none;
background: transparent;
margin-bottom: 2px;
margin-left: 16px;
}
.my-text {
font-size: .875rem;
height: 1.75rem;
line-height: 1;
letter-spacing: 0;
font-weight: 500;
overflow: hidden;
box-sizing: border-box;
display: inline-flex;
align-items: center;
}
#my-text1 {
color: #3088F4;
}
#my-text2 {
color: rgba(0, 0, 0, 0.85);
}
</style>
...@@ -233,7 +233,7 @@ function showDetail(id,companyCode,projCode) { ...@@ -233,7 +233,7 @@ function showDetail(id,companyCode,projCode) {
*/ */
function showUploadFile(id) { function showUploadFile(id) {
JSColorbox.open({ JSColorbox.open({
href: "HGSC099?methodName=initLoad&inqu_status-0-bizType=WLQD&inqu_status-0-matId=" + id, href: "HGSC004B?methodName=initLoad&inqu_status-0-matId=" + id,
title: "<div style='text-align: center;'>附件详情</div>", title: "<div style='text-align: center;'>附件详情</div>",
width: "80%", width: "80%",
height: "80%", height: "80%",
......
...@@ -52,7 +52,7 @@ var query = function (e) { ...@@ -52,7 +52,7 @@ var query = function (e) {
*/ */
function uploadFile(id) { function uploadFile(id) {
JSColorbox.open({ JSColorbox.open({
href: "HGSC099A?methodName=initLoad&inqu_status-0-bizType="+$("#inqu_status-0-bizType").val()+"&inqu_status-0-matId="+$("#inqu_status-0-matId").val(), href: "HGSC004C?methodName=initLoad&inqu_status-0-matId="+$("#inqu_status-0-matId").val(),
title: "<div style='text-align: center;'>附件上传</div>", title: "<div style='text-align: center;'>附件上传</div>",
width: "60%", width: "60%",
height: "50%", height: "50%",
...@@ -65,12 +65,12 @@ function uploadFile(id) { ...@@ -65,12 +65,12 @@ function uploadFile(id) {
* *
* @param docId * @param docId
*/ */
function uploadFileCallback(docId) { function uploadFileCallback(docId,bizType) {
let inEiInfo = new EiInfo(); let inEiInfo = new EiInfo();
inEiInfo.set("result-0-matId", $("#inqu_status-0-matId").val()); inEiInfo.set("result-0-matId", $("#inqu_status-0-matId").val());
inEiInfo.set("result-0-docId", docId); inEiInfo.set("result-0-docId", docId);
inEiInfo.set("result-0-bizType", $("#inqu_status-0-bizType").val()); inEiInfo.set("result-0-bizType", bizType);
EiCommunicator.send('HGSC099', 'insert', inEiInfo, { EiCommunicator.send('HGSC004B', 'insert', inEiInfo, {
onSuccess(response) { onSuccess(response) {
resultGrid.dataSource.page(1); resultGrid.dataSource.page(1);
}, },
...@@ -93,7 +93,7 @@ function deleteFunc() { ...@@ -93,7 +93,7 @@ function deleteFunc() {
} }
JSUtils.confirm("确定对勾选中的[" + rows.length + "]条数据做\"删除\"操作?", { JSUtils.confirm("确定对勾选中的[" + rows.length + "]条数据做\"删除\"操作?", {
ok: function () { ok: function () {
JSUtils.submitGridsData("result", "HGSC099", "delete", true); JSUtils.submitGridsData("result", "HGSC004B", "delete", true);
} }
}) })
} }
...@@ -8,8 +8,11 @@ ...@@ -8,8 +8,11 @@
<EF:EFPage title="附件清单"> <EF:EFPage title="附件清单">
<EF:EFRegion id="inqu" title="查询区域" type="query"> <EF:EFRegion id="inqu" title="查询区域" type="query">
<EF:EFInput cname="主表ID" ename="matId" blockId="inqu_status" row="0" type="hidden"/> <EF:EFInput cname="主表ID" ename="matId" blockId="inqu_status" row="0" type="hidden"/>
<EF:EFInput cname="业务类型" ename="bizType" blockId="inqu_status" row="0" type="hidden"/>
<div class="row"> <div class="row">
<EF:EFSelect cname="文件类型" ename="inqu_status-0-bizType" colWidth="3" filter="contains">
<EF:EFOption label="全部" value=""/>
<EF:EFCodeOption codeName="hggp.sc.bizType" />
</EF:EFSelect>
<EF:EFInput cname="文件名称" ename="docName" blockId="inqu_status" row="0" colWidth="3" /> <EF:EFInput cname="文件名称" ename="docName" blockId="inqu_status" row="0" colWidth="3" />
</div> </div>
</EF:EFRegion> </EF:EFRegion>
...@@ -19,6 +22,9 @@ ...@@ -19,6 +22,9 @@
<EF:EFColumn ename="id" cname="ID" hidden="true"/> <EF:EFColumn ename="id" cname="ID" hidden="true"/>
<EF:EFColumn ename="docId" cname="文件ID" enable="false" width="150"/> <EF:EFColumn ename="docId" cname="文件ID" enable="false" width="150"/>
<EF:EFColumn ename="docName" cname="文件名称" enable="false" width="150"/> <EF:EFColumn ename="docName" cname="文件名称" enable="false" width="150"/>
<EF:EFComboColumn ename="bizType" cname="文件类型" width="80" align="center" enable="false" required="false">
<EF:EFCodeOption codeName="hggp.sc.bizType" />
</EF:EFComboColumn>
<EF:EFColumn ename="createdTime" cname="创建时间" enable="false" width="140" align="center" <EF:EFColumn ename="createdTime" cname="创建时间" enable="false" width="140" align="center"
parseFormats="['yyyyMMddHHmmss']" editType="datetime" dateFormat="yyyy-MM-dd HH:mm:ss"/> parseFormats="['yyyyMMddHHmmss']" editType="datetime" dateFormat="yyyy-MM-dd HH:mm:ss"/>
<EF:EFColumn ename="operator" cname="操作" enable="false" width="200" align="center"/> <EF:EFColumn ename="operator" cname="操作" enable="false" width="200" align="center"/>
......
...@@ -13,7 +13,7 @@ $(function () { ...@@ -13,7 +13,7 @@ $(function () {
console.log($("#fileDocId").val()) console.log($("#fileDocId").val())
saveTemp(e); saveTemp(e);
try { try {
parent.JSColorbox.setValueCallback(docId); parent.JSColorbox.setValueCallback(docId,$("#inqu_status-0-bizType").val());
} catch (e){ } catch (e){
} }
}, },
......
...@@ -7,7 +7,10 @@ ...@@ -7,7 +7,10 @@
<EF:EFPage title="附件上传"> <EF:EFPage title="附件上传">
<EF:EFInput cname="主表ID" ename="matId" blockId="inqu_status" row="0" type="hidden"/> <EF:EFInput cname="主表ID" ename="matId" blockId="inqu_status" row="0" type="hidden"/>
<EF:EFInput cname="业务类型" ename="bizType" blockId="inqu_status" row="0" type="hidden"/> <EF:EFSelect cname="业务类型" ename="inqu_status-0-bizType" colWidth="3" filter="contains">
<EF:EFOption label="全部" value=""/>
<EF:EFCodeOption codeName="hggp.sc.bizType" />
</EF:EFSelect>
<EF:EFRegion id="result"> <EF:EFRegion id="result">
<EF:EFUpload blockId="result" ename="uploadFile" docTag="hk_file11" path="HGSC"/> <EF:EFUpload blockId="result" ename="uploadFile" docTag="hk_file11" path="HGSC"/>
</EF:EFRegion> </EF:EFRegion>
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment