Commit d9ecb9c7 by liuyang

2024-05-11 设备点检

parent 1b482d6a
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:Hgsb004.java <br>
* Description: <br>
*
* Copyrigth:Baosight Software LTD.co Copyright (c) 2019. <br>
*
* @version 1.0
* @history 2024-05-11 14:49:03 create
*/
public class HGSB004 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_INSPEC_DATE = "inspecDate"; /* 点检日期*/
public static final String FIELD_INSPEC_CODE = "inspecCode"; /* 点检单号*/
public static final String FIELD_PLAN_CODE = "planCode"; /* 计划单号*/
public static final String FIELD_PLAN_START_DATE = "planStartDate"; /* 计划开始日期*/
public static final String FIELD_PLAN_END_DATE = "planEndDate"; /* 计划结束日期*/
public static final String FIELD_INSPEC_USER_ID = "inspecUserId"; /* 点检人编码*/
public static final String FIELD_INSPEC_USER_NAME = "inspecUserName"; /* 点检人名称*/
public static final String FIELD_CHECK_STATUS = "checkStatus"; /* 审核状态 0-停止 1-启用*/
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_INSPEC_DATE = "INSPEC_DATE"; /* 点检日期*/
public static final String COL_INSPEC_CODE = "INSPEC_CODE"; /* 点检单号*/
public static final String COL_PLAN_CODE = "PLAN_CODE"; /* 计划单号*/
public static final String COL_PLAN_START_DATE = "PLAN_START_DATE"; /* 计划开始日期*/
public static final String COL_PLAN_END_DATE = "PLAN_END_DATE"; /* 计划结束日期*/
public static final String COL_INSPEC_USER_ID = "INSPEC_USER_ID"; /* 点检人编码*/
public static final String COL_INSPEC_USER_NAME = "INSPEC_USER_NAME"; /* 点检人名称*/
public static final String COL_CHECK_STATUS = "CHECK_STATUS"; /* 审核状态 0-停止 1-启用*/
public static final String QUERY = "HGSB004.query";
public static final String COUNT = "HGSB004.count";
public static final String INSERT = "HGSB004.insert";
public static final String UPDATE = "HGSB004.update";
public static final String UPDATE_STATUS = "HGSB004.updateStatus";
public static final String DELETE = "HGSB004.delete";
public static final String DELETE_FLAG = "HGSB004.deleteFlag";
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 inspecDate = " "; /* 点检日期*/
private String inspecCode = " "; /* 点检单号*/
private String planCode = " "; /* 计划单号*/
private String planStartDate = " "; /* 计划开始日期*/
private String planEndDate = " "; /* 计划结束日期*/
private String inspecUserId = " "; /* 点检人编码*/
private String inspecUserName = " "; /* 点检人名称*/
private Integer checkStatus = 0; /* 审核状态 0-待审核 1-审核完成 -1 审核未通过*/
/**
* 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_INSPEC_DATE);
eiColumn.setDescName("点检日期");
eiMetadata.addMeta(eiColumn);
eiColumn = new EiColumn(FIELD_INSPEC_CODE);
eiColumn.setDescName("点检单号");
eiMetadata.addMeta(eiColumn);
eiColumn = new EiColumn(FIELD_PLAN_CODE);
eiColumn.setDescName("计划单号");
eiMetadata.addMeta(eiColumn);
eiColumn = new EiColumn(FIELD_PLAN_START_DATE);
eiColumn.setDescName("计划开始日期");
eiMetadata.addMeta(eiColumn);
eiColumn = new EiColumn(FIELD_PLAN_END_DATE);
eiColumn.setDescName("计划结束日期");
eiMetadata.addMeta(eiColumn);
eiColumn = new EiColumn(FIELD_INSPEC_USER_ID);
eiColumn.setDescName("点检人编码");
eiMetadata.addMeta(eiColumn);
eiColumn = new EiColumn(FIELD_INSPEC_USER_NAME);
eiColumn.setDescName("点检人名称");
eiMetadata.addMeta(eiColumn);
eiColumn = new EiColumn(FIELD_CHECK_STATUS);
eiColumn.setDescName("审核状态 0-停止 1-启用");
eiMetadata.addMeta(eiColumn);
}
/**
* the constructor.
*/
public HGSB004() {
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 inspecDate - 点检日期.
* @return the inspecDate
*/
public String getInspecDate() {
return this.inspecDate;
}
/**
* set the inspecDate - 点检日期.
*
* @param inspecDate - 点检日期
*/
public void setInspecDate(String inspecDate) {
this.inspecDate = inspecDate;
}
/**
* get the inspecCode - 点检单号.
* @return the inspecCode
*/
public String getInspecCode() {
return this.inspecCode;
}
/**
* set the inspecCode - 点检单号.
*
* @param inspecCode - 点检单号
*/
public void setInspecCode(String inspecCode) {
this.inspecCode = inspecCode;
}
/**
* get the planCode - 计划单号.
* @return the planCode
*/
public String getPlanCode() {
return this.planCode;
}
/**
* set the planCode - 计划单号.
*
* @param planCode - 计划单号
*/
public void setPlanCode(String planCode) {
this.planCode = planCode;
}
/**
* get the planStartDate - 计划开始日期.
* @return the planStartDate
*/
public String getPlanStartDate() {
return this.planStartDate;
}
/**
* set the planStartDate - 计划开始日期.
*
* @param planStartDate - 计划开始日期
*/
public void setPlanStartDate(String planStartDate) {
this.planStartDate = planStartDate;
}
/**
* get the planEndDate - 计划结束日期.
* @return the planEndDate
*/
public String getPlanEndDate() {
return this.planEndDate;
}
/**
* set the planEndDate - 计划结束日期.
*
* @param planEndDate - 计划结束日期
*/
public void setPlanEndDate(String planEndDate) {
this.planEndDate = planEndDate;
}
/**
* get the inspecUserId - 点检人编码.
* @return the inspecUserId
*/
public String getInspecUserId() {
return this.inspecUserId;
}
/**
* set the inspecUserId - 点检人编码.
*
* @param inspecUserId - 点检人编码
*/
public void setInspecUserId(String inspecUserId) {
this.inspecUserId = inspecUserId;
}
/**
* get the inspecUserName - 点检人名称.
* @return the inspecUserName
*/
public String getInspecUserName() {
return this.inspecUserName;
}
/**
* set the inspecUserName - 点检人名称.
*
* @param inspecUserName - 点检人名称
*/
public void setInspecUserName(String inspecUserName) {
this.inspecUserName = inspecUserName;
}
/**
* get the checkStatus - 审核状态 0-停止 1-启用.
* @return the checkStatus
*/
public Integer getCheckStatus() {
return this.checkStatus;
}
/**
* set the checkStatus - 审核状态 0-停止 1-启用.
*
* @param checkStatus - 审核状态 0-停止 1-启用
*/
public void setCheckStatus(Integer checkStatus) {
this.checkStatus = checkStatus;
}
/**
* 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));
setInspecDate(StringUtils.defaultIfEmpty(StringUtils.toString(map.get(FIELD_INSPEC_DATE)), inspecDate));
setInspecCode(StringUtils.defaultIfEmpty(StringUtils.toString(map.get(FIELD_INSPEC_CODE)), inspecCode));
setPlanCode(StringUtils.defaultIfEmpty(StringUtils.toString(map.get(FIELD_PLAN_CODE)), planCode));
setPlanStartDate(StringUtils.defaultIfEmpty(StringUtils.toString(map.get(FIELD_PLAN_START_DATE)), planStartDate));
setPlanEndDate(StringUtils.defaultIfEmpty(StringUtils.toString(map.get(FIELD_PLAN_END_DATE)), planEndDate));
setInspecUserId(StringUtils.defaultIfEmpty(StringUtils.toString(map.get(FIELD_INSPEC_USER_ID)), inspecUserId));
setInspecUserName(StringUtils.defaultIfEmpty(StringUtils.toString(map.get(FIELD_INSPEC_USER_NAME)), inspecUserName));
setCheckStatus(NumberUtils.toInteger(StringUtils.toString(map.get(FIELD_CHECK_STATUS)), checkStatus));
}
/**
* 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_INSPEC_DATE, StringUtils.toString(inspecDate, eiMetadata.getMeta(FIELD_INSPEC_DATE)));
map.put(FIELD_INSPEC_CODE, StringUtils.toString(inspecCode, eiMetadata.getMeta(FIELD_INSPEC_CODE)));
map.put(FIELD_PLAN_CODE, StringUtils.toString(planCode, eiMetadata.getMeta(FIELD_PLAN_CODE)));
map.put(FIELD_PLAN_START_DATE, StringUtils.toString(planStartDate, eiMetadata.getMeta(FIELD_PLAN_START_DATE)));
map.put(FIELD_PLAN_END_DATE, StringUtils.toString(planEndDate, eiMetadata.getMeta(FIELD_PLAN_END_DATE)));
map.put(FIELD_INSPEC_USER_ID, StringUtils.toString(inspecUserId, eiMetadata.getMeta(FIELD_INSPEC_USER_ID)));
map.put(FIELD_INSPEC_USER_NAME, StringUtils.toString(inspecUserName, eiMetadata.getMeta(FIELD_INSPEC_USER_NAME)));
map.put(FIELD_CHECK_STATUS, StringUtils.toString(checkStatus, eiMetadata.getMeta(FIELD_CHECK_STATUS)));
return map;
}
}
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:Hgsb004a.java <br>
* Description: <br>
*
* Copyrigth:Baosight Software LTD.co Copyright (c) 2019. <br>
*
* @version 1.0
* @history 2024-05-11 14:49:08 create
*/
public class HGSB004A 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_PARENT_ID = "parentId"; /* 父级ID*/
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_CHECK_ITEM = "checkItem"; /* 检查项*/
public static final String FIELD_CHECK_DESCRIP = "checkDescrip"; /* 检查描述*/
public static final String FIELD_CHECK_RESULT = "checkResult"; /* 检查描述结果*/
public static final String FIELD_DOC_ID = "docId"; /* 附件ID*/
public static final String FIELD_DOC_NAME = "docName";
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_PARENT_ID = "PARENT_ID"; /* 父级ID*/
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_CHECK_ITEM = "CHECK_ITEM"; /* 检查项*/
public static final String COL_CHECK_DESCRIP = "CHECK_DESCRIP"; /* 检查描述*/
public static final String COL_CHECK_RESULT = "CHECK_RESULT"; /* 检查描述结果*/
public static final String COL_DOC_ID = "DOC_ID"; /* 附件ID*/
public static final String QUERY = "HGSB004A.query";
public static final String COUNT = "HGSB004A.count";
public static final String INSERT = "HGSB004A.insert";
public static final String UPDATE = "HGSB004A.update";
public static final String DELETE = "HGSB004A.delete";
public static final String DELETE_FLAG = "HGSB004A.deleteFlag";
public static final String UPDATE_DOC_ID = "HGSB004A.updateDocId";
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 Long parentId = new Long(0); /* 父级ID*/
private String groupCode = " "; /* 设备区域编码*/
private String groupName = " "; /* 设备区域名称*/
private String deviceType = " "; /* 设备类型*/
private String deviceCode = " "; /* 设备编码*/
private String deviceName = " "; /* 设备名称*/
private String deviceModel = " "; /* 设备型号*/
private String checkItem = " "; /* 检查项*/
private String checkDescrip = " "; /* 检查描述*/
private String checkResult = " "; /* 检查描述结果*/
private String docId = " "; /* 附件ID*/
private String docName = " ";
/**
* 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_PARENT_ID);
eiColumn.setDescName("父级ID");
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_CHECK_ITEM);
eiColumn.setDescName("检查项");
eiMetadata.addMeta(eiColumn);
eiColumn = new EiColumn(FIELD_CHECK_DESCRIP);
eiColumn.setDescName("检查描述");
eiMetadata.addMeta(eiColumn);
eiColumn = new EiColumn(FIELD_CHECK_RESULT);
eiColumn.setDescName("检查描述结果");
eiMetadata.addMeta(eiColumn);
eiColumn = new EiColumn(FIELD_DOC_ID);
eiColumn.setDescName("附件ID");
eiMetadata.addMeta(eiColumn);
eiColumn = new EiColumn(FIELD_DOC_NAME);
eiColumn.setDescName("附件名称");
eiMetadata.addMeta(eiColumn);
}
/**
* the constructor.
*/
public HGSB004A() {
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 parentId - 父级ID.
* @return the parentId
*/
public Long getParentId() {
return this.parentId;
}
/**
* set the parentId - 父级ID.
*
* @param parentId - 父级ID
*/
public void setParentId(Long parentId) {
this.parentId = parentId;
}
/**
* 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 checkItem - 检查项.
* @return the checkItem
*/
public String getCheckItem() {
return this.checkItem;
}
/**
* set the checkItem - 检查项.
*
* @param checkItem - 检查项
*/
public void setCheckItem(String checkItem) {
this.checkItem = checkItem;
}
/**
* get the checkDescrip - 检查描述.
* @return the checkDescrip
*/
public String getCheckDescrip() {
return this.checkDescrip;
}
/**
* set the checkDescrip - 检查描述.
*
* @param checkDescrip - 检查描述
*/
public void setCheckDescrip(String checkDescrip) {
this.checkDescrip = checkDescrip;
}
/**
* get the checkResult - 检查描述结果.
* @return the checkResult
*/
public String getCheckResult() {
return this.checkResult;
}
/**
* set the checkResult - 检查描述结果.
*
* @param checkResult - 检查描述结果
*/
public void setCheckResult(String checkResult) {
this.checkResult = checkResult;
}
/**
* get the docId - 附件ID.
* @return the docId
*/
public String getDocId() {
return this.docId;
}
/**
* set the docId - 附件ID.
*
* @param docId - 附件ID
*/
public void setDocId(String docId) {
this.docId = docId;
}
public String getDocName() {
return docName;
}
public void setDocName(String docName) {
this.docName = docName;
}
/**
* 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));
setParentId(NumberUtils.toLong(StringUtils.toString(map.get(FIELD_PARENT_ID)), parentId));
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));
setCheckItem(StringUtils.defaultIfEmpty(StringUtils.toString(map.get(FIELD_CHECK_ITEM)), checkItem));
setCheckDescrip(StringUtils.defaultIfEmpty(StringUtils.toString(map.get(FIELD_CHECK_DESCRIP)), checkDescrip));
setCheckResult(StringUtils.defaultIfEmpty(StringUtils.toString(map.get(FIELD_CHECK_RESULT)), checkResult));
setDocId(StringUtils.defaultIfEmpty(StringUtils.toString(map.get(FIELD_DOC_ID)), docId));
setDocName(StringUtils.defaultIfEmpty(StringUtils.toString(map.get(FIELD_DOC_NAME)), docName));
}
/**
* 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_PARENT_ID, StringUtils.toString(parentId, eiMetadata.getMeta(FIELD_PARENT_ID)));
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_CHECK_ITEM, StringUtils.toString(checkItem, eiMetadata.getMeta(FIELD_CHECK_ITEM)));
map.put(FIELD_CHECK_DESCRIP, StringUtils.toString(checkDescrip, eiMetadata.getMeta(FIELD_CHECK_DESCRIP)));
map.put(FIELD_CHECK_RESULT, StringUtils.toString(checkResult, eiMetadata.getMeta(FIELD_CHECK_RESULT)));
map.put(FIELD_DOC_ID, StringUtils.toString(docId, eiMetadata.getMeta(FIELD_DOC_ID)));
map.put(FIELD_DOC_NAME, StringUtils.toString(docName, eiMetadata.getMeta(FIELD_DOC_NAME)));
return map;
}
}
package com.baosight.hggp.hg.sb.service;
import com.baosight.hggp.aspect.annotation.OperationLogAnnotation;
import com.baosight.hggp.common.DdynamicEnum;
import com.baosight.hggp.core.constant.CommonConstant;
import com.baosight.hggp.core.dao.DaoUtils;
import com.baosight.hggp.hg.constant.HGConstant;
import com.baosight.hggp.hg.sb.domain.HGSB004;
import com.baosight.hggp.util.CommonMethod;
import com.baosight.hggp.util.ErrorCodeUtils;
import com.baosight.hggp.util.LogUtils;
import com.baosight.hggp.util.StringUtil;
import com.baosight.hggp.util.contants.ACConstants;
import com.baosight.iplat4j.core.ei.EiBlock;
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.resource.I18nMessages;
import com.baosight.iplat4j.core.service.impl.ServiceEPBase;
import com.baosight.iplat4j.ed.util.SequenceGenerator;
import java.util.Arrays;
import java.util.List;
import java.util.Map;
/**
* @author LiuYang
* @version 1.0 2024/5/11
*/
public class ServiceHGSB004 extends ServiceEPBase {
@Override
public EiInfo initLoad(EiInfo inInfo) {
inInfo.setCell(EiConstant.queryBlock, ACConstants.ROW_CODE_0, HGSB004.FIELD_DELETE_FLAG, CommonConstant.YesNo.NO_0);
inInfo = super.query(inInfo, HGSB004.QUERY, new HGSB004());
CommonMethod.initBlock(inInfo,
Arrays.asList(DdynamicEnum.COMPANY_BOX_BLOCK_ID,DdynamicEnum.USER_BLOCK_ID,DdynamicEnum.GROUP_CODE_BOX_BLOCK_ID),null
);
return inInfo;
}
@Override
public EiInfo query(EiInfo inInfo) {
EiBlock block = inInfo.getBlock(EiConstant.queryBlock);
block.setCell(ACConstants.ROW_CODE_0, HGSB004.FIELD_DELETE_FLAG, CommonConstant.YesNo.NO_0);
String planDate = block.getCellStr(ACConstants.ROW_CODE_0,HGSB004.FIELD_INSPEC_DATE);
if (!planDate.isEmpty()) {
inInfo.setCell(EiConstant.queryBlock, ACConstants.ROW_CODE_0,HGSB004.FIELD_INSPEC_DATE, StringUtil.removeHorizontalLine(planDate));
}
return super.query(inInfo,HGSB004.QUERY,new HGSB004());
}
@OperationLogAnnotation(operModul = "设备点检",operType = "删除",operDesc = "删除操作")
@Override
public EiInfo delete(EiInfo inInfo) {
int i = 0;
try {
HGSB004 hgsb004 = new HGSB004();
EiBlock eiBlock = inInfo.getBlock(EiConstant.resultBlock);
for (i = 0; i < eiBlock.getRowCount(); i++) {
Map<?, ?> map = eiBlock.getRow(i);
hgsb004.fromMap(map);
hgsb004.setDeleteFlag(CommonConstant.YesNo.YES_1);
DaoUtils.update(HGSB004.DELETE_FLAG, hgsb004.toMap());
}
inInfo.setStatus(EiConstant.STATUS_SUCCESS);
inInfo.setMsgByKey("ep.1000", new String[]{String.valueOf(i), I18nMessages.getText("label.delete", "删除")});
} catch (PlatException e) {
e.printStackTrace();
inInfo.setStatus(EiConstant.STATUS_FAILURE);
ErrorCodeUtils.handleDeleteException(inInfo,i,e);
logError("删除失败", e.getMessage());
return inInfo;
}
return inInfo;
}
/**
* 保存操作
*/
@OperationLogAnnotation(operModul = "设备点检",operType = "保存",operDesc = "保存操作")
public EiInfo save(EiInfo inInfo) {
try {
List<Map> resultRows = inInfo.getBlock(EiConstant.resultBlock).getRows();
// 写入数据
for (int i = 0; i < resultRows.size(); i++) {
HGSB004 hgsb004 = new HGSB004();
hgsb004.fromMap(resultRows.get(i));
if (hgsb004.getId() == null || hgsb004.getId() == 0) {
this.add(hgsb004);
} else {
this.modify(hgsb004);
}
}
inInfo.setStatus(EiConstant.STATUS_DEFAULT);
inInfo.setMsg("操作成功!本次对[" + resultRows.size() + "]条数据保存成功!");
} catch (Exception e) {
LogUtils.setDetailMsg(inInfo, e, "保存失败");
}
return inInfo;
}
/**
* 新增操作
*/
public void add(HGSB004 hgsb004) {
//生成点检单号
hgsb004.setInspecCode(SequenceGenerator.getNextSequence(HGConstant.SequenceId.INSPEC_CODE));
DaoUtils.insert(HGSB004.INSERT, hgsb004);
}
/**
* 修改操作
*/
public void modify(HGSB004 hgsb004) {
hgsb004.setInspecDate(StringUtil.removeHorizontalLine(hgsb004.getInspecDate()));
DaoUtils.update(HGSB004.UPDATE, hgsb004);
}
@OperationLogAnnotation(operModul = "设备点检",operType = "修改",operDesc = "修改状态操作")
public EiInfo updateStatus(EiInfo inInfo){
int i = 0;
try {
HGSB004 hgsb004 = new HGSB004();
EiBlock eiBlock = inInfo.getBlock(EiConstant.resultBlock);
for (i = 0; i < eiBlock.getRowCount(); i++) {
Map<?, ?> map = eiBlock.getRow(i);
hgsb004.fromMap(map);
DaoUtils.update(HGSB004.UPDATE_STATUS, hgsb004);
}
inInfo.setStatus(EiConstant.STATUS_SUCCESS);
inInfo.setMsgByKey("ep.1000", new String[]{String.valueOf(i), I18nMessages.getText("label.update", "修改")});
} catch (PlatException e) {
e.printStackTrace();
inInfo.setStatus(EiConstant.STATUS_FAILURE);
ErrorCodeUtils.handleUpdateException(inInfo,i,e);
logError("修改失败", e.getMessage());
return inInfo;
}
return inInfo;
}
}
package com.baosight.hggp.hg.sb.service;
import com.baosight.hggp.aspect.annotation.OperationLogAnnotation;
import com.baosight.hggp.common.DdynamicEnum;
import com.baosight.hggp.core.constant.CommonConstant;
import com.baosight.hggp.core.dao.DaoUtils;
import com.baosight.hggp.hg.sb.domain.HGSB004;
import com.baosight.hggp.hg.sb.domain.HGSB004A;
import com.baosight.hggp.util.CommonMethod;
import com.baosight.hggp.util.ErrorCodeUtils;
import com.baosight.hggp.util.LogUtils;
import com.baosight.hggp.util.contants.ACConstants;
import com.baosight.iplat4j.core.ei.EiBlock;
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.resource.I18nMessages;
import com.baosight.iplat4j.core.service.impl.ServiceEPBase;
import java.util.Arrays;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
/**
* @author LiuYang
* @version 1.0 2024/5/11
*/
public class ServiceHGSB004A extends ServiceEPBase {
@Override
public EiInfo initLoad(EiInfo inInfo) {
inInfo.setCell(EiConstant.queryBlock, ACConstants.ROW_CODE_0, HGSB004A.FIELD_DELETE_FLAG, CommonConstant.YesNo.NO_0);
//String companyCode = inInfo.getCellStr(EiConstant.queryBlock, ACConstants.ROW_CODE_0, HGSB004.FIELD_COMPANY_CODE);
//String groupCode = inInfo.getCellStr(EiConstant.queryBlock, ACConstants.ROW_CODE_0,HGSB004A.FIELD_GROUP_CODE);
inInfo = super.query(inInfo, HGSB004A.QUERY, new HGSB004A());
//CommonMethod.initBlock(inInfo, Arrays.asList(DdynamicEnum.GROUP_CODE_BOX_BLOCK_ID),null);
CommonMethod.initBlock(inInfo, Arrays.asList(DdynamicEnum.DEVICE_CODE_BOX_BLOCK_ID),
new HashMap<String,Object>(){{
//put(HGSB004.FIELD_COMPANY_CODE,companyCode);
//put(HGSB004A.FIELD_GROUP_CODE,groupCode);
put(HGSB004A.FIELD_DELETE_FLAG,CommonConstant.YesNo.NO_0);}}
);
return inInfo;
}
@Override
public EiInfo query(EiInfo inInfo) {
inInfo.setCell(EiConstant.queryBlock, ACConstants.ROW_CODE_0,HGSB004A.FIELD_DELETE_FLAG, CommonConstant.YesNo.NO_0);
return super.query(inInfo, HGSB004A.QUERY,new HGSB004A());
}
@OperationLogAnnotation(operModul = "设备点检详情",operType = "删除",operDesc = "删除操作")
@Override
public EiInfo delete(EiInfo inInfo) {
int i = 0;
try {
HGSB004A hgsb004a = new HGSB004A();
EiBlock eiBlock = inInfo.getBlock(EiConstant.resultBlock);
for (i = 0; i < eiBlock.getRowCount(); i++) {
Map<?, ?> map = eiBlock.getRow(i);
hgsb004a.fromMap(map);
hgsb004a.setDeleteFlag(CommonConstant.YesNo.YES_1);
DaoUtils.update(HGSB004A.DELETE_FLAG, hgsb004a.toMap());
}
inInfo.setStatus(EiConstant.STATUS_SUCCESS);
inInfo.setMsgByKey("ep.1000", new String[]{String.valueOf(i), I18nMessages.getText("label.delete", "删除")});
} catch (PlatException e) {
e.printStackTrace();
inInfo.setStatus(EiConstant.STATUS_FAILURE);
ErrorCodeUtils.handleDeleteException(inInfo,i,e);
logError("删除失败", e.getMessage());
return inInfo;
}
return inInfo;
}
@OperationLogAnnotation(operModul = "设备点检详情",operType = "保存",operDesc = "保存操作")
public EiInfo save(EiInfo inInfo) {
try {
List<Map> resultRows = inInfo.getBlock(EiConstant.resultBlock).getRows();
// 写入数据
for (int i = 0; i < resultRows.size(); i++) {
HGSB004A hgsb004a = new HGSB004A();
hgsb004a.fromMap(resultRows.get(i));
if (hgsb004a.getId() == null || hgsb004a.getId() == 0) {
hgsb004a.setParentId(Long.valueOf(inInfo.getCellStr(EiConstant.queryBlock, ACConstants.ROW_CODE_0, HGSB004A.FIELD_PARENT_ID)));
this.add(hgsb004a);
} else {
this.modify(hgsb004a);
}
}
inInfo.setStatus(EiConstant.STATUS_DEFAULT);
inInfo.setMsg("操作成功!本次对[" + resultRows.size() + "]条数据保存成功!");
} catch (Exception e) {
LogUtils.setDetailMsg(inInfo, e, "保存失败");
}
return inInfo;
}
/**
* 新增操作
*/
public void add(HGSB004A hgsb004a) {
DaoUtils.insert(HGSB004A.INSERT, hgsb004a);
}
/**
* 修改操作
*/
public void modify(HGSB004A hgsb004a) {
DaoUtils.update(HGSB004A.UPDATE, hgsb004a);
}
@OperationLogAnnotation(operModul = "设备点检详情",operType = "上传附件",operDesc = "上传附件操作")
public EiInfo updateDocId(EiInfo inInfo){
int i = 0;
try {
HGSB004A hgsb004a = new HGSB004A();
EiBlock eiBlock = inInfo.getBlock(EiConstant.resultBlock);
for (i = 0; i < eiBlock.getRowCount(); i++) {
Map<?, ?> map = eiBlock.getRow(i);
hgsb004a.fromMap(map);
DaoUtils.update(HGSB004A.UPDATE_DOC_ID, hgsb004a);
}
inInfo.setStatus(EiConstant.STATUS_SUCCESS);
inInfo.setMsgByKey("ep.1000", new String[]{String.valueOf(i), I18nMessages.getText("label.update", "修改")});
} catch (PlatException e) {
e.printStackTrace();
inInfo.setStatus(EiConstant.STATUS_FAILURE);
ErrorCodeUtils.handleUpdateException(inInfo,i,e);
logError("修改失败", e.getMessage());
return inInfo;
}
return inInfo;
}
}
package com.baosight.hggp.hg.sb.service;
import com.baosight.hggp.aspect.annotation.OperationLogAnnotation;
import com.baosight.hggp.common.DdynamicEnum;
import com.baosight.hggp.core.constant.CommonConstant;
import com.baosight.hggp.core.dao.DaoUtils;
import com.baosight.hggp.hg.constant.HGConstant;
import com.baosight.hggp.hg.sb.domain.*;
import com.baosight.hggp.hg.sb.tools.HGSBTools;
import com.baosight.hggp.util.*;
import com.baosight.hggp.util.contants.ACConstants;
import com.baosight.iplat4j.core.ei.EiBlock;
import com.baosight.iplat4j.core.ei.EiConstant;
import com.baosight.iplat4j.core.ei.EiInfo;
import com.baosight.iplat4j.core.service.impl.ServiceEPBase;
import com.baosight.iplat4j.ed.util.SequenceGenerator;
import java.util.Arrays;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
/**
* @author LiuYang
* @version 1.0 2024/5/13
*/
public class ServiceHGSB004B extends ServiceEPBase {
@Override
public EiInfo initLoad(EiInfo inInfo) {
inInfo.setCell(EiConstant.queryBlock, ACConstants.ROW_CODE_0, HGSB002.FIELD_DELETE_FLAG, CommonConstant.YesNo.NO_0);
inInfo.setCell(EiConstant.queryBlock, ACConstants.ROW_CODE_0, HGSB002.FIELD_TASK_STATUS, CommonConstant.YesNo.NO_0);
inInfo = super.query(inInfo, HGSB002.QUERY, new HGSB002());
CommonMethod.initBlock(inInfo,
Arrays.asList(DdynamicEnum.COMPANY_BOX_BLOCK_ID, DdynamicEnum.USER_BLOCK_ID,DdynamicEnum.GROUP_CODE_BOX_BLOCK_ID),null
);
return inInfo;
}
@Override
public EiInfo query(EiInfo inInfo) {
EiBlock block = inInfo.getBlock(EiConstant.queryBlock);
block.setCell(ACConstants.ROW_CODE_0, HGSB002.FIELD_DELETE_FLAG, CommonConstant.YesNo.NO_0);
String planDate = block.getCellStr(ACConstants.ROW_CODE_0,HGSB002.FIELD_PLAN_DATE);
if (!planDate.isEmpty()) {
inInfo.setCell(EiConstant.queryBlock, ACConstants.ROW_CODE_0,HGSB002.FIELD_PLAN_DATE, StringUtil.removeHorizontalLine(planDate));
}
return super.query(inInfo,HGSB002.QUERY,new HGSB002());
}
/**
* 保存操作
*/
@OperationLogAnnotation(operModul = "设备计划",operType = "保存",operDesc = "保存操作")
public EiInfo save(EiInfo inInfo) {
try {
EiBlock block =inInfo.getBlock(EiConstant.queryBlock);
String pageNumber = block.getCellStr(ACConstants.ROW_CODE_0,"pageNumber");
Map<String,String> map = new HashMap<String,String>();
map.put(HGSB004.FIELD_INSPEC_USER_ID,block.getCellStr(ACConstants.ROW_CODE_0,HGSB004.FIELD_INSPEC_USER_ID));
map.put(HGSB004.FIELD_INSPEC_USER_NAME,block.getCellStr(ACConstants.ROW_CODE_0,HGSB004.FIELD_INSPEC_USER_NAME));
List<Map> resultRows = inInfo.getBlock(EiConstant.resultBlock).getRows();
List<HGSB002A> hgsb002A;
// 写入数据
for (Map resultRow : resultRows) {
HGSB002 hgsb002 = new HGSB002();
hgsb002.fromMap(resultRow);
if ("HGSB004".equals(pageNumber)) {
//添加设备点检
HGSB004 hgsb004 = addHgsb004(hgsb002,map);
hgsb002A = HGSBTools.Hgsb002.getDetails(hgsb002.getId());
addHgsb004a(hgsb002A,hgsb004.getId());
}else if ("HGSB005".equals(pageNumber)){
//添加设备点检
HGSB005 hgsb005 = addHgsb005(hgsb002,map);
hgsb002A = HGSBTools.Hgsb002.getDetails(hgsb002.getId());
addHgsb005a(hgsb002A,hgsb005.getId());
}
hgsb002.setTaskStatus(1);
DaoUtils.update(HGSB002.UPDATE,hgsb002);
}
inInfo.setStatus(EiConstant.STATUS_DEFAULT);
inInfo.setMsg("操作成功!本次对[" + resultRows.size() + "]条数据保存成功!");
} catch (Exception e) {
LogUtils.setDetailMsg(inInfo, e, "保存失败");
}
return inInfo;
}
/**
* 添加设备点检
*/
private HGSB004 addHgsb004(HGSB002 hgsb002,Map<String,String> map){
HGSB004 hgsb004 = new HGSB004();
hgsb004.setCompanyCode(hgsb002.getCompanyCode());
hgsb004.setCompanyName(hgsb002.getCompanyName());
hgsb004.setPlanCode(hgsb002.getPlanCode());
hgsb004.setPlanStartDate(hgsb002.getPlanStartDate());
hgsb004.setPlanEndDate(hgsb002.getPlanEndDate());
hgsb004.setInspecDate(DateUtils.formatShort(DateUtils.date()));
hgsb004.setInspecCode(SequenceGenerator.getNextSequence(HGConstant.SequenceId.INSPEC_CODE));
hgsb004.setInspecUserId(map.get(HGSB004.FIELD_INSPEC_USER_ID));
hgsb004.setInspecUserName(map.get(HGSB004.FIELD_INSPEC_USER_NAME));
DaoUtils.insert(HGSB004.INSERT, hgsb004);
Map map1 = hgsb004.toMap();
map1.remove(HGSB004.FIELD_ID);
List<HGSB004> hgsb004List = this.dao.query(HGSB004.QUERY,map1);
AssertUtils.isEmpty(hgsb004List, "设备点检添加失败");
return hgsb004List.get(0);
}
/**
* 添加设备点检
*/
private void addHgsb004a(List<HGSB002A> hgsb002AList, Long id){
AssertUtils.isEmpty(hgsb002AList, "设备计划详情不能为空");
for (HGSB002A hgsb002a: hgsb002AList) {
HGSB004A hgsb004A = new HGSB004A();
hgsb004A.setCheckItem(hgsb002a.getCheckItem());
hgsb004A.setCheckDescrip(hgsb002a.getCheckDescrip());
hgsb004A.setDeviceCode(hgsb002a.getDeviceCode());
hgsb004A.setDeviceName(hgsb002a.getDeviceName());
hgsb004A.setDeleteFlag(CommonConstant.YesNo.NO_0);
hgsb004A.setGroupCode(hgsb002a.getGroupCode());
hgsb004A.setGroupName(hgsb002a.getGroupName());
hgsb004A.setDeviceType(hgsb002a.getDeviceType());
hgsb004A.setParentId(id);
DaoUtils.insert(HGSB004A.INSERT, hgsb004A);
}
}
/**
* 添加设备保养
*/
private HGSB005 addHgsb005(HGSB002 hgsb002,Map<String,String> map){
HGSB005 hgsb005 = new HGSB005();
hgsb005.setCompanyCode(hgsb002.getCompanyCode());
hgsb005.setCompanyName(hgsb002.getCompanyName());
hgsb005.setPlanCode(hgsb002.getPlanCode());
hgsb005.setPlanStartDate(hgsb002.getPlanStartDate());
hgsb005.setPlanEndDate(hgsb002.getPlanEndDate());
hgsb005.setUpkeepDate(DateUtils.formatShort(DateUtils.date()));
hgsb005.setUpkeepCode(SequenceGenerator.getNextSequence(HGConstant.SequenceId.INSPEC_CODE));
hgsb005.setUpkeepUserId(map.get(HGSB004.FIELD_INSPEC_USER_ID));
hgsb005.setUpkeepUserName(map.get(HGSB004.FIELD_INSPEC_USER_NAME));
DaoUtils.insert(HGSB005.INSERT, hgsb005);
Map map1 = hgsb005.toMap();
map1.remove(HGSB004.FIELD_ID);
List<HGSB005> hgsb005List = this.dao.query(HGSB005.QUERY,map1);
AssertUtils.isEmpty(hgsb005List, "设备保养添加失败");
return hgsb005List.get(0);
}
/**
* 添加设备保养详情
*/
private void addHgsb005a(List<HGSB002A> hgsb002AList,Long id){
AssertUtils.isEmpty(hgsb002AList, "设备计划详情不能为空");
for (HGSB002A hgsb002a: hgsb002AList) {
HGSB005A hgsb005A = new HGSB005A();
hgsb005A.setCheckItem(hgsb002a.getCheckItem());
hgsb005A.setCheckDescrip(hgsb002a.getCheckDescrip());
hgsb005A.setDeviceCode(hgsb002a.getDeviceCode());
hgsb005A.setDeviceName(hgsb002a.getDeviceName());
hgsb005A.setDeleteFlag(CommonConstant.YesNo.NO_0);
hgsb005A.setGroupCode(hgsb002a.getGroupCode());
hgsb005A.setGroupName(hgsb002a.getGroupName());
hgsb005A.setDeviceType(hgsb002a.getDeviceType());
hgsb005A.setParentId(id);
DaoUtils.insert(HGSB005A.INSERT, hgsb005A);
}
}
}
<?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-11 14:49:03
Version : 1.0
schema : hggp
tableName : HGSB004
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,
INSPEC_DATE VARCHAR,
INSPEC_CODE VARCHAR,
PLAN_CODE VARCHAR,
PLAN_START_DATE VARCHAR,
PLAN_END_DATE VARCHAR,
INSPEC_USER_ID VARCHAR,
INSPEC_USER_NAME VARCHAR,
CHECK_STATUS TINYINT
-->
<sqlMap namespace="HGSB004">
<sql id="column">
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", <!-- 工厂名称 -->
INSPEC_DATE as "inspecDate", <!-- 点检日期 -->
INSPEC_CODE as "inspecCode", <!-- 点检单号 -->
PLAN_CODE as "planCode", <!-- 计划单号 -->
PLAN_START_DATE as "planStartDate", <!-- 计划开始日期 -->
PLAN_END_DATE as "planEndDate", <!-- 计划结束日期 -->
INSPEC_USER_ID as "inspecUserId", <!-- 点检人编码 -->
INSPEC_USER_NAME as "inspecUserName", <!-- 点检人名称 -->
CHECK_STATUS as "checkStatus" <!-- 审核状态 0-停止 1-启用 -->
</sql>
<sql id="authCondition">
<!-- 无权限时使用 -->
<isNotEmpty prepend=" AND " property="authDepCode">
DEP_CODE = #authDepCode#
</isNotEmpty>
<!-- 仅本人和部门组合 -->
<isEqual prepend=" AND " property="authCombination" compareValue="1">
(CREATED_BY = #authOnlyPeople# OR DEP_CODE IN <iterate close=")" open="(" conjunction="," property="authDepCodes">#authDepCodes[]#</iterate>)
</isEqual>
<!-- 仅本人或部门 -->
<isNotEqual prepend=" AND " property="authCombination" compareValue="1">
<isNotEmpty property="authOnlyPeople">
CREATED_BY = #authOnlyPeople#
</isNotEmpty>
<isNotEmpty property="authDepCodes">
DEP_CODE IN <iterate close=")" open="(" conjunction="," property="authDepCodes">#authDepCodes[]#</iterate>
</isNotEmpty>
</isNotEqual>
</sql>
<sql id="condition">
<include refid="authCondition"/>
<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="inspecDate">
INSPEC_DATE = #inspecDate#
</isNotEmpty>
<isNotEmpty prepend=" AND " property="inspecCode">
INSPEC_CODE = #inspecCode#
</isNotEmpty>
<isNotEmpty prepend=" AND " property="planCode">
PLAN_CODE LIKE CONCAT('%', #planCode#, '%')
</isNotEmpty>
<isNotEmpty prepend=" AND " property="planStartDate">
PLAN_START_DATE = #planStartDate#
</isNotEmpty>
<isNotEmpty prepend=" AND " property="planEndDate">
PLAN_END_DATE = #planEndDate#
</isNotEmpty>
<isNotEmpty prepend=" AND " property="inspecUserId">
INSPEC_USER_ID = #inspecUserId#
</isNotEmpty>
<isNotEmpty prepend=" AND " property="inspecUserName">
INSPEC_USER_NAME LIKE CONCAT('%', #inspecUserName#, '%')
</isNotEmpty>
<isNotEmpty prepend=" AND " property="checkStatus">
CHECK_STATUS = #checkStatus#
</isNotEmpty>
</sql>
<select id="query" parameterClass="java.util.HashMap"
resultClass="com.baosight.hggp.hg.sb.domain.HGSB004">
SELECT
<include refid="column"/>
FROM ${hggpSchema}.HGSB004 WHERE 1=1
<include refid="condition" />
<dynamic prepend="ORDER BY">
<isNotEmpty property="orderBy">
$orderBy$
</isNotEmpty>
<isEmpty property="orderBy">
INSPEC_DATE DESC,CREATED_TIME desc,ID asc
</isEmpty>
</dynamic>
</select>
<select id="count" resultClass="int">
SELECT COUNT(*) FROM ${hggpSchema}.HGSB004 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="inspecDate">
INSPEC_DATE = #inspecDate#
</isNotEmpty>
<isNotEmpty prepend=" AND " property="inspecCode">
INSPEC_CODE = #inspecCode#
</isNotEmpty>
<isNotEmpty prepend=" AND " property="planCode">
PLAN_CODE = #planCode#
</isNotEmpty>
<isNotEmpty prepend=" AND " property="planStartDate">
PLAN_START_DATE = #planStartDate#
</isNotEmpty>
<isNotEmpty prepend=" AND " property="planEndDate">
PLAN_END_DATE = #planEndDate#
</isNotEmpty>
<isNotEmpty prepend=" AND " property="inspecUserId">
INSPEC_USER_ID = #inspecUserId#
</isNotEmpty>
<isNotEmpty prepend=" AND " property="inspecUserName">
INSPEC_USER_NAME = #inspecUserName#
</isNotEmpty>
<isNotEmpty prepend=" AND " property="checkStatus">
CHECK_STATUS = #checkStatus#
</isNotEmpty>
-->
<insert id="insert">
INSERT INTO ${hggpSchema}.HGSB004 (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, <!-- 工厂名称 -->
INSPEC_DATE, <!-- 点检日期 -->
INSPEC_CODE, <!-- 点检单号 -->
PLAN_CODE, <!-- 计划单号 -->
PLAN_START_DATE, <!-- 计划开始日期 -->
PLAN_END_DATE, <!-- 计划结束日期 -->
INSPEC_USER_ID, <!-- 点检人编码 -->
INSPEC_USER_NAME, <!-- 点检人名称 -->
CHECK_STATUS <!-- 审核状态 0-停止 1-启用 -->
)
VALUES (#id#, #accountCode#, #depCode#, #createdBy#, #createdName#, #createdTime#, #updatedBy#, #updatedName#, #updatedTime#, #deleteFlag#, #companyCode#, #companyName#, #factoryCode#, #factoryName#, #inspecDate#, #inspecCode#, #planCode#, #planStartDate#, #planEndDate#, #inspecUserId#, #inspecUserName#, #checkStatus#)
</insert>
<delete id="delete">
DELETE FROM ${hggpSchema}.HGSB004 WHERE
ID = #id#
</delete>
<update id="deleteFlag">
UPDATE ${hggpSchema}.HGSB004
SET
UPDATED_BY = #updatedBy#, <!-- 修改人 -->
UPDATED_NAME = #updatedName#, <!-- 修改人名称 -->
UPDATED_TIME = #updatedTime#, <!-- 修改时间 -->
DELETE_FLAG = #deleteFlag# <!-- 是否删除 0-否1-是 -->
WHERE
ID = #id#
</update>
<update id="update">
UPDATE ${hggpSchema}.HGSB004
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#, <!-- 工厂名称 -->
INSPEC_DATE = #inspecDate#, <!-- 点检日期 -->
INSPEC_CODE = #inspecCode#, <!-- 点检单号 -->
PLAN_CODE = #planCode#, <!-- 计划单号 -->
PLAN_START_DATE = #planStartDate#, <!-- 计划开始日期 -->
PLAN_END_DATE = #planEndDate#, <!-- 计划结束日期 -->
INSPEC_USER_ID = #inspecUserId#, <!-- 点检人编码 -->
INSPEC_USER_NAME = #inspecUserName#, <!-- 点检人名称 -->
CHECK_STATUS = #checkStatus# <!-- 审核状态 0-停止 1-启用 -->
WHERE
ID = #id#
</update>
<update id="updateStatus">
UPDATE ${hggpSchema}.HGSB004
SET
UPDATED_BY = #updatedBy#, <!-- 修改人 -->
UPDATED_NAME = #updatedName#, <!-- 修改人名称 -->
UPDATED_TIME = #updatedTime#, <!-- 修改时间 -->
CHECK_STATUS = #checkStatus# <!-- 审核状态 0-停止 1-启用 -->
WHERE
ID = #id#
</update>
</sqlMap>
<?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-11 14:49:08
Version : 1.0
schema : hggp
tableName : HGSB004A
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,
PARENT_ID BIGINT,
GROUP_CODE VARCHAR,
GROUP_NAME VARCHAR,
DEVICE_TYPE VARCHAR,
DEVICE_CODE VARCHAR,
DEVICE_NAME VARCHAR,
DEVICE_MODEL VARCHAR,
CHECK_ITEM VARCHAR,
CHECK_DESCRIP VARCHAR,
CHECK_RESULT VARCHAR,
DOC_ID BIGINT
-->
<sqlMap namespace="HGSB004A">
<sql id="column">
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-是 -->
PARENT_ID as "parentId", <!-- 父级ID -->
GROUP_CODE as "groupCode", <!-- 设备区域编码 -->
GROUP_NAME as "groupName", <!-- 设备区域名称 -->
DEVICE_TYPE as "deviceType", <!-- 设备类型 -->
DEVICE_CODE as "deviceCode", <!-- 设备编码 -->
DEVICE_NAME as "deviceName", <!-- 设备名称 -->
DEVICE_MODEL as "deviceModel", <!-- 设备型号 -->
CHECK_ITEM as "checkItem", <!-- 检查项 -->
CHECK_DESCRIP as "checkDescrip", <!-- 检查描述 -->
CHECK_RESULT as "checkResult", <!-- 检查描述结果 -->
DOC_ID as "docId", <!-- 附件ID -->
DOC_NAME as "docName"
</sql>
<sql id="authCondition">
<!-- 无权限时使用 -->
<isNotEmpty prepend=" AND " property="authDepCode">
DEP_CODE = #authDepCode#
</isNotEmpty>
<!-- 仅本人和部门组合 -->
<isEqual prepend=" AND " property="authCombination" compareValue="1">
(CREATED_BY = #authOnlyPeople# OR DEP_CODE IN <iterate close=")" open="(" conjunction="," property="authDepCodes">#authDepCodes[]#</iterate>)
</isEqual>
<!-- 仅本人或部门 -->
<isNotEqual prepend=" AND " property="authCombination" compareValue="1">
<isNotEmpty property="authOnlyPeople">
CREATED_BY = #authOnlyPeople#
</isNotEmpty>
<isNotEmpty property="authDepCodes">
DEP_CODE IN <iterate close=")" open="(" conjunction="," property="authDepCodes">#authDepCodes[]#</iterate>
</isNotEmpty>
</isNotEqual>
</sql>
<sql id="condition">
<include refid="authCondition"/>
<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="parentId">
PARENT_ID = #parentId#
</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="checkItem">
CHECK_ITEM LIKE CONCAT('%', #checkItem#, '%')
</isNotEmpty>
<isNotEmpty prepend=" AND " property="checkDescrip">
CHECK_DESCRIP = #checkDescrip#
</isNotEmpty>
<isNotEmpty prepend=" AND " property="checkResult">
CHECK_RESULT = #checkResult#
</isNotEmpty>
<isNotEmpty prepend=" AND " property="docId">
DOC_ID = #docId#
</isNotEmpty>
</sql>
<select id="query" parameterClass="java.util.HashMap"
resultClass="com.baosight.hggp.hg.sb.domain.HGSB004A">
SELECT
<include refid="column"/>
FROM ${hggpSchema}.HGSB004A WHERE 1=1
<include refid="condition" />
<dynamic prepend="ORDER BY">
<isNotEmpty property="orderBy">
$orderBy$
</isNotEmpty>
<isEmpty property="orderBy">
CREATED_TIME desc, ID asc
</isEmpty>
</dynamic>
</select>
<select id="count" resultClass="int">
SELECT COUNT(*) FROM ${hggpSchema}.HGSB004A 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="parentId">
PARENT_ID = #parentId#
</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="checkItem">
CHECK_ITEM = #checkItem#
</isNotEmpty>
<isNotEmpty prepend=" AND " property="checkDescrip">
CHECK_DESCRIP = #checkDescrip#
</isNotEmpty>
<isNotEmpty prepend=" AND " property="checkResult">
CHECK_RESULT = #checkResult#
</isNotEmpty>
<isNotEmpty prepend=" AND " property="docId">
DOC_ID = #docId#
</isNotEmpty>
-->
<insert id="insert">
INSERT INTO ${hggpSchema}.HGSB004A (ID, <!-- ID -->
ACCOUNT_CODE, <!-- 账套 -->
DEP_CODE, <!-- 部门编码 -->
CREATED_BY, <!-- 创建人 -->
CREATED_NAME, <!-- 创建人名称 -->
CREATED_TIME, <!-- 创建时间 -->
UPDATED_BY, <!-- 修改人 -->
UPDATED_NAME, <!-- 修改人名称 -->
UPDATED_TIME, <!-- 修改时间 -->
DELETE_FLAG, <!-- 是否删除 0-否1-是 -->
PARENT_ID, <!-- 父级ID -->
GROUP_CODE, <!-- 设备区域编码 -->
GROUP_NAME, <!-- 设备区域名称 -->
DEVICE_TYPE, <!-- 设备类型 -->
DEVICE_CODE, <!-- 设备编码 -->
DEVICE_NAME, <!-- 设备名称 -->
DEVICE_MODEL, <!-- 设备型号 -->
CHECK_ITEM, <!-- 检查项 -->
CHECK_DESCRIP, <!-- 检查描述 -->
CHECK_RESULT, <!-- 检查描述结果 -->
DOC_ID, <!-- 附件ID -->
DOC_NAME
)
VALUES (#id#, #accountCode#, #depCode#, #createdBy#, #createdName#, #createdTime#, #updatedBy#, #updatedName#, #updatedTime#, #deleteFlag#, #parentId#, #groupCode#, #groupName#, #deviceType#, #deviceCode#, #deviceName#, #deviceModel#, #checkItem#, #checkDescrip#, #checkResult#, #docId#, #docName#)
</insert>
<delete id="delete">
DELETE FROM ${hggpSchema}.HGSB004A WHERE
ID = #id#
</delete>
<update id="deleteFlag">
UPDATE ${hggpSchema}.HGSB004A
SET
UPDATED_BY = #updatedBy#, <!-- 修改人 -->
UPDATED_NAME = #updatedName#, <!-- 修改人名称 -->
UPDATED_TIME = #updatedTime#, <!-- 修改时间 -->
DELETE_FLAG = #deleteFlag# <!-- 是否删除 0-否1-是 -->
WHERE
ID = #id#
</update>
<update id="update">
UPDATE ${hggpSchema}.HGSB004A
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-是 -->
PARENT_ID = #parentId#, <!-- 父级ID -->
GROUP_CODE = #groupCode#, <!-- 设备区域编码 -->
GROUP_NAME = #groupName#, <!-- 设备区域名称 -->
DEVICE_TYPE = #deviceType#, <!-- 设备类型 -->
DEVICE_CODE = #deviceCode#, <!-- 设备编码 -->
DEVICE_NAME = #deviceName#, <!-- 设备名称 -->
DEVICE_MODEL = #deviceModel#, <!-- 设备型号 -->
CHECK_ITEM = #checkItem#, <!-- 检查项 -->
CHECK_DESCRIP = #checkDescrip#, <!-- 检查描述 -->
CHECK_RESULT = #checkResult#, <!-- 检查描述结果 -->
DOC_ID = #docId#, <!-- 附件ID -->
DOC_NAME = #docName#
WHERE
ID = #id#
</update>
<update id="updateDocId">
UPDATE ${hggpSchema}.HGSB004A
SET
UPDATED_BY = #updatedBy#, <!-- 更新人 -->
UPDATED_NAME = #updatedName#, <!-- 更新人名称 -->
UPDATED_TIME = #updatedTime#, <!-- 更新时间 -->
DOC_ID = #docId#, <!-- 附件ID -->
DOC_NAME = #docName#
WHERE
ID = #id#
</update>
</sqlMap>
package com.baosight.hggp.hg.sb.tools;
import com.baosight.hggp.core.constant.CommonConstant;
import com.baosight.hggp.core.dao.DaoBase;
import com.baosight.hggp.hg.sb.domain.HGSB002;
import com.baosight.hggp.hg.sb.domain.HGSB002A;
import com.baosight.hggp.hg.sb.domain.HGSB004;
import com.baosight.hggp.hg.sb.domain.HGSB004A;
import com.baosight.hggp.util.AssertUtils;
import org.apache.commons.collections.CollectionUtils;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
/**
* @author LiuYang
* @version 1.0 2024/5/11
*/
public class HGSBTools {
/**
* Hgsb002公共DAO方法定义
*
*/
public static class Hgsb002 {
/**
* 查询设备计划详情
*
* @param id
*/
public static List<HGSB002A> getDetails(Long id) {
AssertUtils.isNull(id, "设备计划不能为空");
Map queryMap = new HashMap();
queryMap.put(HGSB002A.FIELD_PARENT_ID, id);
queryMap.put(HGSB002A.FIELD_DELETE_FLAG, CommonConstant.YesNo.NO_0);
List<HGSB002A> results = DaoBase.getInstance().query(HGSB002A.QUERY, queryMap);
return results;
}
}
/**
* Hgsb004公共DAO方法定义
*
*/
public static class Hgsb004 {
/**
* 查询
*
* @param hgsb004
*/
public static List<HGSB004> get(HGSB004 hgsb004) {
AssertUtils.isNull(hgsb004, "设备点检不能为空");
List<HGSB004> results = DaoBase.getInstance().query(HGSB004.QUERY, hgsb004);
return results;
}
}
}
$(function () {
var companyCodeBox = __eiInfo.getBlock("companyBox_block_id").getMappedRows();
var groupCodeBox = __eiInfo.getBlock("groupCodeBox_block_id").getMappedRows();
var userIdBox = __eiInfo.getBlock("user_block_id").getMappedRows();
$(".row").children().attr("class", "col-md-3");
$("#QUERY").on("click", query);
$("#BUE_PLAN").on("click",taskResult)
IPLATUI.EFGrid= {
"result": {
pageable: {
pageSize: 10,
pageSizes: [10, 20, 50, 100],
},
columns: [
{
field: "operator",
title: "操作",
template: function (item) {
let auditStatus = item["checkStatus"];
let template = '';
if (item.companyCode) {
if (auditStatus == 1){
template += '<a style="cursor: pointer;display: inline-flex;justify-content: center;margin:auto 5px" '
+ 'onclick="showDetail(' + item.id + ',\''+item.companyCode+'\',\''+item.companyName+'\')" >点检详情</a>';
}
if (auditStatus == 0) {
template += '<a style="cursor: pointer;display: inline-flex;justify-content: center;margin:auto 5px" ' +
'onclick="updateStatus(' + item.id + ',1)" >审批完成</a>';
template += '<a style="cursor: pointer;display: inline-flex;justify-content: center;margin:auto 5px" ' +
'onclick="updateStatus(' + item.id + ',-1)" >审批未通过</a>';
}
if (auditStatus == -1){
template += '<a style="cursor: pointer;display: inline-flex;justify-content: center;margin:auto 5px" ' +
'onclick="updateStatus(' + item.id + ',1)" >审批完成</a>';
}
}
return template;
}
},{
field: "inspecDate",
attributes: {
class: "i-input-readonly"
},
defaultValue: function () {
return currShortDate();
}
}, {
field: "planStartDate",
attributes: {
class: "i-input-readonly"
},
defaultValue: function () {
return currShortDate();
}
}, {
field: "planEndDate",
attributes: {
class: "i-input-readonly"
},
defaultValue: function () {
return currShortDate();
}
}, {
field: "companyCode",
title: "公司名称",
template: function (dataItem) {
for (let i = 0; i < companyCodeBox.length; i++) {
if (companyCodeBox[i]['valueField'] === dataItem['companyCode']){
dataItem['companyName'] = companyCodeBox[i]['textField']
return companyCodeBox[i]['textField'];
}
}
return dataItem["companyCode"];
}
}, {
field: "inspecUserId",
title: "点检人",
template: function (dataItem) {
for (let i = 0; i < userIdBox.length; i++) {
if (userIdBox[i]['valueField'] === dataItem['inspecUserId']){
dataItem['inspecUserName'] = userIdBox[i]['textField']
return userIdBox[i]['textField'];
}
}
return dataItem["inspecUserId"];
}
}
],
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 对象
// 处理父子级联动,通过监听 change 事件,判断父级节点是否发生变化
grid.dataSource.bind("change", function(e) {
// 判断父级节点是否发生变化
if (e.field === "companyCode") {
loadChange(grid,e,"groupCode");
}else if (e.field === "groupCode") {
if (e.items[0].companyCode.length===0){
loadChange(grid,e,"companyCode");
}
//loadChange(grid,e,"userId");
}
});
},
afterEdit:function (e) {
/*if (e.field === "groupCode" && e.model["companyCode"].length === 0){
for (let i = 0; i < groupCodeBox.length; i++) {
if (e.model[e.field] === groupCodeBox[i]["valueField"]){
e.model["companyCode"]=groupCodeBox[i]["param3Field"]
break;
}
}
}else if (e.field === "userId" && e.model["groupCode"].length === 0){
for (let i = 0; i < userName.length; i++) {
if (e.model[e.field] === userName[i]["valueField"]){
//e.model["factoryCode"]=userName[i]["param1Field"]
e.model["groupCode"]=userName[i]["param2Field"]
break;
}
}
}*/
},
onSave: function (e) {
// 阻止默认请求,使用自定义保存
e.preventDefault();
let btnNode = $(this);
//禁用按钮
btnNode.attr("disabled", true);
save(btnNode);
},
onDelete: function (e) {
// 阻止默认请求,使用自定义删除
//e.preventDefault();
//deleteFunc();
},
onSuccess: function (e) {
if (e.eiInfo.extAttr.methodName == 'save' || e.eiInfo.extAttr.methodName == 'delete') {
query();
}
},
onRowClick: function (e) {
}
}
}
downKeyUp();
});
let query = function () {
resultGrid.dataSource.page(1);
}
/**
* 选择计划任务
*/
function taskResult() {
JSColorbox.open({
href: "HGSB004B?methodName=initLoad&inqu_status-0-pageNumber=HGSB004&inqu_status-0-planType="+1,
title: "<div style='text-align: center;'>选择设备计划任务</div>",
width: "80%",
height: "90%",
callbackName: taskResultCallback
});
}
/**
* 选择计划任务
*/
function taskResultCallback() {
// 刷新列表
query();
// 关闭弹窗
JSColorbox.close();
}
/**
* 保存
*/
let save = function (btnNode) {
let rows = resultGrid.getCheckedRows();
if (rows.length < 1) {
message("请选择数据");
return;
}
let flag = true;
$.each(rows, function(index, item) {
let companyCode= item.get("companyCode");
let inspecDate= item.get("inspecDate");
let planStartDate= item.get("planStartDate");
let planEndDate= item.get("planEndDate");
let inspecUserId= item.get("inspecUserId");
if(isBlank(companyCode)){
message("选中的第"+(index+1)+"行\"公司\",不能为空!");
flag = false;
return false;
}
if(isBlank(inspecDate)){
message("选中的第"+(index+1)+"行\"点检日期\",不能为空!");
flag = false;
return false;
}
if(isBlank(planStartDate)){
message("选中的第"+(index+1)+"行\"计划开始日期\",不能为空!");
flag = false;
return false;
}
if(isBlank(planEndDate)){
message("选中的第"+(index+1)+"行\"计划结束日期\",不能为空!");
flag = false;
return false;
}
if(isBlank(inspecUserId)){
message("选中的第"+(index+1)+"行\"点检人\",不能为空!");
flag = false;
return false;
}
});
if(flag) {
JSUtils.confirm("确定对勾选中的[" + rows.length + "]条数据做\"保存\"操作? ", {
ok: function () {
JSUtils.submitGridsData("result", "HGSB004", "save", true);
btnNode.attr("disabled", false);
}
});
}
}
function updateStatus(id,deviceStatus) {
let inEiInfo = new EiInfo();
inEiInfo.set("result-0-id", id);
inEiInfo.set("result-0-checkStatus", deviceStatus);
EiCommunicator.send('HGSB004', 'updateStatus', inEiInfo, {
onSuccess(response) {
NotificationUtil(response.msg);
query();
},
onFail(errorMessage, status, e) {
NotificationUtil("执行失败!", "error");
}
}, {
async: false
}
);
}
/**
* 显示详情
*/
function showDetail(id,companyCode,companyName) {
JSColorbox.open({
href: "HGSB004A?methodName=initLoad&inqu_status-0-parentId=" + id+"&inqu_status-0-companyCode="+companyCode+"&inqu_status-0-companyName="+companyName,
title: "<div style='text-align: center;'>设备点检详情</div>",
width: "80%",
height: "80%",
});
}
function loadChange(grid,e,field) {
var cell_label = field,that = grid;
// locked 表示是否为固定列
var locked = that.isCellLocked(cell_label);
// tr 表示 locked 和非 locked 的行,index 表示此行的第几列
var tr,index;
// 获取此 model 元素信息
var item = e.items[0];
var _uid = item.uid;
if (locked) {
tr = $(".k-grid-content-locked tr[data-uid="+ _uid +"]");
index = $("th[data-field='"+cell_label+"']").data("index");
} else {
tr = $(".k-grid-content tr[data-uid="+ _uid +"]");
index = parseInt($("th[data-field='"+cell_label+"']").data("index")) - that.lockedHeader.find("th").length;
}
// 获取子 cell(td)
var td = tr.children("td:eq("+index+")");
// 触发 td.click 事件,
td.trigger("click");
}
\ No newline at end of file
<%--
Created by IntelliJ IDEA.
User: 1
Date: 2024/5/11
Time: 15:58
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" %>
<%@ page import="com.baosight.iplat4j.core.web.threadlocal.UserSession" %>
<%
String loginName = UserSession.getLoginName();
%>
<c:set var="ctx" value="${pageContext.request.contextPath}"/>
<c:set var="loginName" value="<%=loginName%>" />
<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="inspecDate" cname="点检日期" role="date"
format="yyyy-MM-dd" parseFormats="['yyyyMMdd']" colWidth="3"/>
<EF:EFInput blockId="inqu_status" row="0" ename="planCode" cname="计划单号" placeholder="模糊查询" colWidth="3"/>
<EF:EFInput blockId="inqu_status" row="0" ename="inspecUserName" cname="点检人" placeholder="模糊查询" colWidth="3"/>
</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"/>
<%--blockName="factoryCodeBox_block_id"--%>
<EF:EFColumn ename="operator" cname="操作" locked="true" enable="false" width="220" align="center"/>
<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="inspecDate" cname="点检日期" width="120" enable="true" align="center" editType="date"
dateFormat="yyyy-MM-dd" parseFormats="['yyyyMMdd']" required="true"/>
<EF:EFColumn ename="inspecCode" cname="点检单号" width="100" enable="false" readonly="true" align="center" required="true"/>
<EF:EFColumn ename="planCode" cname="计划单号" width="100" enable="false" readonly="true" align="center" required="true"/>
<EF:EFColumn ename="planStartDate" cname="计划开始日期" width="120" align="center" editType="date"
dateFormat="yyyy-MM-dd" parseFormats="['yyyyMMdd']" readonly="true" required="true"/>
<EF:EFColumn ename="planEndDate" cname="计划结束日期" width="120" align="center" editType="date"
dateFormat="yyyy-MM-dd" parseFormats="['yyyyMMdd']" readonly="true" required="true"/>
<EF:EFComboColumn ename="inspecUserId" cname="点检人" defaultValue="${loginName}"
columnTemplate="#=textField#" itemTemplate="#=textField#"
textField="textField" valueField="valueField"
maxLength="16" width="100" readonly="false" required="true"
align="center" filter="contains" sort="true">
<EF:EFOptions blockId="user_block_id" textField="textField" valueField="valueField"/>
</EF:EFComboColumn>
<EF:EFComboColumn ename="checkStatus" cname="审核状态" width="80" align="center" readonly="false" required="true" defaultValue="1">
<EF:EFCodeOption codeName="hggp.hgsb.approveStatus"/>
</EF:EFComboColumn>
<%--<EF:EFColumn cname="创建人" ename="createdName" align="center" width="100" readonly="true" required="false"
enable="false"/>
<EF:EFColumn cname="创建时间" ename="createdTime" parseFormats="['yyyyMMddHHmmss']" editType="datetime"
dateFormat="yyyy-MM-dd HH:mm:ss" align="center" width="120" readonly="true" required="false"
enable="false"/>--%>
</EF:EFGrid>
</EF:EFRegion>
</EF:EFPage>
$(function () {
var deviceCodeBox = __eiInfo.getBlock("deviceCodeBox_block_id").getMappedRows();
//var groupCodeBox = __eiInfo.getBlock("groupCodeBox_block_id").getMappedRows();
$(".row").children().attr("class", "col-md-3");
$("#QUERY").on("click", query);
IPLATUI.EFGrid= {
"result": {
pageable: {
pageSize: 10,
pageSizes: [10, 20, 50, 100],
},
columns: [
{
field: "operator",
title: "操作",
template: function (item) {
let auditStatus = item.status;
let template = '';
if (item.id) {
template += '<a style="cursor: pointer;display: inline-flex;justify-content: center;margin:auto 5px" '
+ 'onclick="uploadFile(' + item.id + ')" >附件上传</a>';
}
return template;
}
}, {
field: "deviceCode",
filter: function (options) {
var deviceType = options.model['deviceType'];
if(deviceType) {
// 返回我们过滤后的数据集
return _.filter(deviceCodeBox, function (item) {
return item["param1Field"]==deviceType;
})
}
return deviceCodeBox;
},
template: function (dataItem) {
for (let i = 0; i < deviceCodeBox.length; i++) {
if (deviceCodeBox[i]['valueField'] === dataItem['deviceCode']) {
dataItem['deviceName'] = deviceCodeBox[i]['textField']
return deviceCodeBox[i]['textField'];
}
}
return dataItem["deviceCode"]
}
}, {
field: "docId",
template: function (item) {
let template = '';
if (item.id>0 && item.docId.trim().length>0){
template = '<a style="cursor: pointer;display: inline-flex;justify-content: center;margin:auto 5px" '
+ 'href="' + downloadHref(item.docId) + '" target="_blank">'+item.docName+'</a>';
}
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 对象
// 处理父子级联动,通过监听 change 事件,判断父级节点是否发生变化
grid.dataSource.bind("change", function(e) {
// 判断父级节点是否发生变化
if (e.field === "deviceType") {
loadChange(grid,e,"deviceCode");
}else if (e.field === "deviceCode") {
if (e.items[0].deviceType.length===0){
loadChange(grid,e,"deviceType");
}
//loadChange(grid,e,"userId");
}
});
},
afterEdit:function (e) {
/*if (e.field === "groupCode" && e.model["companyCode"].length === 0){
for (let i = 0; i < groupCodeBox.length; i++) {
if (e.model[e.field] === groupCodeBox[i]["valueField"]){
e.model["companyCode"]=groupCodeBox[i]["param3Field"]
break;
}
}
}else if (e.field === "userId" && e.model["groupCode"].length === 0){
for (let i = 0; i < userName.length; i++) {
if (e.model[e.field] === userName[i]["valueField"]){
//e.model["factoryCode"]=userName[i]["param1Field"]
e.model["groupCode"]=userName[i]["param2Field"]
break;
}
}
}*/
},
onSave: function (e) {
// 阻止默认请求,使用自定义保存
e.preventDefault();
let btnNode = $(this);
//禁用按钮
btnNode.attr("disabled", true);
save(btnNode);
},
onDelete: function (e) {
// 阻止默认请求,使用自定义删除
//e.preventDefault();
//deleteFunc();
},
onSuccess: function (e) {
if (e.eiInfo.extAttr.methodName == 'save' || e.eiInfo.extAttr.methodName == 'delete') {
query();
}
},
onRowClick: function (e) {
}
}
}
downKeyUp();
});
let query = function () {
resultGrid.dataSource.page(1);
}
/**
* 保存
*/
let save = function (btnNode) {
let rows = resultGrid.getCheckedRows();
if (rows.length < 1) {
message("请选择数据");
return;
}
let flag = true;
$.each(rows, function(index, item) {
let groupCode= item.get("groupCode");
let deviceType= item.get("deviceType");
let deviceCode= item.get("deviceCode");
let checkItem= item.get("checkItem");
if(isBlank(groupCode)){
message("选中的第"+(index+1)+"行\"设备区域\",不能为空!");
flag = false;
return false;
}
if(isBlank(deviceType)){
message("选中的第"+(index+1)+"行\"设备类型\",不能为空!");
flag = false;
return false;
}
if(isBlank(deviceCode)){
message("选中的第"+(index+1)+"行\"设备名称\",不能为空!");
flag = false;
return false;
}
if(isBlank(checkItem)){
message("选中的第"+(index+1)+"行\"检查项\",不能为空!");
flag = false;
return false;
}
});
if(flag) {
JSUtils.confirm("确定对勾选中的[" + rows.length + "]条数据做\"保存\"操作? ", {
ok: function () {
JSUtils.submitGridsData("result", "HGSB004A", "save", true);
btnNode.attr("disabled", false);
}
});
}
}
/**
* 文件上传
*
* @param id
*/
function uploadFile(id) {
JSColorbox.open({
href: "HGSB003A?methodName=initLoad&inqu_status-0-id="+id,
title: "<div style='text-align: center;'>附件上传</div>",
width: "60%",
height: "50%",
callbackName: uploadFileCallback
});
}
/**
* 附件上传回调
*
* @param docId
*/
function uploadFileCallback(result) {
let inEiInfo = new EiInfo();
inEiInfo.set("result-0-id", result.id);
inEiInfo.set("result-0-docId", result.docId);
inEiInfo.set("result-0-docName", result.docName);
EiCommunicator.send('HGSB004A', 'updateDocId', inEiInfo, {
onSuccess(ei) {
if (ei.status == "-1") {
NotificationUtil({msg: ei.msg, detailMsg: ei.detailMsg}, "error");
} else {
NotificationUtil(ei.msg);
query();
}
},
onFail(errorMessage, status, e) {
NotificationUtil("执行失败!", "error");
}
}, {
async: false
});
}
function loadChange(grid,e,field) {
var cell_label = field,that = grid;
// locked 表示是否为固定列
var locked = that.isCellLocked(cell_label);
// tr 表示 locked 和非 locked 的行,index 表示此行的第几列
var tr,index;
// 获取此 model 元素信息
var item = e.items[0];
var _uid = item.uid;
if (locked) {
tr = $(".k-grid-content-locked tr[data-uid="+ _uid +"]");
index = $("th[data-field='"+cell_label+"']").data("index");
} else {
tr = $(".k-grid-content tr[data-uid="+ _uid +"]");
index = parseInt($("th[data-field='"+cell_label+"']").data("index")) - that.lockedHeader.find("th").length;
}
// 获取子 cell(td)
var td = tr.children("td:eq("+index+")");
// 触发 td.click 事件,
td.trigger("click");
}
\ No newline at end of file
<%--
Created by IntelliJ IDEA.
User: 1
Date: 2024/5/11
Time: 15:58
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:EFInput blockId="inqu_status" row="0" ename="companyName" cname="公司名称" colWidth="3" readonly="true"/>
<EF:EFInput blockId="inqu_status" row="0" ename="companyCode" cname="公司编码" colWidth="3" type="hidden"/>
<%--<EF:EFInput blockId="inqu_status" row="0" ename="groupName" cname="设备区域" colWidth="3"/>--%>
<%--<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:EFSelect blockId="inqu_status" row="0" ename="deviceType" cname="设备类型" colWidth="3" filter="contains">
<EF:EFOption label="全部" value=""/>
<EF:EFCodeOption codeName="hpjx.hpsb.deviceType"/>
</EF:EFSelect>
<EF:EFInput blockId="inqu_status" row="0" ename="checkItem" cname="检查项" placeholder="模糊查询" colWidth="3"/>
<EF:EFInput blockId="inqu_status" row="0" ename="parentId" cname="上级ID" colWidth="3" type="hidden"/>
</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:EFColumn ename="operator" cname="操作" locked="true" enable="false" width="100" align="center"/>
<EF:EFComboColumn ename="deviceType" cname="设备类型"
columnTemplate="#=textField#" itemTemplate="#=textField#"
textField="textField" valueField="valueField"
maxLength="16" width="80" readonly="true" required="true"
align="center" filter="contains" sort="true">
<EF:EFCodeOption codeName="hpjx.hpsb.deviceType" />
</EF:EFComboColumn>
<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:EFColumn ename="checkItem" cname="检查项" width="100" enable="true" readonly="true" align="center" required="true"/>
<EF:EFColumn ename="checkDescrip" cname="检查描述" editType="textarea" width="160" align="center"/>
<EF:EFColumn ename="checkResult" cname="检查结果" editType="textarea" width="160" align="center"/>
<EF:EFColumn ename="docId" cname="点检图片" width="100" enable="false" readonly="true" align="center"/>
<EF:EFColumn cname="创建人" ename="createdName" align="center" width="100" readonly="true" required="false"
enable="false"/>
<EF:EFColumn cname="创建时间" ename="createdTime" parseFormats="['yyyyMMddHHmmss']" editType="datetime"
dateFormat="yyyy-MM-dd HH:mm:ss" align="center" width="120" readonly="true" required="false"
enable="false"/>
</EF:EFGrid>
</EF:EFRegion>
</EF:EFPage>
$(function () {
var groupCodeBox = __eiInfo.getBlock("groupCodeBox_block_id").getMappedRows();
$(".row").children().attr("class", "col-md-3");
$("#QUERY").on("click", query);
IPLATUI.EFGrid= {
"result": {
pageable: {
pageSize: 10,
pageSizes: [10, 20, 50, 100],
},
columns: [{
field: "groupCode",
title: "设备区域",
template: function (dataItem) {
for (let i = 0; i < groupCodeBox.length; i++) {
if (groupCodeBox[i]['valueField'] === dataItem['groupCode']) {
dataItem['groupName'] = groupCodeBox[i]['textField'].split("]")[1]
return groupCodeBox[i]['textField'].split("]")[1];
}
}
return dataItem["groupCode"]
}
}],
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) {
$("#CONFIRM").on("click",confirm);
},
afterEdit:function (e) {
},
onSave: function (e) {
// 阻止默认请求,使用自定义保存
e.preventDefault();
let btnNode = $(this);
//禁用按钮
btnNode.attr("disabled", true);
save(btnNode);
},
onDelete: function (e) {
// 阻止默认请求,使用自定义删除
//e.preventDefault();
//deleteFunc();
},
onSuccess: function (e) {
if (e.eiInfo.extAttr.methodName == 'save' || e.eiInfo.extAttr.methodName == 'delete') {
query();
}
},
onRowClick: function (e) {
}
}
}
/**
* 取消
*/
$('#cancel').on('click', function () {
// 关闭弹窗
parent.JSColorbox.close();
})
downKeyUp();
});
let query = function () {
resultGrid.dataSource.page(1);
}
/**
* 确认
*/
let confirm = function () {
let rows = resultGrid.getCheckedRows();
if (rows.length < 1) {
message("请选择数据");
return;
}
JSUtils.confirm("确定对数据做\"确认\"操作? ", {
ok: function () {
JSUtils.submitGridsData("result", "HGSB004B", "save", true,
function (e) {
var status = e.getStatus();
if (status !== -1) {
parent.JSColorbox.setValueCallback(e);
//parent.JSColorbox.close();
}else {
NotificationUtil({msg: e.msg, detailMsg: e.detailMsg}, "error");
}
});
}
});
}
let save = function (btnNode) {
let rows = resultGrid.getCheckedRows();
if (rows.length < 1) {
message("请选择数据");
return;
}
let flag = true;
$.each(rows, function(index, item) {
let companyCode= item.get("companyCode");
let groupCode= item.get("groupCode");
let planDate= item.get("planDate");
let planType= item.get("planType");
let planStartDate= item.get("planStartDate");
let planEndDate= item.get("planEndDate");
let planUserId= item.get("planUserId");
if(isBlank(companyCode)){
message("选中的第"+(index+1)+"行\"公司\",不能为空!");
flag = false;
return false;
}
if(isBlank(groupCode)){
message("选中的第"+(index+1)+"行\"设备区域\",不能为空!");
flag = false;
return false;
}
if(isBlank(planDate)){
message("选中的第"+(index+1)+"行\"计划日期\",不能为空!");
flag = false;
return false;
}
if(isBlank(planType)){
message("选中的第"+(index+1)+"行\"计划类型\",不能为空!");
flag = false;
return false;
}
if(isBlank(planStartDate)){
message("选中的第"+(index+1)+"行\"计划开始日期\",不能为空!");
flag = false;
return false;
}
if(isBlank(planEndDate)){
message("选中的第"+(index+1)+"行\"计划结束日期\",不能为空!");
flag = false;
return false;
}
if(isBlank(planUserId)){
message("选中的第"+(index+1)+"行\"计划人\",不能为空!");
flag = false;
return false;
}
});
if(flag) {
JSUtils.confirm("确定对勾选中的[" + rows.length + "]条数据做\"保存\"操作? ", {
ok: function () {
JSUtils.submitGridsData("result", "HGSB004", "save", true);
btnNode.attr("disabled", false);
}
});
}
}
<%--
Created by IntelliJ IDEA.
User: 1
Date: 2024/5/11
Time: 17:38
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" %>
<%@ page import="com.baosight.iplat4j.core.web.threadlocal.UserSession" %>
<%
UserSession.web2Service(request);
String userName = UserSession.getLoginCName();
String loginName = UserSession.getLoginName();
%>
<c:set var="ctx" value="${pageContext.request.contextPath}"/>
<c:set var="loginName" value="<%=loginName%>" />
<c:set var="userName" value="<%=userName%>" />
<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:EFInput blockId="inqu_status" row="0" ename="groupName" cname="设备区域" placeholder="模糊查询" colWidth="3"/>
<EF:EFDatePicker blockId="inqu_status" row="0" ename="planDate" cname="计划日期" role="date" format="yyyy-MM-dd" parseFormats="['yyyyMMdd']" colWidth="3"/>
<EF:EFInput blockId="inqu_status" row="0" ename="inspecUserId" cname="点检人" value="${loginName}" type="hidden"/>
<EF:EFInput blockId="inqu_status" row="0" ename="inspecUserName" cname="点检人名称" value="${userName}" type="hidden"/>
<EF:EFInput blockId="inqu_status" row="0" ename="planType" cname="计划类型" type="hidden"/>
<EF:EFInput blockId="inqu_status" row="0" ename="taskStatus" cname="任务类型" value="0" type="hidden"/>
<EF:EFInput blockId="inqu_status" row="0" ename="pageNumber" cname="页面号" type="hidden"/>
</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:EFComboColumn ename="groupCode" 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="groupCodeBox_block_id" textField="textField" valueField="valueField"/>
</EF:EFComboColumn>
<EF:EFColumn ename="planDate" cname="计划日期" width="120" enable="true" readonly="true" align="center" editType="date"
dateFormat="yyyy-MM-dd" parseFormats="['yyyyMMdd']" required="true"/>
<EF:EFColumn ename="planCode" cname="计划单号" width="100" enable="false" readonly="true" align="center" required="true"/>
<EF:EFComboColumn ename="planType" cname="计划类型"
columnTemplate="#=textField#" itemTemplate="#=textField#"
textField="textField" valueField="valueField"
maxLength="16" width="100" readonly="true" required="true"
align="center" filter="contains" sort="true">
<EF:EFCodeOption codeName="hggp.hgsb.planType" />
</EF:EFComboColumn>
<EF:EFColumn ename="planStartDate" cname="计划开始日期" width="120" align="center" editType="date"
dateFormat="yyyy-MM-dd" parseFormats="['yyyyMMdd']" readonly="false" required="true"/>
<EF:EFColumn ename="planEndDate" cname="计划结束日期" width="120" align="center" editType="date"
dateFormat="yyyy-MM-dd" parseFormats="['yyyyMMdd']" readonly="false" required="true"/>
<%--defaultValue="${loginName}"--%>
<EF:EFComboColumn ename="planUserId" cname="计划人"
columnTemplate="#=textField#" itemTemplate="#=textField#"
textField="textField" valueField="valueField"
maxLength="16" width="100" readonly="false" required="true"
align="center" filter="contains" sort="true">
<EF:EFOptions blockId="user_block_id" textField="textField" valueField="valueField"/>
</EF:EFComboColumn>
<EF:EFComboColumn ename="planStatus" cname="审批状态" width="80" align="center" readonly="false" required="true" defaultValue="1">
<EF:EFCodeOption codeName="hpjx.hpjx.status"/>
</EF:EFComboColumn>
<%--<EF:EFColumn cname="创建人" ename="createdName" align="center" width="100" readonly="true" required="false"
enable="false"/>
<EF:EFColumn cname="创建时间" ename="createdTime" parseFormats="['yyyyMMddHHmmss']" editType="datetime"
dateFormat="yyyy-MM-dd HH:mm:ss" align="center" width="120" readonly="true" required="false"
enable="false"/>--%>
</EF:EFGrid>
</EF:EFRegion>
</EF:EFPage>
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