Commit 79ec23d8 by wuwenlong

项目立项dev;

parent 80ef1525
package com.baosight.hggp.hg.sc.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:Hgsc001.java <br>
* Description: <br>
*
* Copyrigth:Baosight Software LTD.co Copyright (c) 2019. <br>
*
* @version 1.0
* @history 2024-05-07 17:23:17 create
*/
public class HGSC001 extends DaoEPBase {
private static final long serialVersionUID = 1L;
public static final String FIELD_id = "id";
public static final String FIELD_company_code = "companyCode"; /* 公司编码*/
public static final String FIELD_company_name = "companyName"; /* 公司名称*/
public static final String FIELD_dep_code = "depCode"; /* 部门编码*/
public static final String FIELD_dep_name = "depName"; /* 部门名称*/
public static final String FIELD_subcontract_code = "subcontractCode"; /* 分包商编码*/
public static final String FIELD_subcontract_name = "subcontractName"; /* 分包商名称*/
public static final String FIELD_genral_contract_code = "genralContractCode"; /* 总包商编码*/
public static final String FIELD_genral_contract_name = "genralContractName"; /* 总包商名称*/
public static final String FIELD_party_pm_name = "partyPmName"; /* 甲方项目经理名称*/
public static final String FIELD_party_pm_hpone = "partyPmHpone"; /* 甲方项目经理联系电话*/
public static final String FIELD_contract_name = "contractName"; /* 合同名称*/
public static final String FIELD_contract_work_txt = "contractWorkTxt"; /* 合同工作量*/
public static final String FIELD_proj_code = "projCode"; /* 项目编码*/
public static final String FIELD_proj_name = "projName"; /* 项目名称*/
public static final String FIELD_proj_type = "projType"; /* 项目性质*/
public static final String FIELD_proj_status = "projStatus"; /* 项目状态\t0:在建;1:完工*/
public static final String FIELD_approval_status = "approvalStatus"; /* 审批状态\t0:待审;1:审核中;2:已审*/
public static final String FIELD_permiss_start_date = "permissStartDate"; /* 准许开工日期*/
public static final String FIELD_start_date = "startDate"; /* 开工日期*/
public static final String FIELD_end_date = "endDate"; /* 完工日期*/
public static final String FIELD_account_code = "accountCode"; /* 帐套*/
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 COL_id = "id";
public static final String COL_company_code = "company_code"; /* 公司编码*/
public static final String COL_company_name = "company_name"; /* 公司名称*/
public static final String COL_dep_code = "dep_code"; /* 部门编码*/
public static final String COL_dep_name = "dep_name"; /* 部门名称*/
public static final String COL_subcontract_code = "subcontract_code"; /* 分包商编码*/
public static final String COL_subcontract_name = "subcontract_name"; /* 分包商名称*/
public static final String COL_genral_contract_code = "genral_contract_code"; /* 总包商编码*/
public static final String COL_genral_contract_name = "genral_contract_name"; /* 总包商名称*/
public static final String COL_party_pm_name = "party_pm_name"; /* 甲方项目经理名称*/
public static final String COL_party_pm_hpone = "party_pm_hpone"; /* 甲方项目经理联系电话*/
public static final String COL_contract_name = "contract_name"; /* 合同名称*/
public static final String COL_contract_work_txt = "contract_work_txt"; /* 合同工作量*/
public static final String COL_proj_code = "proj_code"; /* 项目编码*/
public static final String COL_proj_name = "proj_name"; /* 项目名称*/
public static final String COL_proj_type = "proj_type"; /* 项目性质*/
public static final String COL_proj_status = "proj_status"; /* 项目状态\t0:在建;1:完工*/
public static final String COL_approval_status = "approval_status"; /* 审批状态\t0:待审;1:审核中;2:已审*/
public static final String COL_permiss_start_date = "permiss_start_date"; /* 准许开工日期*/
public static final String COL_start_date = "start_date"; /* 开工日期*/
public static final String COL_end_date = "end_date"; /* 完工日期*/
public static final String COL_account_code = "account_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 QUERY = "HGSC001.query";
public static final String COUNT = "HGSC001.count";
public static final String INSERT = "HGSC001.insert";
public static final String UPDATE = "HGSC001.update";
public static final String DELETE = "HGSC001.delete";
public static final String BATCH_DELETE = "HGSC001.batch_delete";
private Long id = new Long(0);
private String companyCode = " "; /* 公司编码*/
private String companyName = " "; /* 公司名称*/
private String depCode = " "; /* 部门编码*/
private String depName = " "; /* 部门名称*/
private String subcontractCode = " "; /* 分包商编码*/
private String subcontractName = " "; /* 分包商名称*/
private String genralContractCode = " "; /* 总包商编码*/
private String genralContractName = " "; /* 总包商名称*/
private String partyPmName = " "; /* 甲方项目经理名称*/
private String partyPmHpone = " "; /* 甲方项目经理联系电话*/
private String contractName = " "; /* 合同名称*/
private String contractWorkTxt = " "; /* 合同工作量*/
private String projCode = " "; /* 项目编码*/
private String projName = " "; /* 项目名称*/
private String projType = " "; /* 项目性质*/
private Integer projStatus = new Integer(0); /* 项目状态\t0:在建;1:完工*/
private Integer approvalStatus = new Integer(0); /* 审批状态\t0:待审;1:审核中;2:已审*/
private String permissStartDate = " "; /* 准许开工日期*/
private String startDate = " "; /* 开工日期*/
private String endDate = " "; /* 完工日期*/
private String accountCode = " "; /* 帐套*/
private String createdBy = " "; /* 创建人*/
private String createdName = " "; /* 创建人名称*/
private String createdTime = " "; /* 创建时间*/
private String updatedBy = " "; /* 更新人*/
private String updatedName = " "; /* 修改人名称*/
private String updatedTime = " "; /* 更新时间*/
/**
* initialize the metadata.
*/
public void initMetaData() {
EiColumn eiColumn;
eiColumn = new EiColumn(FIELD_id);
eiColumn.setPrimaryKey(true);
eiColumn.setDescName(" ");
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_dep_code);
eiColumn.setDescName("部门编码");
eiMetadata.addMeta(eiColumn);
eiColumn = new EiColumn(FIELD_dep_name);
eiColumn.setDescName("部门名称");
eiMetadata.addMeta(eiColumn);
eiColumn = new EiColumn(FIELD_subcontract_code);
eiColumn.setDescName("分包商编码");
eiMetadata.addMeta(eiColumn);
eiColumn = new EiColumn(FIELD_subcontract_name);
eiColumn.setDescName("分包商名称");
eiMetadata.addMeta(eiColumn);
eiColumn = new EiColumn(FIELD_genral_contract_code);
eiColumn.setDescName("总包商编码");
eiMetadata.addMeta(eiColumn);
eiColumn = new EiColumn(FIELD_genral_contract_name);
eiColumn.setDescName("总包商名称");
eiMetadata.addMeta(eiColumn);
eiColumn = new EiColumn(FIELD_party_pm_name);
eiColumn.setDescName("甲方项目经理名称");
eiMetadata.addMeta(eiColumn);
eiColumn = new EiColumn(FIELD_party_pm_hpone);
eiColumn.setDescName("甲方项目经理联系电话");
eiMetadata.addMeta(eiColumn);
eiColumn = new EiColumn(FIELD_contract_name);
eiColumn.setDescName("合同名称");
eiMetadata.addMeta(eiColumn);
eiColumn = new EiColumn(FIELD_contract_work_txt);
eiColumn.setDescName("合同工作量");
eiMetadata.addMeta(eiColumn);
eiColumn = new EiColumn(FIELD_proj_code);
eiColumn.setDescName("项目编码");
eiMetadata.addMeta(eiColumn);
eiColumn = new EiColumn(FIELD_proj_name);
eiColumn.setDescName("项目名称");
eiMetadata.addMeta(eiColumn);
eiColumn = new EiColumn(FIELD_proj_type);
eiColumn.setDescName("项目性质");
eiMetadata.addMeta(eiColumn);
eiColumn = new EiColumn(FIELD_proj_status);
eiColumn.setDescName("项目状态\t0:在建;1:完工");
eiMetadata.addMeta(eiColumn);
eiColumn = new EiColumn(FIELD_approval_status);
eiColumn.setDescName("审批状态\t0:待审;1:审核中;2:已审");
eiMetadata.addMeta(eiColumn);
eiColumn = new EiColumn(FIELD_permiss_start_date);
eiColumn.setDescName("准许开工日期");
eiMetadata.addMeta(eiColumn);
eiColumn = new EiColumn(FIELD_start_date);
eiColumn.setDescName("开工日期");
eiMetadata.addMeta(eiColumn);
eiColumn = new EiColumn(FIELD_end_date);
eiColumn.setDescName("完工日期");
eiMetadata.addMeta(eiColumn);
eiColumn = new EiColumn(FIELD_account_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);
}
/**
* the constructor.
*/
public HGSC001() {
initMetaData();
}
/**
* get the id .
* @return the id
*/
public Long getId() {
return this.id;
}
/**
* set the id .
*
* @param id
*/
public void setId(Long id) {
this.id = id;
}
/**
* 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 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 depName - 部门名称.
* @return the depName
*/
public String getDepName() {
return this.depName;
}
/**
* set the depName - 部门名称.
*
* @param depName - 部门名称
*/
public void setDepName(String depName) {
this.depName = depName;
}
/**
* get the subcontractCode - 分包商编码.
* @return the subcontractCode
*/
public String getSubcontractCode() {
return this.subcontractCode;
}
/**
* set the subcontractCode - 分包商编码.
*
* @param subcontractCode - 分包商编码
*/
public void setSubcontractCode(String subcontractCode) {
this.subcontractCode = subcontractCode;
}
/**
* get the subcontractName - 分包商名称.
* @return the subcontractName
*/
public String getSubcontractName() {
return this.subcontractName;
}
/**
* set the subcontractName - 分包商名称.
*
* @param subcontractName - 分包商名称
*/
public void setSubcontractName(String subcontractName) {
this.subcontractName = subcontractName;
}
/**
* get the genralContractCode - 总包商编码.
* @return the genralContractCode
*/
public String getGenralContractCode() {
return this.genralContractCode;
}
/**
* set the genralContractCode - 总包商编码.
*
* @param genralContractCode - 总包商编码
*/
public void setGenralContractCode(String genralContractCode) {
this.genralContractCode = genralContractCode;
}
/**
* get the genralContractName - 总包商名称.
* @return the genralContractName
*/
public String getGenralContractName() {
return this.genralContractName;
}
/**
* set the genralContractName - 总包商名称.
*
* @param genralContractName - 总包商名称
*/
public void setGenralContractName(String genralContractName) {
this.genralContractName = genralContractName;
}
/**
* get the partyPmName - 甲方项目经理名称.
* @return the partyPmName
*/
public String getPartyPmName() {
return this.partyPmName;
}
/**
* set the partyPmName - 甲方项目经理名称.
*
* @param partyPmName - 甲方项目经理名称
*/
public void setPartyPmName(String partyPmName) {
this.partyPmName = partyPmName;
}
/**
* get the partyPmHpone - 甲方项目经理联系电话.
* @return the partyPmHpone
*/
public String getPartyPmHpone() {
return this.partyPmHpone;
}
/**
* set the partyPmHpone - 甲方项目经理联系电话.
*
* @param partyPmHpone - 甲方项目经理联系电话
*/
public void setPartyPmHpone(String partyPmHpone) {
this.partyPmHpone = partyPmHpone;
}
/**
* get the contractName - 合同名称.
* @return the contractName
*/
public String getContractName() {
return this.contractName;
}
/**
* set the contractName - 合同名称.
*
* @param contractName - 合同名称
*/
public void setContractName(String contractName) {
this.contractName = contractName;
}
/**
* get the contractWorkTxt - 合同工作量.
* @return the contractWorkTxt
*/
public String getContractWorkTxt() {
return this.contractWorkTxt;
}
/**
* set the contractWorkTxt - 合同工作量.
*
* @param contractWorkTxt - 合同工作量
*/
public void setContractWorkTxt(String contractWorkTxt) {
this.contractWorkTxt = contractWorkTxt;
}
/**
* get the projCode - 项目编码.
* @return the projCode
*/
public String getProjCode() {
return this.projCode;
}
/**
* set the projCode - 项目编码.
*
* @param projCode - 项目编码
*/
public void setProjCode(String projCode) {
this.projCode = projCode;
}
/**
* get the projName - 项目名称.
* @return the projName
*/
public String getProjName() {
return this.projName;
}
/**
* set the projName - 项目名称.
*
* @param projName - 项目名称
*/
public void setProjName(String projName) {
this.projName = projName;
}
/**
* get the projType - 项目性质.
* @return the projType
*/
public String getProjType() {
return this.projType;
}
/**
* set the projType - 项目性质.
*
* @param projType - 项目性质
*/
public void setProjType(String projType) {
this.projType = projType;
}
/**
* get the projStatus - 项目状态\t0:在建;1:完工.
* @return the projStatus
*/
public Integer getProjStatus() {
return this.projStatus;
}
/**
* set the projStatus - 项目状态\t0:在建;1:完工.
*
* @param projStatus - 项目状态\t0:在建;1:完工
*/
public void setProjStatus(Integer projStatus) {
this.projStatus = projStatus;
}
/**
* get the approvalStatus - 审批状态\t0:待审;1:审核中;2:已审.
* @return the approvalStatus
*/
public Integer getApprovalStatus() {
return this.approvalStatus;
}
/**
* set the approvalStatus - 审批状态\t0:待审;1:审核中;2:已审.
*
* @param approvalStatus - 审批状态\t0:待审;1:审核中;2:已审
*/
public void setApprovalStatus(Integer approvalStatus) {
this.approvalStatus = approvalStatus;
}
/**
* get the permissStartDate - 准许开工日期.
* @return the permissStartDate
*/
public String getPermissStartDate() {
return this.permissStartDate;
}
/**
* set the permissStartDate - 准许开工日期.
*
* @param permissStartDate - 准许开工日期
*/
public void setPermissStartDate(String permissStartDate) {
this.permissStartDate = permissStartDate;
}
/**
* get the startDate - 开工日期.
* @return the startDate
*/
public String getStartDate() {
return this.startDate;
}
/**
* set the startDate - 开工日期.
*
* @param startDate - 开工日期
*/
public void setStartDate(String startDate) {
this.startDate = startDate;
}
/**
* get the endDate - 完工日期.
* @return the endDate
*/
public String getEndDate() {
return this.endDate;
}
/**
* set the endDate - 完工日期.
*
* @param endDate - 完工日期
*/
public void setEndDate(String endDate) {
this.endDate = endDate;
}
/**
* 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 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 value from Map.
*
* @param map - source data map
*/
@Override
public void fromMap(Map map) {
setId(NumberUtils.toLong(StringUtils.toString(map.get(FIELD_id)), id));
setCompanyCode(StringUtils.defaultIfEmpty(StringUtils.toString(map.get(FIELD_company_code)), companyCode));
setCompanyName(StringUtils.defaultIfEmpty(StringUtils.toString(map.get(FIELD_company_name)), companyName));
setDepCode(StringUtils.defaultIfEmpty(StringUtils.toString(map.get(FIELD_dep_code)), depCode));
setDepName(StringUtils.defaultIfEmpty(StringUtils.toString(map.get(FIELD_dep_name)), depName));
setSubcontractCode(StringUtils.defaultIfEmpty(StringUtils.toString(map.get(FIELD_subcontract_code)), subcontractCode));
setSubcontractName(StringUtils.defaultIfEmpty(StringUtils.toString(map.get(FIELD_subcontract_name)), subcontractName));
setGenralContractCode(StringUtils.defaultIfEmpty(StringUtils.toString(map.get(FIELD_genral_contract_code)), genralContractCode));
setGenralContractName(StringUtils.defaultIfEmpty(StringUtils.toString(map.get(FIELD_genral_contract_name)), genralContractName));
setPartyPmName(StringUtils.defaultIfEmpty(StringUtils.toString(map.get(FIELD_party_pm_name)), partyPmName));
setPartyPmHpone(StringUtils.defaultIfEmpty(StringUtils.toString(map.get(FIELD_party_pm_hpone)), partyPmHpone));
setContractName(StringUtils.defaultIfEmpty(StringUtils.toString(map.get(FIELD_contract_name)), contractName));
setContractWorkTxt(StringUtils.defaultIfEmpty(StringUtils.toString(map.get(FIELD_contract_work_txt)), contractWorkTxt));
setProjCode(StringUtils.defaultIfEmpty(StringUtils.toString(map.get(FIELD_proj_code)), projCode));
setProjName(StringUtils.defaultIfEmpty(StringUtils.toString(map.get(FIELD_proj_name)), projName));
setProjType(StringUtils.defaultIfEmpty(StringUtils.toString(map.get(FIELD_proj_type)), projType));
setProjStatus(NumberUtils.toInteger(StringUtils.toString(map.get(FIELD_proj_status)), projStatus));
setApprovalStatus(NumberUtils.toInteger(StringUtils.toString(map.get(FIELD_approval_status)), approvalStatus));
setPermissStartDate(StringUtils.defaultIfEmpty(StringUtils.toString(map.get(FIELD_permiss_start_date)), permissStartDate));
setStartDate(StringUtils.defaultIfEmpty(StringUtils.toString(map.get(FIELD_start_date)), startDate));
setEndDate(StringUtils.defaultIfEmpty(StringUtils.toString(map.get(FIELD_end_date)), endDate));
setAccountCode(StringUtils.defaultIfEmpty(StringUtils.toString(map.get(FIELD_account_code)), accountCode));
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));
}
/**
* 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_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_dep_code, StringUtils.toString(depCode, eiMetadata.getMeta(FIELD_dep_code)));
map.put(FIELD_dep_name, StringUtils.toString(depName, eiMetadata.getMeta(FIELD_dep_name)));
map.put(FIELD_subcontract_code, StringUtils.toString(subcontractCode, eiMetadata.getMeta(FIELD_subcontract_code)));
map.put(FIELD_subcontract_name, StringUtils.toString(subcontractName, eiMetadata.getMeta(FIELD_subcontract_name)));
map.put(FIELD_genral_contract_code, StringUtils.toString(genralContractCode, eiMetadata.getMeta(FIELD_genral_contract_code)));
map.put(FIELD_genral_contract_name, StringUtils.toString(genralContractName, eiMetadata.getMeta(FIELD_genral_contract_name)));
map.put(FIELD_party_pm_name, StringUtils.toString(partyPmName, eiMetadata.getMeta(FIELD_party_pm_name)));
map.put(FIELD_party_pm_hpone, StringUtils.toString(partyPmHpone, eiMetadata.getMeta(FIELD_party_pm_hpone)));
map.put(FIELD_contract_name, StringUtils.toString(contractName, eiMetadata.getMeta(FIELD_contract_name)));
map.put(FIELD_contract_work_txt, StringUtils.toString(contractWorkTxt, eiMetadata.getMeta(FIELD_contract_work_txt)));
map.put(FIELD_proj_code, StringUtils.toString(projCode, eiMetadata.getMeta(FIELD_proj_code)));
map.put(FIELD_proj_name, StringUtils.toString(projName, eiMetadata.getMeta(FIELD_proj_name)));
map.put(FIELD_proj_type, StringUtils.toString(projType, eiMetadata.getMeta(FIELD_proj_type)));
map.put(FIELD_proj_status, StringUtils.toString(projStatus, eiMetadata.getMeta(FIELD_proj_status)));
map.put(FIELD_approval_status, StringUtils.toString(approvalStatus, eiMetadata.getMeta(FIELD_approval_status)));
map.put(FIELD_permiss_start_date, StringUtils.toString(permissStartDate, eiMetadata.getMeta(FIELD_permiss_start_date)));
map.put(FIELD_start_date, StringUtils.toString(startDate, eiMetadata.getMeta(FIELD_start_date)));
map.put(FIELD_end_date, StringUtils.toString(endDate, eiMetadata.getMeta(FIELD_end_date)));
map.put(FIELD_account_code, StringUtils.toString(accountCode, eiMetadata.getMeta(FIELD_account_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)));
return map;
}
}
package com.baosight.hggp.hg.sc.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:Hgsc001a.java <br>
* Description: <br>
*
* Copyrigth:Baosight Software LTD.co Copyright (c) 2019. <br>
*
* @version 1.0
* @history 2024-05-09 14:45:44 create
*/
public class HGSC001A extends DaoEPBase {
private static final long serialVersionUID = 1L;
public static final String FIELD_id = "id";
public static final String FIELD_proj_id = "projId"; /* 项目ID*/
public static final String FIELD_user_code = "userCode"; /* 用户编码*/
public static final String FIELD_user_name = "userName"; /* 用户名称*/
public static final String FIELD_user_phone = "userPhone"; /* 用户手机号*/
public static final String FIELD_user_dep_code = "userDepCode"; /* 部门编码*/
public static final String FIELD_user_dep_name = "userDepName"; /* 部门名称*/
public static final String FIELD_dep_code = "depCode"; /* 部门编码*/
public static final String FIELD_dep_name = "depName"; /* 部门名称*/
public static final String FIELD_account_code = "accountCode"; /* 帐套*/
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 COL_id = "id";
public static final String COL_proj_id = "proj_id"; /* 项目ID*/
public static final String COL_user_code = "user_code"; /* 用户编码*/
public static final String COL_user_name = "user_name"; /* 用户名称*/
public static final String COL_user_phone = "user_phone"; /* 用户手机号*/
public static final String COL_user_dep_code = "user_dep_code"; /* 部门编码*/
public static final String COL_user_dep_name = "user_dep_name"; /* 部门名称*/
public static final String COL_dep_code = "dep_code"; /* 部门编码*/
public static final String COL_dep_name = "dep_name"; /* 部门名称*/
public static final String COL_account_code = "account_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 QUERY = "HGSC001A.query";
public static final String COUNT = "HGSC001A.count";
public static final String INSERT = "HGSC001A.insert";
public static final String UPDATE = "HGSC001A.update";
public static final String DELETE = "HGSC001A.delete";
public static final String DELETE_BY_PROJID = "HGSC001A.deleteByProjId";
public static final String DELETE_BY_PROJIDS = "HGSC001A.deleteByProjIds";
private Long id = new Long(0);
private Long projId = new Long(0); /* 项目ID*/
private String userCode = " "; /* 用户编码*/
private String userName = " "; /* 用户名称*/
private String userPhone = " "; /* 用户手机号*/
private String userDepCode = " "; /* 部门编码*/
private String userDepName = " "; /* 部门名称*/
private String depCode = " "; /* 部门编码*/
private String depName = " "; /* 部门名称*/
private String accountCode = " "; /* 帐套*/
private String createdBy = " "; /* 创建人*/
private String createdName = " "; /* 创建人名称*/
private String createdTime = " "; /* 创建时间*/
private String updatedBy = " "; /* 更新人*/
private String updatedName = " "; /* 修改人名称*/
private String updatedTime = " "; /* 更新时间*/
/**
* initialize the metadata.
*/
public void initMetaData() {
EiColumn eiColumn;
eiColumn = new EiColumn(FIELD_id);
eiColumn.setPrimaryKey(true);
eiColumn.setDescName(" ");
eiMetadata.addMeta(eiColumn);
eiColumn = new EiColumn(FIELD_proj_id);
eiColumn.setDescName("项目ID");
eiMetadata.addMeta(eiColumn);
eiColumn = new EiColumn(FIELD_user_code);
eiColumn.setDescName("用户编码");
eiMetadata.addMeta(eiColumn);
eiColumn = new EiColumn(FIELD_user_name);
eiColumn.setDescName("用户名称");
eiMetadata.addMeta(eiColumn);
eiColumn = new EiColumn(FIELD_user_phone);
eiColumn.setDescName("用户手机号");
eiMetadata.addMeta(eiColumn);
eiColumn = new EiColumn(FIELD_user_dep_code);
eiColumn.setDescName("部门编码");
eiMetadata.addMeta(eiColumn);
eiColumn = new EiColumn(FIELD_user_dep_name);
eiColumn.setDescName("部门名称");
eiMetadata.addMeta(eiColumn);
eiColumn = new EiColumn(FIELD_dep_code);
eiColumn.setDescName("部门编码");
eiMetadata.addMeta(eiColumn);
eiColumn = new EiColumn(FIELD_dep_name);
eiColumn.setDescName("部门名称");
eiMetadata.addMeta(eiColumn);
eiColumn = new EiColumn(FIELD_account_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);
}
/**
* the constructor.
*/
public HGSC001A() {
initMetaData();
}
/**
* get the id .
* @return the id
*/
public Long getId() {
return this.id;
}
/**
* set the id .
*
* @param id
*/
public void setId(Long id) {
this.id = id;
}
/**
* get the projId - 项目ID.
* @return the projId
*/
public Long getProjId() {
return this.projId;
}
/**
* set the projId - 项目ID.
*
* @param projId - 项目ID
*/
public void setProjId(Long projId) {
this.projId = projId;
}
/**
* get the userCode - 用户编码.
* @return the userCode
*/
public String getUserCode() {
return this.userCode;
}
/**
* set the userCode - 用户编码.
*
* @param userCode - 用户编码
*/
public void setUserCode(String userCode) {
this.userCode = userCode;
}
/**
* get the userName - 用户名称.
* @return the userName
*/
public String getUserName() {
return this.userName;
}
/**
* set the userName - 用户名称.
*
* @param userName - 用户名称
*/
public void setUserName(String userName) {
this.userName = userName;
}
/**
* get the userPhone - 用户手机号.
* @return the userPhone
*/
public String getUserPhone() {
return this.userPhone;
}
/**
* set the userPhone - 用户手机号.
*
* @param userPhone - 用户手机号
*/
public void setUserPhone(String userPhone) {
this.userPhone = userPhone;
}
/**
* get the userDepCode - 部门编码.
* @return the userDepCode
*/
public String getUserDepCode() {
return this.userDepCode;
}
/**
* set the userDepCode - 部门编码.
*
* @param userDepCode - 部门编码
*/
public void setUserDepCode(String userDepCode) {
this.userDepCode = userDepCode;
}
/**
* get the userDepName - 部门名称.
* @return the userDepName
*/
public String getUserDepName() {
return this.userDepName;
}
/**
* set the userDepName - 部门名称.
*
* @param userDepName - 部门名称
*/
public void setUserDepName(String userDepName) {
this.userDepName = userDepName;
}
/**
* 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 depName - 部门名称.
* @return the depName
*/
public String getDepName() {
return this.depName;
}
/**
* set the depName - 部门名称.
*
* @param depName - 部门名称
*/
public void setDepName(String depName) {
this.depName = depName;
}
/**
* 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 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 value from Map.
*
* @param map - source data map
*/
@Override
public void fromMap(Map map) {
setId(NumberUtils.toLong(StringUtils.toString(map.get(FIELD_id)), id));
setProjId(NumberUtils.toLong(StringUtils.toString(map.get(FIELD_proj_id)), projId));
setUserCode(StringUtils.defaultIfEmpty(StringUtils.toString(map.get(FIELD_user_code)), userCode));
setUserName(StringUtils.defaultIfEmpty(StringUtils.toString(map.get(FIELD_user_name)), userName));
setUserPhone(StringUtils.defaultIfEmpty(StringUtils.toString(map.get(FIELD_user_phone)), userPhone));
setUserDepCode(StringUtils.defaultIfEmpty(StringUtils.toString(map.get(FIELD_user_dep_code)), userDepCode));
setUserDepName(StringUtils.defaultIfEmpty(StringUtils.toString(map.get(FIELD_user_dep_name)), userDepName));
setDepCode(StringUtils.defaultIfEmpty(StringUtils.toString(map.get(FIELD_dep_code)), depCode));
setDepName(StringUtils.defaultIfEmpty(StringUtils.toString(map.get(FIELD_dep_name)), depName));
setAccountCode(StringUtils.defaultIfEmpty(StringUtils.toString(map.get(FIELD_account_code)), accountCode));
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));
}
/**
* 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_proj_id, StringUtils.toString(projId, eiMetadata.getMeta(FIELD_proj_id)));
map.put(FIELD_user_code, StringUtils.toString(userCode, eiMetadata.getMeta(FIELD_user_code)));
map.put(FIELD_user_name, StringUtils.toString(userName, eiMetadata.getMeta(FIELD_user_name)));
map.put(FIELD_user_phone, StringUtils.toString(userPhone, eiMetadata.getMeta(FIELD_user_phone)));
map.put(FIELD_user_dep_code, StringUtils.toString(userDepCode, eiMetadata.getMeta(FIELD_user_dep_code)));
map.put(FIELD_user_dep_name, StringUtils.toString(userDepName, eiMetadata.getMeta(FIELD_user_dep_name)));
map.put(FIELD_dep_code, StringUtils.toString(depCode, eiMetadata.getMeta(FIELD_dep_code)));
map.put(FIELD_dep_name, StringUtils.toString(depName, eiMetadata.getMeta(FIELD_dep_name)));
map.put(FIELD_account_code, StringUtils.toString(accountCode, eiMetadata.getMeta(FIELD_account_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)));
return map;
}
}
package com.baosight.hggp.hg.sc.service;
import com.baosight.hggp.common.DdynamicEnum;
import com.baosight.hggp.core.constant.CommonConstant;
import com.baosight.hggp.core.dao.DaoUtils;
import com.baosight.hggp.core.security.UserSessionUtils;
import com.baosight.hggp.hg.constant.HGConstant;
import com.baosight.hggp.hg.sc.domain.HGSC001;
import com.baosight.hggp.hg.sc.domain.HGSC001A;
import com.baosight.hggp.hg.sc.tools.HGSCTools;
import com.baosight.hggp.hg.xs.domain.Company;
import com.baosight.hggp.hg.xs.domain.Dept;
import com.baosight.hggp.hg.xs.domain.User;
import com.baosight.hggp.util.*;
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.ServiceBase;
import com.baosight.iplat4j.ed.util.SequenceGenerator;
import java.math.BigDecimal;
import java.util.*;
/**
* @Author wwl
* @Date 2024/5/6 19:48
*/
public class ServiceHGSC001 extends ServiceBase {
public EiInfo initLoad(EiInfo inInfo) {
try {
inInfo = super.query(inInfo, HGSC001.QUERY, new HGSC001());
Map map = new HashMap();
map.put("accountCode", UserSessionUtils.getAccountCode());
CommonMethod.initBlock(inInfo, Arrays.asList(DdynamicEnum.PROJ_TYPE_BLOCK_ID), map,false);
} catch (PlatException e) {
LogUtils.setDetailMsg(inInfo, e, "初始化失败");
}
return inInfo;
}
public EiInfo query(EiInfo inInfo) {
try {
inInfo = super.query(inInfo, HGSC001.QUERY, new HGSC001());
Map map = new HashMap();
map.put("accountCode", UserSessionUtils.getAccountCode());
CommonMethod.initBlock(inInfo, Arrays.asList(DdynamicEnum.PROJ_TYPE_BLOCK_ID), map,false);
inInfo.setStatus(EiConstant.STATUS_DEFAULT);
} catch (PlatException e) {
LogUtils.setDetailMsg(inInfo, e, "查询失败");
}
return inInfo;
}
@Override
public EiInfo delete(EiInfo inInfo) {
try {
List<Map> resultRows = inInfo.getBlock(EiConstant.resultBlock).getRows();
// 销售单号
List<Long> ids = ObjectUtils.listKey(resultRows, "id");
DaoUtils.update(HGSC001.BATCH_DELETE, new HashMap<String,Object>(){{put("ids",ids);}});
HGSCTools.THGSC001A.deleteByProIds(ids);
inInfo = this.query(inInfo);
inInfo.setStatus(EiConstant.STATUS_DEFAULT);
inInfo.setMsg("操作成功!本次对[" + resultRows.size() + "]条数据删除成功!");
} catch (Exception e) {
LogUtils.setDetailMsg(inInfo, e, "删除失败");
}
return inInfo;
}
public EiInfo save(EiInfo inInfo){
try {
Map resultMap = EiInfoUtils.getFirstRow(inInfo,EiConstant.resultBlock);
HGSC001 hgsc001 = new HGSC001();
hgsc001.fromMap(resultMap);
this.checkSaveData(hgsc001);
if(Objects.nonNull(hgsc001.getId())&&hgsc001.getId()!=0){
DaoUtils.update(HGSC001.UPDATE, hgsc001);
}else {
DaoUtils.insert(HGSC001.INSERT, hgsc001);
}
List<Map> detailRows = inInfo.getBlock(CommonConstant.Field.DETAIL).getRows();
// 处理项目负责人
List<HGSC001A> hgsc001AList = HGSCTools.THGSC001A.convertToObj(detailRows);
HGSCTools.THGSC001A.checkProjMgData(hgsc001AList);
HGSCTools.THGSC001A.save(hgsc001AList,hgsc001.getId());
inInfo.setStatus(EiConstant.STATUS_DEFAULT);
inInfo.setMsg("保存成功!");
} catch (Exception e) {
LogUtils.setDetailMsg(inInfo, e, "保存失败");
}
return inInfo;
}
/**
* 校验保存的数据
*
* @param hgsc001
*/
private void checkSaveData(HGSC001 hgsc001) {
AssertUtils.isEmpty(UserSessionUtils.getAccountCode(), "当前用户未绑定公司,无法操作数据,请联系管理员!");
AssertUtils.isEmpty(UserSessionUtils.getOrgId(), "当前用户未绑定部门,无法操作数据,请联系管理员!");
AssertUtils.isEmpty(hgsc001.getCompanyCode(), "请选择公司!");
AssertUtils.isEmpty(hgsc001.getDepCode(), "请选择部门!");
AssertUtils.isEmpty(hgsc001.getSubcontractCode(), "请选择分包方!");
AssertUtils.isEmpty(hgsc001.getGenralContractCode(), "请选择总包方!");
AssertUtils.isEmpty(hgsc001.getProjCode(), "请填写项目编号!");
AssertUtils.isEmpty(hgsc001.getProjName(), "请填写项目名称!");
AssertUtils.isEmpty(hgsc001.getContractName(), "请填写合同名称!");
AssertUtils.isEmpty(hgsc001.getProjType(), "请选择项目性质!");
AssertUtils.isEmpty(hgsc001.getPermissStartDate(), "请选择准许开工日期!");
AssertUtils.isEmpty(hgsc001.getStartDate(), "请选择开工日期!");
AssertUtils.isEmpty(hgsc001.getEndDate(), "请选择完工日期!");
AssertUtils.isNull(hgsc001.getProjStatus(), "请选择项目状态!");
AssertUtils.isEmpty(hgsc001.getContractWorkTxt(), "请填写合同工作量!");
}
/**
* 部门下拉框
* @param inInfo
* @return
*/
public EiInfo depByCompanyComboBox(EiInfo inInfo){
try {
Map queryMap = EiInfoUtils.getFirstRow(inInfo);
String companyCode = MapUtils.getString(queryMap, HGSC001.FIELD_company_code);
EiInfoUtils.addBlock(inInfo,"depByCompany", UserSessionUtils.getDepByCompany(companyCode), Dept.class);
CommonMethod.comboBoxDefaultValue(inInfo,"depByCompany","depCode","depName");
} catch (InstantiationException e) {
e.printStackTrace();
} catch (IllegalAccessException e) {
e.printStackTrace();
}
return inInfo;
}
/**
* 客户档案下拉框
* @param inInfo
* @return
*/
public EiInfo genralContractComboBox(EiInfo inInfo){
Map queryMap = EiInfoUtils.getFirstRow(inInfo);
String companyCode = MapUtils.getString(queryMap, HGSC001.FIELD_subcontract_code);
Map map = new HashMap();
map.put("accountCode", UserSessionUtils.getAccountCode());
// map.put("companyCode", companyCode);
CommonMethod.initBlock(inInfo, Arrays.asList(DdynamicEnum.CUSTOMER_RECORD_BLOCK_ID), map,false);
CommonMethod.comboBoxDefaultValue(inInfo,DdynamicEnum.CUSTOMER_RECORD_BLOCK_ID.getBlockId());
return inInfo;
}
/**
* 用户下拉框
* @param inInfo
* @return
*/
public EiInfo userByCompanyComboBox(EiInfo inInfo) throws InstantiationException, IllegalAccessException {
String companyCode = inInfo.getCellStr(EiConstant.queryBlock,EiConstant.STATUS_DEFAULT,HGSC001.FIELD_company_code);
EiInfoUtils.addBlock(inInfo,"userByCompany", UserSessionUtils.getUserByCompany(companyCode), User.class);
CommonMethod.comboBoxDefaultValue(inInfo,DdynamicEnum.CUSTOMER_RECORD_BLOCK_ID.getBlockId(),"loginName","userName");
return inInfo;
}
}
package com.baosight.hggp.hg.sc.service;
import com.baosight.hggp.hg.sc.domain.HGSC001A;
import com.baosight.hggp.util.LogUtils;
import com.baosight.iplat4j.core.ei.EiInfo;
import com.baosight.iplat4j.core.exception.PlatException;
import com.baosight.iplat4j.core.service.impl.ServiceBase;
/**
* @Author wwl
* @Date 2024/5/6 19:48
*/
public class ServiceHGSC001A extends ServiceBase {
public EiInfo initLoad(EiInfo inInfo) {
try {
inInfo = super.query(inInfo, HGSC001A.QUERY, new HGSC001A());
} catch (PlatException e) {
LogUtils.setDetailMsg(inInfo, e, "初始化失败");
}
return inInfo;
}
}
package com.baosight.hggp.hg.sc.service;
import com.baosight.hggp.common.DdynamicEnum;
import com.baosight.hggp.core.constant.CommonConstant;
import com.baosight.hggp.core.security.UserSessionUtils;
import com.baosight.hggp.hg.constant.HGConstant;
import com.baosight.hggp.hg.sc.domain.HGSC001;
import com.baosight.hggp.hg.sc.domain.HGSC001A;
import com.baosight.hggp.hg.sc.tools.HGSCTools;
import com.baosight.hggp.hg.xs.domain.Company;
import com.baosight.hggp.hg.xs.domain.Dept;
import com.baosight.hggp.util.CommonMethod;
import com.baosight.hggp.util.EiInfoUtils;
import com.baosight.hggp.util.LogUtils;
import com.baosight.hggp.util.MapUtils;
import com.baosight.iplat4j.core.ei.EiConstant;
import com.baosight.iplat4j.core.ei.EiInfo;
import com.baosight.iplat4j.core.exception.PlatException;
import com.baosight.iplat4j.core.service.impl.ServiceBase;
import com.baosight.iplat4j.ed.util.SequenceGenerator;
import java.util.*;
/**
* @Author wwl
* @Date 2024/5/6 19:48
*/
public class ServiceHGSC001C extends ServiceBase {
public EiInfo initLoad(EiInfo inInfo) {
try {
HGSC001 hgsc001 = new HGSC001();
hgsc001.setProjCode(SequenceGenerator.getNextSequence(HGConstant.SequenceId.PROJ_NUMBER));
EiInfoUtils.addBlock(inInfo,EiConstant.resultBlock,new ArrayList(){{add(hgsc001);}},HGSC001.class);
inInfo.addBlock(CommonConstant.Field.DETAIL).addBlockMeta(new HGSC001A().eiMetadata);
Map map = new HashMap();
map.put("accountCode", UserSessionUtils.getAccountCode());
CommonMethod.initBlock(inInfo, Arrays.asList(DdynamicEnum.PROJ_TYPE_BLOCK_ID), map,false);
CommonMethod.initBlock(inInfo, Arrays.asList(DdynamicEnum.CUSTOMER_RECORD_BLOCK_ID), map,false);
EiInfoUtils.addBlock(inInfo,"roleCompany", UserSessionUtils.getRoleCompany(), Company.class);
} catch (PlatException e) {
LogUtils.setDetailMsg(inInfo, e, "初始化失败");
} catch (InstantiationException e) {
e.printStackTrace();
} catch (IllegalAccessException e) {
e.printStackTrace();
}
return inInfo;
}
}
package com.baosight.hggp.hg.sc.service;
import com.baosight.hggp.common.DdynamicEnum;
import com.baosight.hggp.core.constant.CommonConstant;
import com.baosight.hggp.core.security.UserSessionUtils;
import com.baosight.hggp.hg.constant.HGConstant;
import com.baosight.hggp.hg.sc.domain.HGSC001;
import com.baosight.hggp.hg.sc.domain.HGSC001A;
import com.baosight.hggp.hg.sc.tools.HGSCTools;
import com.baosight.hggp.hg.xs.domain.Company;
import com.baosight.hggp.hg.xs.domain.Dept;
import com.baosight.hggp.hg.xs.domain.User;
import com.baosight.hggp.util.CommonMethod;
import com.baosight.hggp.util.EiInfoUtils;
import com.baosight.hggp.util.LogUtils;
import com.baosight.iplat4j.core.ei.EiConstant;
import com.baosight.iplat4j.core.ei.EiInfo;
import com.baosight.iplat4j.core.exception.PlatException;
import com.baosight.iplat4j.core.service.impl.ServiceBase;
import com.baosight.iplat4j.ed.util.SequenceGenerator;
import java.util.*;
/**
* @Author wwl
* @Date 2024/5/6 19:48
*/
public class ServiceHGSC001D extends ServiceBase {
public EiInfo initLoad(EiInfo inInfo) {
try {
inInfo = super.query(inInfo,HGSC001.QUERY,new HGSC001());
Map resultMap = EiInfoUtils.getFirstRow(inInfo,EiConstant.resultBlock);
List<HGSC001A> hgsc001AList = HGSCTools.THGSC001A.getByProjId(
Long.valueOf(String.valueOf(resultMap.get(HGSC001.FIELD_id))));
EiInfoUtils.addBlock(inInfo,CommonConstant.Field.DETAIL, hgsc001AList, HGSC001A.class);
Map map = new HashMap();
map.put("accountCode", UserSessionUtils.getAccountCode());
CommonMethod.initBlock(inInfo, Arrays.asList(DdynamicEnum.PROJ_TYPE_BLOCK_ID), map,false);
CommonMethod.initBlock(inInfo, Arrays.asList(DdynamicEnum.CUSTOMER_RECORD_BLOCK_ID), map,false);
EiInfoUtils.addBlock(inInfo,"roleCompany", UserSessionUtils.getRoleCompany(), Company.class);
EiInfoUtils.addBlock(inInfo,"depByCompany", UserSessionUtils.getDepByCompany((String) resultMap.get(HGSC001.FIELD_company_code)), Dept.class);
EiInfoUtils.addBlock(inInfo,"userByCompany", UserSessionUtils.getUserByCompany((String) resultMap.get(HGSC001.FIELD_company_code)), User.class);
} catch (PlatException e) {
LogUtils.setDetailMsg(inInfo, e, "初始化失败");
} catch (InstantiationException e) {
e.printStackTrace();
} catch (IllegalAccessException e) {
e.printStackTrace();
}
return inInfo;
}
}
package com.baosight.hggp.hg.sc.service;
import com.baosight.hggp.common.DdynamicEnum;
import com.baosight.hggp.core.constant.CommonConstant;
import com.baosight.hggp.core.security.UserSessionUtils;
import com.baosight.hggp.hg.sc.domain.HGSC001;
import com.baosight.hggp.hg.sc.domain.HGSC001A;
import com.baosight.hggp.hg.sc.tools.HGSCTools;
import com.baosight.hggp.hg.xs.domain.Company;
import com.baosight.hggp.hg.xs.domain.Dept;
import com.baosight.hggp.hg.xs.domain.User;
import com.baosight.hggp.util.CommonMethod;
import com.baosight.hggp.util.EiInfoUtils;
import com.baosight.hggp.util.LogUtils;
import com.baosight.hggp.util.MapUtils;
import com.baosight.iplat4j.core.ei.EiConstant;
import com.baosight.iplat4j.core.ei.EiInfo;
import com.baosight.iplat4j.core.exception.PlatException;
import com.baosight.iplat4j.core.service.impl.ServiceBase;
import java.util.Arrays;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
/**
* @Author wwl
* @Date 2024/5/6 19:48
*/
public class ServiceHGSC001U extends ServiceBase {
public EiInfo initLoad(EiInfo inInfo) {
try {
inInfo = super.query(inInfo,HGSC001.QUERY,new HGSC001());
Map resultMap = EiInfoUtils.getFirstRow(inInfo,EiConstant.resultBlock);
List<HGSC001A> hgsc001AList = HGSCTools.THGSC001A.getByProjId(
Long.valueOf(String.valueOf(resultMap.get(HGSC001.FIELD_id))));
EiInfoUtils.addBlock(inInfo,CommonConstant.Field.DETAIL, hgsc001AList, HGSC001A.class);
Map map = new HashMap();
map.put("accountCode", UserSessionUtils.getAccountCode());
CommonMethod.initBlock(inInfo, Arrays.asList(DdynamicEnum.PROJ_TYPE_BLOCK_ID), map,false);
CommonMethod.initBlock(inInfo, Arrays.asList(DdynamicEnum.CUSTOMER_RECORD_BLOCK_ID), map,false);
EiInfoUtils.addBlock(inInfo,"roleCompany", UserSessionUtils.getRoleCompany(), Company.class);
EiInfoUtils.addBlock(inInfo,"depByCompany", UserSessionUtils.getDepByCompany((String) resultMap.get(HGSC001.FIELD_company_code)), Dept.class);
EiInfoUtils.addBlock(inInfo,"userByCompany", UserSessionUtils.getUserByCompany((String) resultMap.get(HGSC001.FIELD_company_code)), User.class);
} catch (PlatException e) {
LogUtils.setDetailMsg(inInfo, e, "初始化失败");
} catch (InstantiationException e) {
e.printStackTrace();
} catch (IllegalAccessException e) {
e.printStackTrace();
}
return inInfo;
}
}
<?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-07 17:23:17
Version : 1.0
schema : hggp
tableName : HGSC001
id BIGINT NOT NULL primarykey,
company_code VARCHAR NOT NULL,
company_name VARCHAR NOT NULL,
dep_code VARCHAR,
dep_name VARCHAR,
subcontract_code VARCHAR NOT NULL,
subcontract_name VARCHAR NOT NULL,
genral_contract_code VARCHAR NOT NULL,
genral_contract_name VARCHAR NOT NULL,
party_pm_name VARCHAR,
party_pm_hpone VARCHAR,
contract_name VARCHAR,
contract_work_txt VARCHAR,
proj_code VARCHAR,
proj_name VARCHAR,
proj_type VARCHAR,
proj_status TINYINT,
approval_status TINYINT,
permiss_start_date VARCHAR,
start_date VARCHAR,
end_date VARCHAR,
account_code VARCHAR NOT NULL,
created_by VARCHAR,
created_name VARCHAR,
created_time VARCHAR,
updated_by VARCHAR,
updated_name VARCHAR,
updated_time VARCHAR
-->
<sqlMap namespace="HGSC001">
<sql id="condition">
<isNotEmpty prepend=" AND " property="id">
id = #id#
</isNotEmpty>
<isNotEmpty prepend=" AND " property="companyCode">
company_code = #companyCode#
</isNotEmpty>
<isNotEmpty prepend=" AND " property="companyName">
company_name like ('%companyName%')
</isNotEmpty>
<isNotEmpty prepend=" AND " property="depCode">
dep_code = #depCode#
</isNotEmpty>
<isNotEmpty prepend=" AND " property="depName">
dep_name = #depName#
</isNotEmpty>
<isNotEmpty prepend=" AND " property="subcontractCode">
subcontract_code = #subcontractCode#
</isNotEmpty>
<isNotEmpty prepend=" AND " property="subcontractName">
subcontract_name like ('%subcontractName%')
</isNotEmpty>
<isNotEmpty prepend=" AND " property="genralContractCode">
genral_contract_code = #genralContractCode#
</isNotEmpty>
<isNotEmpty prepend=" AND " property="genralContractName">
genral_contract_name like ('%genralContractName%')
</isNotEmpty>
<isNotEmpty prepend=" AND " property="partyPmName">
party_pm_name = #partyPmName#
</isNotEmpty>
<isNotEmpty prepend=" AND " property="partyPmHpone">
party_pm_hpone = #partyPmHpone#
</isNotEmpty>
<isNotEmpty prepend=" AND " property="contractName">
contract_name like ('%contractName%')
</isNotEmpty>
<isNotEmpty prepend=" AND " property="contractWorkTxt">
contract_work_txt = #contractWorkTxt#
</isNotEmpty>
<isNotEmpty prepend=" AND " property="projCode">
proj_code = #projCode#
</isNotEmpty>
<isNotEmpty prepend=" AND " property="projName">
proj_name = #projName#
</isNotEmpty>
<isNotEmpty prepend=" AND " property="projType">
proj_type = #projType#
</isNotEmpty>
<isNotEmpty prepend=" AND " property="projStatus">
proj_status = #projStatus#
</isNotEmpty>
<isNotEmpty prepend=" AND " property="approvalStatus">
approval_status = #approvalStatus#
</isNotEmpty>
<isNotEmpty prepend=" AND " property="permissStartDate">
permiss_start_date = #permissStartDate#
</isNotEmpty>
<isNotEmpty prepend=" AND " property="startDate">
start_date = #startDate#
</isNotEmpty>
<isNotEmpty prepend=" AND " property="endDate">
end_date = #endDate#
</isNotEmpty>
<isNotEmpty prepend=" AND " property="accountCode">
account_code = #accountCode#
</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>
</sql>
<select id="query" parameterClass="java.util.HashMap"
resultClass="com.baosight.hggp.hg.sc.domain.HGSC001">
SELECT
id as "id",
company_code as "companyCode", <!-- 公司编码 -->
company_name as "companyName", <!-- 公司名称 -->
dep_code as "depCode", <!-- 部门编码 -->
dep_name as "depName", <!-- 部门名称 -->
subcontract_code as "subcontractCode", <!-- 分包商编码 -->
subcontract_name as "subcontractName", <!-- 分包商名称 -->
genral_contract_code as "genralContractCode", <!-- 总包商编码 -->
genral_contract_name as "genralContractName", <!-- 总包商名称 -->
party_pm_name as "partyPmName", <!-- 甲方项目经理名称 -->
party_pm_hpone as "partyPmHpone", <!-- 甲方项目经理联系电话 -->
contract_name as "contractName", <!-- 合同名称 -->
contract_work_txt as "contractWorkTxt", <!-- 合同工作量 -->
proj_code as "projCode", <!-- 项目编码 -->
proj_name as "projName", <!-- 项目名称 -->
proj_type as "projType", <!-- 项目性质 -->
proj_status as "projStatus", <!-- 项目状态 0:在建;1:完工 -->
approval_status as "approvalStatus", <!-- 审批状态 0:待审;1:审核中;2:已审 -->
permiss_start_date as "permissStartDate", <!-- 准许开工日期 -->
start_date as "startDate", <!-- 开工日期 -->
end_date as "endDate", <!-- 完工日期 -->
account_code as "accountCode", <!-- 帐套 -->
created_by as "createdBy", <!-- 创建人 -->
created_name as "createdName", <!-- 创建人名称 -->
created_time as "createdTime", <!-- 创建时间 -->
updated_by as "updatedBy", <!-- 更新人 -->
updated_name as "updatedName", <!-- 修改人名称 -->
updated_time as "updatedTime" <!-- 更新时间 -->
FROM ${hggpSchema}.HGSC001 WHERE 1=1
<include refid="condition" />
<dynamic prepend="ORDER BY">
<isNotEmpty property="orderBy">
$orderBy$
</isNotEmpty>
<isEmpty property="orderBy">
id asc
</isEmpty>
</dynamic>
</select>
<select id="count" resultClass="int">
SELECT COUNT(*) FROM ${hggpSchema}.HGSC001 WHERE 1=1
<include refid="condition" />
</select>
<!--
<isNotEmpty prepend=" AND " property="id">
id = #id#
</isNotEmpty>
<isNotEmpty prepend=" AND " property="companyCode">
company_code = #companyCode#
</isNotEmpty>
<isNotEmpty prepend=" AND " property="companyName">
company_name = #companyName#
</isNotEmpty>
<isNotEmpty prepend=" AND " property="depCode">
dep_code = #depCode#
</isNotEmpty>
<isNotEmpty prepend=" AND " property="depName">
dep_name = #depName#
</isNotEmpty>
<isNotEmpty prepend=" AND " property="subcontractCode">
subcontract_code = #subcontractCode#
</isNotEmpty>
<isNotEmpty prepend=" AND " property="subcontractName">
subcontract_name = #subcontractName#
</isNotEmpty>
<isNotEmpty prepend=" AND " property="genralContractCode">
genral_contract_code = #genralContractCode#
</isNotEmpty>
<isNotEmpty prepend=" AND " property="genralContractName">
genral_contract_name = #genralContractName#
</isNotEmpty>
<isNotEmpty prepend=" AND " property="partyPmName">
party_pm_name = #partyPmName#
</isNotEmpty>
<isNotEmpty prepend=" AND " property="partyPmHpone">
party_pm_hpone = #partyPmHpone#
</isNotEmpty>
<isNotEmpty prepend=" AND " property="contractName">
contract_name = #contractName#
</isNotEmpty>
<isNotEmpty prepend=" AND " property="contractWorkTxt">
contract_work_txt = #contractWorkTxt#
</isNotEmpty>
<isNotEmpty prepend=" AND " property="projCode">
proj_code = #projCode#
</isNotEmpty>
<isNotEmpty prepend=" AND " property="projName">
proj_name = #projName#
</isNotEmpty>
<isNotEmpty prepend=" AND " property="projType">
proj_type = #projType#
</isNotEmpty>
<isNotEmpty prepend=" AND " property="projStatus">
proj_status = #projStatus#
</isNotEmpty>
<isNotEmpty prepend=" AND " property="approvalStatus">
approval_status = #approvalStatus#
</isNotEmpty>
<isNotEmpty prepend=" AND " property="permissStartDate">
permiss_start_date = #permissStartDate#
</isNotEmpty>
<isNotEmpty prepend=" AND " property="startDate">
start_date = #startDate#
</isNotEmpty>
<isNotEmpty prepend=" AND " property="endDate">
end_date = #endDate#
</isNotEmpty>
<isNotEmpty prepend=" AND " property="accountCode">
account_code = #accountCode#
</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>
-->
<insert id="insert">
INSERT INTO ${hggpSchema}.HGSC001 (id,
company_code, <!-- 公司编码 -->
company_name, <!-- 公司名称 -->
dep_code, <!-- 部门编码 -->
dep_name, <!-- 部门名称 -->
subcontract_code, <!-- 分包商编码 -->
subcontract_name, <!-- 分包商名称 -->
genral_contract_code, <!-- 总包商编码 -->
genral_contract_name, <!-- 总包商名称 -->
party_pm_name, <!-- 甲方项目经理名称 -->
party_pm_hpone, <!-- 甲方项目经理联系电话 -->
contract_name, <!-- 合同名称 -->
contract_work_txt, <!-- 合同工作量 -->
proj_code, <!-- 项目编码 -->
proj_name, <!-- 项目名称 -->
proj_type, <!-- 项目性质 -->
proj_status, <!-- 项目状态 0:在建;1:完工 -->
approval_status, <!-- 审批状态 0:待审;1:审核中;2:已审 -->
permiss_start_date, <!-- 准许开工日期 -->
start_date, <!-- 开工日期 -->
end_date, <!-- 完工日期 -->
account_code, <!-- 帐套 -->
created_by, <!-- 创建人 -->
created_name, <!-- 创建人名称 -->
created_time, <!-- 创建时间 -->
updated_by, <!-- 更新人 -->
updated_name, <!-- 修改人名称 -->
updated_time <!-- 更新时间 -->
)
VALUES (#id#, #companyCode#, #companyName#, #depCode#, #depName#, #subcontractCode#, #subcontractName#, #genralContractCode#, #genralContractName#, #partyPmName#, #partyPmHpone#, #contractName#, #contractWorkTxt#, #projCode#, #projName#, #projType#, #projStatus#, #approvalStatus#, #permissStartDate#, #startDate#, #endDate#, #accountCode#, #createdBy#, #createdName#, #createdTime#, #updatedBy#, #updatedName#, #updatedTime#)
<selectKey resultClass="long" keyProperty="id">
SELECT MAX(ID) AS "id" FROM ${hggpSchema}.HGSC001
</selectKey>
</insert>
<delete id="delete">
DELETE FROM ${hggpSchema}.HGSC001 WHERE
id = #id#
</delete>
<delete id="batch_delete">
DELETE FROM ${hggpSchema}.HGSC001 WHERE
id IN <iterate close=")" open="(" conjunction="," property="ids">#ids[]#</iterate>
</delete>
<update id="update">
UPDATE ${hggpSchema}.HGSC001
SET
company_code = #companyCode#, <!-- 公司编码 -->
company_name = #companyName#, <!-- 公司名称 -->
dep_code = #depCode#, <!-- 部门编码 -->
dep_name = #depName#, <!-- 部门名称 -->
subcontract_code = #subcontractCode#, <!-- 分包商编码 -->
subcontract_name = #subcontractName#, <!-- 分包商名称 -->
genral_contract_code = #genralContractCode#, <!-- 总包商编码 -->
genral_contract_name = #genralContractName#, <!-- 总包商名称 -->
party_pm_name = #partyPmName#, <!-- 甲方项目经理名称 -->
party_pm_hpone = #partyPmHpone#, <!-- 甲方项目经理联系电话 -->
contract_name = #contractName#, <!-- 合同名称 -->
contract_work_txt = #contractWorkTxt#, <!-- 合同工作量 -->
proj_code = #projCode#, <!-- 项目编码 -->
proj_name = #projName#, <!-- 项目名称 -->
proj_type = #projType#, <!-- 项目性质 -->
proj_status = #projStatus#, <!-- 项目状态 0:在建;1:完工 -->
approval_status = #approvalStatus#, <!-- 审批状态 0:待审;1:审核中;2:已审 -->
permiss_start_date = #permissStartDate#, <!-- 准许开工日期 -->
start_date = #startDate#, <!-- 开工日期 -->
end_date = #endDate#, <!-- 完工日期 -->
account_code = #accountCode#, <!-- 帐套 -->
created_by = #createdBy#, <!-- 创建人 -->
created_name = #createdName#, <!-- 创建人名称 -->
created_time = #createdTime#, <!-- 创建时间 -->
updated_by = #updatedBy#, <!-- 更新人 -->
updated_name = #updatedName#, <!-- 修改人名称 -->
updated_time = #updatedTime# <!-- 更新时间 -->
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-09 14:45:44
Version : 1.0
schema : hggp
tableName : HGSC001A
id BIGINT NOT NULL primarykey,
proj_id BIGINT NOT NULL,
user_code VARCHAR,
user_name VARCHAR,
user_phone VARCHAR,
user_dep_code VARCHAR,
user_dep_name VARCHAR,
dep_code VARCHAR,
dep_name VARCHAR,
account_code VARCHAR NOT NULL,
created_by VARCHAR,
created_name VARCHAR,
created_time VARCHAR,
updated_by VARCHAR,
updated_name VARCHAR,
updated_time VARCHAR
-->
<sqlMap namespace="HGSC001A">
<sql id="condition">
<isNotEmpty prepend=" AND " property="id">
id = #id#
</isNotEmpty>
<isNotEmpty prepend=" AND " property="projId">
proj_id = #projId#
</isNotEmpty>
<isNotEmpty prepend=" AND " property="userCode">
user_code = #userCode#
</isNotEmpty>
<isNotEmpty prepend=" AND " property="userName">
user_name = #userName#
</isNotEmpty>
<isNotEmpty prepend=" AND " property="userPhone">
user_phone = #userPhone#
</isNotEmpty>
<isNotEmpty prepend=" AND " property="userDepCode">
user_dep_code = #userDepCode#
</isNotEmpty>
<isNotEmpty prepend=" AND " property="userDepName">
user_dep_name = #userDepName#
</isNotEmpty>
<isNotEmpty prepend=" AND " property="depCode">
dep_code = #depCode#
</isNotEmpty>
<isNotEmpty prepend=" AND " property="depName">
dep_name = #depName#
</isNotEmpty>
<isNotEmpty prepend=" AND " property="accountCode">
account_code = #accountCode#
</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>
</sql>
<select id="query" parameterClass="java.util.HashMap"
resultClass="com.baosight.hggp.hg.sc.domain.HGSC001A">
SELECT
id as "id",
proj_id as "projId", <!-- 项目ID -->
user_code as "userCode", <!-- 用户编码 -->
user_name as "userName", <!-- 用户名称 -->
user_phone as "userPhone", <!-- 用户手机号 -->
user_dep_code as "userDepCode", <!-- 部门编码 -->
user_dep_name as "userDepName", <!-- 部门名称 -->
dep_code as "depCode", <!-- 部门编码 -->
dep_name as "depName", <!-- 部门名称 -->
account_code as "accountCode", <!-- 帐套 -->
created_by as "createdBy", <!-- 创建人 -->
created_name as "createdName", <!-- 创建人名称 -->
created_time as "createdTime", <!-- 创建时间 -->
updated_by as "updatedBy", <!-- 更新人 -->
updated_name as "updatedName", <!-- 修改人名称 -->
updated_time as "updatedTime" <!-- 更新时间 -->
FROM ${hggpSchema}.HGSC001A WHERE 1=1
<include refid="condition" />
<dynamic prepend="ORDER BY">
<isNotEmpty property="orderBy">
$orderBy$
</isNotEmpty>
<isEmpty property="orderBy">
id asc
</isEmpty>
</dynamic>
</select>
<select id="count" resultClass="int">
SELECT COUNT(*) FROM ${hggpSchema}.HGSC001A WHERE 1=1
<include refid="condition" />
</select>
<!--
<isNotEmpty prepend=" AND " property="id">
id = #id#
</isNotEmpty>
<isNotEmpty prepend=" AND " property="projId">
proj_id = #projId#
</isNotEmpty>
<isNotEmpty prepend=" AND " property="userCode">
user_code = #userCode#
</isNotEmpty>
<isNotEmpty prepend=" AND " property="userName">
user_name = #userName#
</isNotEmpty>
<isNotEmpty prepend=" AND " property="userPhone">
user_phone = #userPhone#
</isNotEmpty>
<isNotEmpty prepend=" AND " property="userDepCode">
user_dep_code = #userDepCode#
</isNotEmpty>
<isNotEmpty prepend=" AND " property="userDepName">
user_dep_name = #userDepName#
</isNotEmpty>
<isNotEmpty prepend=" AND " property="depCode">
dep_code = #depCode#
</isNotEmpty>
<isNotEmpty prepend=" AND " property="depName">
dep_name = #depName#
</isNotEmpty>
<isNotEmpty prepend=" AND " property="accountCode">
account_code = #accountCode#
</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>
-->
<insert id="insert">
INSERT INTO ${hggpSchema}.HGSC001A (id,
proj_id, <!-- 项目ID -->
user_code, <!-- 用户编码 -->
user_name, <!-- 用户名称 -->
user_phone, <!-- 用户手机号 -->
user_dep_code, <!-- 部门编码 -->
user_dep_name, <!-- 部门名称 -->
dep_code, <!-- 部门编码 -->
dep_name, <!-- 部门名称 -->
account_code, <!-- 帐套 -->
created_by, <!-- 创建人 -->
created_name, <!-- 创建人名称 -->
created_time, <!-- 创建时间 -->
updated_by, <!-- 更新人 -->
updated_name, <!-- 修改人名称 -->
updated_time <!-- 更新时间 -->
)
VALUES (#id#, #projId#, #userCode#, #userName#, #userPhone#, #userDepCode#, #userDepName#, #depCode#, #depName#, #accountCode#, #createdBy#, #createdName#, #createdTime#, #updatedBy#, #updatedName#, #updatedTime#)
</insert>
<delete id="delete">
DELETE FROM ${hggpSchema}.HGSC001A WHERE
id = #id#
</delete>
<delete id="deleteByProjId">
DELETE FROM ${hggpSchema}.HGSC001A WHERE
proj_id = #projId#
</delete>
<delete id="deleteByProjIds">
DELETE FROM ${hggpSchema}.HGSC001A WHERE
proj_id IN <iterate close=")" open="(" conjunction="," property="projIds">#projIds[]#</iterate>
</delete>
<update id="update">
UPDATE ${hggpSchema}.HGSC001A
SET
proj_id = #projId#, <!-- 项目ID -->
user_code = #userCode#, <!-- 用户编码 -->
user_name = #userName#, <!-- 用户名称 -->
user_phone = #userPhone#, <!-- 用户手机号 -->
user_dep_code = #userDepCode#, <!-- 部门编码 -->
user_dep_name = #userDepName#, <!-- 部门名称 -->
dep_code = #depCode#, <!-- 部门编码 -->
dep_name = #depName#, <!-- 部门名称 -->
account_code = #accountCode#, <!-- 帐套 -->
created_by = #createdBy#, <!-- 创建人 -->
created_name = #createdName#, <!-- 创建人名称 -->
created_time = #createdTime#, <!-- 创建时间 -->
updated_by = #updatedBy#, <!-- 更新人 -->
updated_name = #updatedName#, <!-- 修改人名称 -->
updated_time = #updatedTime# <!-- 更新时间 -->
WHERE
id = #id#
</update>
</sqlMap>
package com.baosight.hggp.hg.sc.tools;
import com.baosight.hggp.core.dao.DaoBase;
import com.baosight.hggp.core.dao.DaoUtils;
import com.baosight.hggp.hg.sc.domain.HGSC001A;
import com.baosight.hggp.util.AssertUtils;
import com.baosight.hggp.util.ListUtils;
import org.apache.commons.collections.CollectionUtils;
import java.util.*;
/**
* @Author wwl
* @Date 2024/5/7 16:17
*/
public class HGSCTools {
public static class THGSC001A{
/**
* 通过项目ID查询项目负责人*
* @param projId
* @return
*/
public static List<HGSC001A> getByProjId(Long projId){
AssertUtils.isNull(projId, "项目ID不能为空!");
Map paramMap = new HashMap();
paramMap.put(HGSC001A.FIELD_proj_id, projId);
List<HGSC001A> results = DaoBase.getInstance().query(HGSC001A.QUERY, paramMap);
return CollectionUtils.isEmpty(results) ? null : results;
}
public static List<HGSC001A> convertToObj(List<Map> resultRows){
List<HGSC001A> objList= new ArrayList<>();
for (Map resultRow : resultRows) {
HGSC001A hgsc001A = new HGSC001A();
hgsc001A.fromMap(resultRow);
objList.add(hgsc001A);
}
return objList;
}
/**
* 校验保存的数据
*
* @param objList
*/
public static void checkProjMgData(List<HGSC001A> objList) {
AssertUtils.isEmpty(objList, "项目负责人不能为空!");
AssertUtils.isTrue(ListUtils.allSameProperty(objList,HGSC001A::getUserCode), "项目负责人重复!");
}
public static List<HGSC001A> save(List<HGSC001A> hgsc001AList, Long projId){
if(CollectionUtils.isNotEmpty(hgsc001AList)&&Objects.nonNull(projId)) {
//删除历史数据
DaoUtils.update(HGSC001A.DELETE_BY_PROJID, projId);
hgsc001AList.forEach(obj -> {
obj.setProjId(projId);
DaoUtils.insert(HGSC001A.INSERT,obj);
});
}
return hgsc001AList;
}
public static void deleteByProIds(List<Long> projIds){
if(CollectionUtils.isNotEmpty(projIds)) {
//删除历史数据
DaoUtils.update(HGSC001A.DELETE_BY_PROJIDS, new HashMap<String,Object>(){{put("proIds",projIds);}});
}
}
}
}
...@@ -268,4 +268,20 @@ public class CommonMethod { ...@@ -268,4 +268,20 @@ public class CommonMethod {
} }
return eiMetadata; return eiMetadata;
} }
public static void comboBoxDefaultValue(EiInfo inInfo, String blockId) {
comboBoxDefaultValue(inInfo,blockId,HGConstants.VALUE_FIELD,HGConstants.TEXT_FIELD);
}
public static void comboBoxDefaultValue(EiInfo inInfo, String blockId, String valueFieldName, String textFieldName) {
List rows = inInfo.getBlock(blockId).getRows();
List newRows = new ArrayList(){{
add(new HashMap<String,Object>(){{
put(valueFieldName,"");
put(textFieldName,"-- 请选择 --");
}});
}};
newRows.addAll(rows);
inInfo.getBlock(blockId).setRows(newRows);
}
} }
package com.baosight.hggp.util;
import java.util.List;
import java.util.Objects;
import java.util.function.Function;
/**
* @Author wwl
* @Date 2024/5/10 10:11
*/
public class ListUtils {
public static <T> boolean allSameProperty(List<T> list, Function<T, ?> propertyExtractor) {
if (list == null || list.isEmpty()) {
return true;
}
Object firstValue = propertyExtractor.apply(list.get(0));
return list.stream().allMatch(item -> Objects.equals(firstValue, propertyExtractor.apply(item)));
}
}
$(function () {
var projTypeList = __eiInfo.getBlock("proj_type_block_id").getMappedRows();
$("#QUERY").on("click", function () {
resultGrid.dataSource.page(1);
});
IPLATUI.EFGrid.result = {
pageable: {
pageSize: 20,
pageSizes: [10, 20, 50, 70, 100],
},
columns: [
{
field: "projType",
template: function (item) {
let template = "";
if(item.projType&&projTypeList&&projTypeList.length>0){
var projTypes = item.projType.split(",");
for(let i=0;i<projTypes.length;i++){
for(let j=0;j<projTypeList.length;j++){
if(projTypes[i] === projTypeList[j]['valueField']){
if(template === ""){
template = projTypeList[j]['textField']
}else{
template += projTypeList[j]['textField']
}
}
}
}
}
return template;
}
},
{
field: "operator",
template: function (item) {
let template = '<a style="cursor: pointer;display: inline-flex;justify-content: center;margin:auto 5px" ' +
'onclick="showInfo(' + item.id + ')" >立项详情</a>';
return template;
}
}
],
loadComplete: function(grid){
// 新增
$("#add").click(create);
//修改
$("#BNT_UPDATE").on("click", update);
},
onAdd: function(e) {
e.preventDefault();
},
onSuccess: function (e) {
if(e.eiInfo.extAttr.methodName == 'save'||e.eiInfo.extAttr.methodName == 'delete' ){
query();
}
},
onAdd: function (e) {
e.preventDefault();
create();
}
}
});
function showInfo(id) {
JSColorbox.open({
href: "HGSC001D?inqu_status-0-id=" + id + "&efParentFormEname=HGSC001",
title: "<div style='text-align: center;'>查看项目</div>",
width: "90%",
height: "90%",
callbackName: windowCallback
});}
function create() {
JSColorbox.open({
href: "HGSC001C?methodName=initLoad&efParentFormEname=HGSC001",
title: "<div style='text-align: center;'>新增项目</div>",
width: "90%",
height: "90%",
callbackName: windowCallback
});
}
function update() {
let rows = resultGrid.getCheckedRows()
if (rows.length < 1||rows.length > 1) {
message("请选择一条需要修改的数据");
return;
}
let id = rows[0].id;
JSColorbox.open({
href: "HGSC001U??methodName=initLoad&inqu_status-0-id=" + id + "&efParentFormEname=HGSC001",
title: "<div style='text-align: center;'>修改项目</div>",
width: "90%",
height: "90%",
callbackName: windowCallback
});}
function windowCallback() {
// 刷新列表
resultGrid.dataSource.page(1);
// 关闭弹窗
JSColorbox.close();
}
<!DOCTYPE html>
<%@ page contentType="text/html; charset=UTF-8" %>
<%@ 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}"/>
<script>
var ctx = "${ctx}";
</script>
<head>
</head>
<EF:EFPage title="项目立项">
<EF:EFRegion id="inqu" title="查询条件">
<div class="row">
<EF:EFInput ename="inqu_status-0-companyName" cname="公司名称" colWidth="3"/>
<EF:EFInput ename="inqu_status-0-subcontractName" cname="分包方" colWidth="3"/>
<EF:EFInput ename="inqu_status-0-genralContractName" cname="总包方" colWidth="3"/>
<EF:EFInput ename="inqu_status-0-projName" cname="项目名称" colWidth="3"/>
<EF:EFSelect cname="项目性质" ename="inqu_status-0-projType" colWidth="3" filter="contains">
<EF:EFOption label="全部" value=""/>
<EF:EFOptions blockId="proj_type_block_id" valueField="valueField" textField="textField"/>
</EF:EFSelect>
<EF:EFSelect cname="提交状态" ename="inqu_status-0-approvalStatus" colWidth="3" filter="contains">
<EF:EFOption label="全部" value=""/>
<EF:EFCodeOption codeName="hggp.commitStatus" />
</EF:EFSelect>
<EF:EFSelect cname="项目状态" ename="inqu_status-0-projStatus" colWidth="3" filter="contains">
<EF:EFOption label="全部" value=""/>
<EF:EFCodeOption codeName="hggp.projStatus" />
</EF:EFSelect>
</div>
</EF:EFRegion>
<EF:EFRegion id="result" title="记录集">
<EF:EFGrid blockId="result" autoDraw="no" isFloat="true">
<EF:EFColumn ename="id" cname="主键" hidden="true"/>
<EF:EFColumn ename="operator" cname="操作" locked="true" enable="false" width="100" align="center"/>
<EF:EFColumn ename="companyName" cname="公司名称" enable="false" width="120" align="center"/>
<EF:EFColumn ename="projCode" cname="项目编码" enable="false" width="120" align="center"/>
<EF:EFColumn ename="projName" cname="项目名称" enable="false" width="120" align="center"/>
<EF:EFColumn ename="subcontractName" cname="分包方" enable="false" width="120" align="center"/>
<EF:EFColumn ename="genralContractName" cname="总包方" enable="false" width="120" align="center"/>
<EF:EFColumn ename="projType" cname="项目性质" enable="false" width="120" align="center"/>
<EF:EFColumn ename="permissStartDate" cname="准许开工日期" enable="false" width="120" align="center"/>
<EF:EFColumn ename="startDate" cname="开工日期" enable="false" width="120" align="center"/>
<EF:EFColumn ename="endDate" cname="完工日期" enable="false" width="120" align="center"/>
<EF:EFComboColumn ename="projStatus" cname="项目状态" width="80" align="center" required="true"
readonly="true">
<EF:EFCodeOption codeName="hggp.projStatus"/>
</EF:EFComboColumn>
<EF:EFComboColumn ename="approvalStatus" cname="提交状态" width="80" align="center" required="true"
readonly="true">
<EF:EFCodeOption codeName="hggp.commitStatus"/>
</EF:EFComboColumn>
</EF:EFGrid>
</EF:EFRegion>
</EF:EFPage>
$(function () {
var userByCompany ;//= __eiInfo.getBlock("userByCompany").getMappedRows();
IPLATUI.EFGrid.detail = {
pageable: {
pageSize: 20,
pageSizes: [10, 20, 50, 70, 100],
},
columns: [{
field: "userCode",
template: function (dataItem) {
for (let i = 0; i < userByCompany.length; i++) {
if (userByCompany[i]['loginName'] === dataItem['userCode']) {
dataItem['userName'] = userByCompany[i]['userName'];
dataItem['userPhone'] = userByCompany[i]['mobile'];
dataItem['userDepCode'] = userByCompany[i]['depCode'];
dataItem['userDepName'] = userByCompany[i]['depName'];
return userByCompany[i]['userName'];
}
}
return dataItem["userName"];
},
editor: function (container, options) {
var input = $('<input />');
input.attr("name", options.field);
input.attr("id", options.field);
input.appendTo(container);
input.kendoDropDownList({
dataSource: userByCompany,
minLength: 0,
dataTextField: "userName",
dataValueField: "loginName",
optionLabelTemplate: "[#:loginName#]#:userName#-#:depName#",
valueTemplate: "[#:loginName#]#:userName#-#:depName#",
template: "[#:loginName#]#:userName#-#:depName#",
filter: "contains"
});
}
}],
loadComplete: function(grid) {
// 此 grid 对象
// 处理父子级联动,通过监听 change 事件,判断父级节点是否发生变化
grid.dataSource.bind("change", function(e) {
// 判断父级节点是否发生变化
if (e.field == "userCode") {
loadChange(grid,e,"userName");
loadChange(grid,e,"userPhone");
loadChange(grid,e,"userDepCode");
loadChange(grid,e,"userDepName");
}
});
},
onAdd: function(e) {
if(!userByCompany){
message("请选择分包方!");
e.preventDefault();
return;
}
},
onSuccess: function (e) {
if(e.eiInfo.extAttr.methodName == 'save'||e.eiInfo.extAttr.methodName == 'delete' ){
query();
}
}
}
$("#result-0-companyCode").change(function () {
let textField = IPLAT.EFSelect.text($("#result-0-companyCode"));
$("#result-0-companyName").val(textField);
})
$("#result-0-depCode").change(function () {
let textField = IPLAT.EFSelect.text($("#result-0-depCode"));
$("#result-0-depName").val(textField);
});
$("#result-0-subcontractCode").change(function () {
let textField = IPLAT.EFSelect.text($("#result-0-subcontractCode"));
$("#result-0-subcontractName").val(textField);
loadProjMg(IPLAT.EFSelect.value($("#result-0-subcontractCode")));
});
$("#result-0-genralContractCode").change(function () {
let textField = IPLAT.EFSelect.text($("#result-0-genralContractCode"));
$("#result-0-genralContractName").val(textField);
});
/**
* 加载项目负责人选项数据*
* @param companyCode
*/
function loadProjMg(companyCode){
var inInfo=new EiInfo();
inInfo.set("inqu_status-0-companyCode",companyCode);
EiCommunicator.send("HGSC001", "userByCompanyComboBox", inInfo, {
onSuccess: function (ei) {
var input=$("#inqu_status-0-groupCode");
userByCompany=ei.getBlock("userByCompany").getMappedRows();
}, onFail: function (ei) {
}
}, {async: false});
}
/**
* 取消
*/
$('#cancel').on('click', function () {
// 关闭弹窗
parent.JSColorbox.close();
})
/**
* 保存*
*/
$("#btn_save").on("click",function(){
JSUtils.confirm("确定对数据做\"保存\"操作? ", {
ok: function () {
JSUtils.submitGrid("detail", "HGSC001", "save", {isAlldata:true,onSuccessCallback:saveCallback});
}
});
});
var saveCallback = function(ei){
if (ei.getStatus() >= 0) {
parent.JSColorbox.close();
}
}
});
<!DOCTYPE html>
<%@ page contentType="text/html; charset=UTF-8" %>
<%@ 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 ename="result-0-companyName" cname="公司名称" type="hidden"/>
<EF:EFSelect cname="公司" ename="result-0-companyCode" colWidth="4" required="true" filter="contains">
<EF:EFOption label="-- 请选择 --" value="" />
<EF:EFOptions blockId="roleCompany" valueField="companyCode" textField="companyName"/>
</EF:EFSelect>
<EF:EFInput ename="result-0-depName" cname="部门名称" type="hidden"/>
<EF:EFCascadeSelect cascadeFrom="result-0-companyCode" cname="部门" ename="result-0-depCode"
colWidth="4" required="true" filter="contains" defaultValue=""
serviceName="HGSC001" methodName="depByCompanyComboBox" resultId="depByCompany"
textField="depName" valueField="depCode" >
</EF:EFCascadeSelect>
</div>
<div class="row">
<EF:EFInput ename="result-0-subcontractName" cname="分包方名称" type="hidden"/>
<EF:EFSelect cname="分包方" ename="result-0-subcontractCode" colWidth="4" required="true" filter="contains">
<EF:EFOption label="-- 请选择 --" value="" />
<EF:EFOptions blockId="roleCompany" valueField="companyCode" textField="companyName"/>
</EF:EFSelect>
<EF:EFInput ename="result-0-genralContractName" cname="总包方名称" type="hidden"/>
<EF:EFCascadeSelect cascadeFrom="result-0-subcontractCode" cname="总包方" ename="result-0-genralContractCode"
colWidth="4" required="true" filter="contains" defaultValue=""
serviceName="HGSC001" methodName="genralContractComboBox" resultId="customer_record_block_id"
textField="textField" valueField="valueField" >
</EF:EFCascadeSelect>
<EF:EFInput ename="result-0-projCode" cname="项目编号" colWidth="4" required="true" readonly="true"/>
</div>
<div class="row">
<EF:EFInput ename="result-0-projName" cname="项目名称" colWidth="4" required="true" readonly="false"/>
<EF:EFInput ename="result-0-contractName" cname="合同名称" colWidth="4" required="true" readonly="false"/>
<EF:EFMultiSelect ename="result-0-projType" cname="项目性质"
colWidth="4" required="true" readonly="false">
<EF:EFOptions blockId="proj_type_block_id" textField="textField"
valueField="valueField"/>
</EF:EFMultiSelect>
</div>
<div class="row">
<EF:EFDatePicker cname="准许开工日期" ename="result-0-permissStartDate" colWidth="4"
format="yyyy-MM-dd" required="true" readonly="false"/>
<EF:EFDatePicker cname="开工日期" ename="result-0-startDate" colWidth="4"
format="yyyy-MM-dd" required="true" readonly="false"/>
<EF:EFDatePicker cname="完工日期" ename="result-0-endDate" colWidth="4"
format="yyyy-MM-dd" required="true" readonly="false"/>
</div>
<div class="row">
<EF:EFSelect cname="项目状态" ename="result-0-projStatus" colWidth="4" filter="contains" required="true" readonly="false">
<EF:EFCodeOption codeName="hggp.projStatus" />
</EF:EFSelect>
<EF:EFInput ename="result-0-partyPmName" cname="甲方项目经理名称" colWidth="4" readonly="false"/>
<EF:EFInput ename="result-0-partyPmHpone" cname="甲方项目经理电话" colWidth="4" readonly="false"/>
</div>
<div class="row">
<EF:EFInput ename="result-0-contractWorkTxt" cname="合同工作量" type="textarea" colWidth="8" ratio="2:8" required="true" readonly="false"/>
</div>
</EF:EFRegion>
<EF:EFRegion id="detail" title="部门负责人信息">
<EF:EFGrid blockId="detail" autoDraw="no" isFloat="true">
<EF:EFColumn ename="id" cname="主键" hidden="true"/>
<EF:EFColumn ename="userName" cname="负责人名称" required="true" hidden="true"/>
<EF:EFColumn ename="userDepCode" cname="负责人部门编码" required="true" hidden="true"/>
<EF:EFColumn ename="userCode" cname="负责人名称" required="true" align="center"/>
<%-- <EF:EFComboColumn ename="userCode" cname="负责人名称"--%>
<%-- columnTemplate="#=userName#" itemTemplate="[#=loginName#]#=userName#-#=depName#"--%>
<%-- textField="userName" valueField="loginName"--%>
<%-- maxLength="16" readonly="true" width="160" required="true"--%>
<%-- align="center" filter="contains" sort="true">--%>
<%-- <EF:EFOptions blockId="userByCompany" textField="userName" valueField="loginName"/>--%>
<%-- </EF:EFComboColumn>--%>
<EF:EFColumn ename="userDepName" cname="所属部门" required="true" enable="false" align="center"/>
<EF:EFColumn ename="userPhone" cname="电话" required="true" enable="false" align="center"/>
</EF:EFGrid>
</EF:EFRegion>
<div class="row" style="display:flex;justify-content:center;">
<EF:EFButton ename="cancel" cname="取消" type="button" class="btn-center"/>
<EF:EFButton ename="btn_save" cname="保存" type="button" class="btn-center"/>
</div>
</EF:EFPage>
$(function () {
var userByCompany = __eiInfo.getBlock("userByCompany").getMappedRows();
IPLATUI.EFGrid.detail = {
pageable: {
pageSize: 20,
pageSizes: [10, 20, 50, 70, 100],
},
columns: [{
field: "userCode",
template: function (dataItem) {
for (let i = 0; i < userByCompany.length; i++) {
if (userByCompany[i]['loginName'] === dataItem['userCode']) {
dataItem['userName'] = userByCompany[i]['userName'];
dataItem['userPhone'] = userByCompany[i]['mobile'];
dataItem['userDepCode'] = userByCompany[i]['depCode'];
dataItem['userDepName'] = userByCompany[i]['depName'];
return userByCompany[i]['userName'];
}
}
return dataItem["userName"];
},
editor: function (container, options) {
var input = $('<input />');
input.attr("name", options.field);
input.attr("id", options.field);
input.appendTo(container);
input.kendoDropDownList({
dataSource: userByCompany,
minLength: 0,
dataTextField: "userName",
dataValueField: "loginName",
optionLabelTemplate: "[#:loginName#]#:userName#-#:depName#",
valueTemplate: "[#:loginName#]#:userName#-#:depName#",
template: "[#:loginName#]#:userName#-#:depName#",
filter: "contains"
});
}
}],
loadComplete: function(grid) {
// 此 grid 对象
// 处理父子级联动,通过监听 change 事件,判断父级节点是否发生变化
grid.dataSource.bind("change", function(e) {
// 判断父级节点是否发生变化
if (e.field == "userCode") {
loadChange(grid,e,"userName");
loadChange(grid,e,"userPhone");
loadChange(grid,e,"userDepCode");
loadChange(grid,e,"userDepName");
}
});
}
}
$("#result-0-companyCode").change(function () {
let textField = IPLAT.EFSelect.text($("#result-0-companyCode"));
$("#result-0-companyName").val(textField);
})
$("#result-0-depCode").change(function () {
let textField = IPLAT.EFSelect.text($("#result-0-depCode"));
$("#result-0-depName").val(textField);
});
$("#result-0-subcontractCode").change(function () {
let textField = IPLAT.EFSelect.text($("#result-0-subcontractCode"));
$("#result-0-subcontractName").val(textField);
loadProjMg(IPLAT.EFSelect.value($("#result-0-subcontractCode")));
});
$("#result-0-genralContractCode").change(function () {
let textField = IPLAT.EFSelect.text($("#result-0-genralContractCode"));
$("#result-0-genralContractName").val(textField);
});
/**
* 加载项目负责人选项数据*
* @param companyCode
*/
function loadProjMg(companyCode){
var inInfo=new EiInfo();
inInfo.set("inqu_status-0-companyCode",companyCode);
EiCommunicator.send("HGSC001", "userByCompanyComboBox", inInfo, {
onSuccess: function (ei) {
var input=$("#inqu_status-0-groupCode");
userByCompany=ei.getBlock("userByCompany").getMappedRows();
}, onFail: function (ei) {
}
}, {async: false});
}
});
<!DOCTYPE html>
<%@ page contentType="text/html; charset=UTF-8" %>
<%@ 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 ename="result-0-companyName" cname="公司名称" type="hidden"/>
<EF:EFSelect cname="公司" ename="result-0-companyCode" colWidth="4" required="true" filter="contains">
<EF:EFOption label="-- 请选择 --" value="" />
<EF:EFOptions blockId="roleCompany" valueField="companyCode" textField="companyName"/>
</EF:EFSelect>
<EF:EFInput ename="result-0-depName" cname="部门名称" type="hidden"/>
<EF:EFCascadeSelect cascadeFrom="result-0-companyCode" cname="部门" ename="result-0-depCode"
colWidth="4" required="true" filter="contains" defaultValue=""
serviceName="HGSC001" methodName="depByCompanyComboBox" resultId="depByCompany"
textField="depName" valueField="depCode" >
</EF:EFCascadeSelect>
</div>
<div class="row">
<EF:EFInput ename="result-0-subcontractName" cname="分包方名称" type="hidden"/>
<EF:EFSelect cname="分包方" ename="result-0-subcontractCode" colWidth="4" required="true" filter="contains">
<EF:EFOption label="-- 请选择 --" value="" />
<EF:EFOptions blockId="roleCompany" valueField="companyCode" textField="companyName"/>
</EF:EFSelect>
<EF:EFInput ename="result-0-genralContractName" cname="总包方名称" type="hidden"/>
<EF:EFCascadeSelect cascadeFrom="result-0-subcontractCode" cname="总包方" ename="result-0-genralContractCode"
colWidth="4" required="true" filter="contains" defaultValue=""
serviceName="HGSC001" methodName="genralContractComboBox" resultId="customer_record_block_id"
textField="textField" valueField="valueField" >
</EF:EFCascadeSelect>
<EF:EFInput ename="result-0-projCode" cname="项目编号" colWidth="4" required="true" readonly="true"/>
</div>
<div class="row">
<EF:EFInput ename="result-0-projName" cname="项目名称" colWidth="4" required="true" readonly="true"/>
<EF:EFInput ename="result-0-contractName" cname="合同名称" colWidth="4" required="true" readonly="true"/>
<EF:EFMultiSelect ename="result-0-projType" cname="项目性质"
colWidth="4" required="true" readonly="true">
<EF:EFOptions blockId="proj_type_block_id" textField="textField"
valueField="valueField"/>
</EF:EFMultiSelect>
</div>
<div class="row">
<EF:EFDatePicker cname="准许开工日期" ename="result-0-permissStartDate" colWidth="4"
format="yyyy-MM-dd" required="true" readonly="true"/>
<EF:EFDatePicker cname="开工日期" ename="result-0-startDate" colWidth="4"
format="yyyy-MM-dd" required="true" readonly="true"/>
<EF:EFDatePicker cname="完工日期" ename="result-0-endDate" colWidth="4"
format="yyyy-MM-dd" required="true" readonly="true"/>
</div>
<div class="row">
<EF:EFSelect cname="项目状态" ename="result-0-projStatus" colWidth="4" filter="contains" required="true" readonly="true">
<EF:EFCodeOption codeName="hggp.projStatus" />
</EF:EFSelect>
<EF:EFInput ename="result-0-partyPmName" cname="甲方项目经理名称" colWidth="4" readonly="true"/>
<EF:EFInput ename="result-0-partyPmHpone" cname="甲方项目经理电话" colWidth="4" readonly="true"/>
</div>
<div class="row">
<EF:EFInput ename="result-0-contractWorkTxt" cname="合同工作量" type="textarea" colWidth="8" ratio="2:8" required="true" readonly="true"/>
</div>
</EF:EFRegion>
<EF:EFRegion id="detail" title="部门负责人信息">
<EF:EFGrid blockId="detail" autoDraw="no" isFloat="true">
<EF:EFColumn ename="id" cname="主键" hidden="true"/>
<EF:EFColumn ename="userName" cname="负责人名称" required="true" hidden="true"/>
<EF:EFColumn ename="userDepCode" cname="负责人部门编码" required="true" hidden="true"/>
<EF:EFColumn ename="userCode" cname="负责人名称" required="true" align="center"/>
<%-- <EF:EFComboColumn ename="userCode" cname="负责人名称"--%>
<%-- columnTemplate="#=userName#" itemTemplate="[#=loginName#]#=userName#-#=depName#"--%>
<%-- textField="userName" valueField="loginName"--%>
<%-- maxLength="16" readonly="true" width="160" required="true"--%>
<%-- align="center" filter="contains" sort="true">--%>
<%-- <EF:EFOptions blockId="userByCompany" textField="userName" valueField="loginName"/>--%>
<%-- </EF:EFComboColumn>--%>
<EF:EFColumn ename="userDepName" cname="所属部门" required="true" enable="false" align="center"/>
<EF:EFColumn ename="userPhone" cname="电话" required="true" enable="false" align="center"/>
</EF:EFGrid>
</EF:EFRegion>
</EF:EFPage>
$(function () {
var userByCompany = __eiInfo.getBlock("userByCompany").getMappedRows();
IPLATUI.EFGrid.detail = {
pageable: {
pageSize: 20,
pageSizes: [10, 20, 50, 70, 100],
},
columns: [{
field: "userCode",
template: function (dataItem) {
for (let i = 0; i < userByCompany.length; i++) {
if (userByCompany[i]['loginName'] === dataItem['userCode']) {
dataItem['userName'] = userByCompany[i]['userName'];
dataItem['userPhone'] = userByCompany[i]['mobile'];
dataItem['userDepCode'] = userByCompany[i]['depCode'];
dataItem['userDepName'] = userByCompany[i]['depName'];
return userByCompany[i]['userName'];
}
}
return dataItem["userName"];
},
editor: function (container, options) {
var input = $('<input />');
input.attr("name", options.field);
input.attr("id", options.field);
input.appendTo(container);
input.kendoDropDownList({
dataSource: userByCompany,
minLength: 0,
dataTextField: "userName",
dataValueField: "loginName",
optionLabelTemplate: "[#:loginName#]#:userName#-#:depName#",
valueTemplate: "[#:loginName#]#:userName#-#:depName#",
template: "[#:loginName#]#:userName#-#:depName#",
filter: "contains"
});
}
}],
loadComplete: function(grid) {
// 此 grid 对象
// 处理父子级联动,通过监听 change 事件,判断父级节点是否发生变化
grid.dataSource.bind("change", function(e) {
// 判断父级节点是否发生变化
if (e.field == "userCode") {
loadChange(grid,e,"userName");
loadChange(grid,e,"userPhone");
loadChange(grid,e,"userDepCode");
loadChange(grid,e,"userDepName");
}
});
},
onAdd: function(e) {
if(!userByCompany){
message("请选择分包方!");
e.preventDefault();
return;
}
},
onSuccess: function (e) {
if(e.eiInfo.extAttr.methodName == 'save'||e.eiInfo.extAttr.methodName == 'delete' ){
query();
}
}
}
$("#result-0-companyCode").change(function () {
let textField = IPLAT.EFSelect.text($("#result-0-companyCode"));
$("#result-0-companyName").val(textField);
})
$("#result-0-depCode").change(function () {
let textField = IPLAT.EFSelect.text($("#result-0-depCode"));
$("#result-0-depName").val(textField);
});
$("#result-0-subcontractCode").change(function () {
let textField = IPLAT.EFSelect.text($("#result-0-subcontractCode"));
$("#result-0-subcontractName").val(textField);
loadProjMg(IPLAT.EFSelect.value($("#result-0-subcontractCode")));
});
$("#result-0-genralContractCode").change(function () {
let textField = IPLAT.EFSelect.text($("#result-0-genralContractCode"));
$("#result-0-genralContractName").val(textField);
});
/**
* 加载项目负责人选项数据*
* @param companyCode
*/
function loadProjMg(companyCode){
var inInfo=new EiInfo();
inInfo.set("inqu_status-0-companyCode",companyCode);
EiCommunicator.send("HGSC001", "userByCompanyComboBox", inInfo, {
onSuccess: function (ei) {
var input=$("#inqu_status-0-groupCode");
userByCompany=ei.getBlock("userByCompany").getMappedRows();
}, onFail: function (ei) {
}
}, {async: false});
}
/**
* 取消
*/
$('#cancel').on('click', function () {
// 关闭弹窗
parent.JSColorbox.close();
})
/**
* 保存*
*/
$("#btn_save").on("click",function(){
JSUtils.confirm("确定对数据做\"保存\"操作? ", {
ok: function () {
JSUtils.submitGrid("detail", "HGSC001", "save", {isAlldata:true,onSuccessCallback:saveCallback});
}
});
});
var saveCallback = function(ei){
if (ei.getStatus() >= 0) {
parent.JSColorbox.close();
}
}
});
<!DOCTYPE html>
<%@ page contentType="text/html; charset=UTF-8" %>
<%@ 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 ename="result-0-companyName" cname="公司名称" type="hidden"/>
<EF:EFSelect cname="公司" ename="result-0-companyCode" colWidth="4" required="true" filter="contains">
<EF:EFOption label="-- 请选择 --" value="" />
<EF:EFOptions blockId="roleCompany" valueField="companyCode" textField="companyName"/>
</EF:EFSelect>
<EF:EFInput ename="result-0-depName" cname="部门名称" type="hidden"/>
<EF:EFCascadeSelect cascadeFrom="result-0-companyCode" cname="部门" ename="result-0-depCode"
colWidth="4" required="true" filter="contains" defaultValue=""
serviceName="HGSC001" methodName="depByCompanyComboBox" resultId="depByCompany"
textField="depName" valueField="depCode" >
</EF:EFCascadeSelect>
</div>
<div class="row">
<EF:EFInput ename="result-0-subcontractName" cname="分包方名称" type="hidden"/>
<EF:EFSelect cname="分包方" ename="result-0-subcontractCode" colWidth="4" required="true" filter="contains">
<EF:EFOption label="-- 请选择 --" value="" />
<EF:EFOptions blockId="roleCompany" valueField="companyCode" textField="companyName"/>
</EF:EFSelect>
<EF:EFInput ename="result-0-genralContractName" cname="总包方名称" type="hidden"/>
<EF:EFCascadeSelect cascadeFrom="result-0-subcontractCode" cname="总包方" ename="result-0-genralContractCode"
colWidth="4" required="true" filter="contains" defaultValue=""
serviceName="HGSC001" methodName="genralContractComboBox" resultId="customer_record_block_id"
textField="textField" valueField="valueField" >
</EF:EFCascadeSelect>
<EF:EFInput ename="result-0-projCode" cname="项目编号" colWidth="4" required="true" readonly="true"/>
</div>
<div class="row">
<EF:EFInput ename="result-0-projName" cname="项目名称" colWidth="4" required="true" readonly="false"/>
<EF:EFInput ename="result-0-contractName" cname="合同名称" colWidth="4" required="true" readonly="false"/>
<EF:EFMultiSelect ename="result-0-projType" cname="项目性质"
colWidth="4" required="true" readonly="false">
<EF:EFOptions blockId="proj_type_block_id" textField="textField"
valueField="valueField"/>
</EF:EFMultiSelect>
</div>
<div class="row">
<EF:EFDatePicker cname="准许开工日期" ename="result-0-permissStartDate" colWidth="4"
format="yyyy-MM-dd" required="true" readonly="false"/>
<EF:EFDatePicker cname="开工日期" ename="result-0-startDate" colWidth="4"
format="yyyy-MM-dd" required="true" readonly="false"/>
<EF:EFDatePicker cname="完工日期" ename="result-0-endDate" colWidth="4"
format="yyyy-MM-dd" required="true" readonly="false"/>
</div>
<div class="row">
<EF:EFSelect cname="项目状态" ename="result-0-projStatus" colWidth="4" filter="contains" required="true" readonly="false">
<EF:EFCodeOption codeName="hggp.projStatus" />
</EF:EFSelect>
<EF:EFInput ename="result-0-partyPmName" cname="甲方项目经理名称" colWidth="4" readonly="false"/>
<EF:EFInput ename="result-0-partyPmHpone" cname="甲方项目经理电话" colWidth="4" readonly="false"/>
</div>
<div class="row">
<EF:EFInput ename="result-0-contractWorkTxt" cname="合同工作量" type="textarea" colWidth="8" ratio="2:8" required="true" readonly="false"/>
</div>
</EF:EFRegion>
<EF:EFRegion id="detail" title="部门负责人信息">
<EF:EFGrid blockId="detail" autoDraw="no" isFloat="true">
<EF:EFColumn ename="id" cname="主键" hidden="true"/>
<EF:EFColumn ename="userName" cname="负责人名称" required="true" hidden="true"/>
<EF:EFColumn ename="userDepCode" cname="负责人部门编码" required="true" hidden="true"/>
<EF:EFColumn ename="userCode" cname="负责人名称" required="true" align="center"/>
<EF:EFColumn ename="userDepName" cname="所属部门" required="true" enable="false" align="center"/>
<EF:EFColumn ename="userPhone" cname="电话" required="true" enable="false" align="center"/>
</EF:EFGrid>
</EF:EFRegion>
<div class="row" style="display:flex;justify-content:center;">
<EF:EFButton ename="cancel" cname="取消" type="button" class="btn-center"/>
<EF:EFButton ename="btn_save" cname="保存" type="button" class="btn-center"/>
</div>
</EF:EFPage>
...@@ -545,4 +545,28 @@ function isExcelFile(uploadFileUrl) { ...@@ -545,4 +545,28 @@ function isExcelFile(uploadFileUrl) {
&& uploadFileUrl.indexOf("xlsx") === -1 && uploadFileUrl.indexOf("xlsx") === -1
&& uploadFileUrl.indexOf("XLS") === -1 && uploadFileUrl.indexOf("XLS") === -1
&& uploadFileUrl.indexOf("XLSX") === -1; && uploadFileUrl.indexOf("XLSX") === -1;
}
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
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