Commit 78029679 by liuyang

Merge branch 'dev' of http://git.pseer.com:8800/platform/hg-smart into dev-ly

parents 5b5b1bd0 f37e2510
......@@ -29,21 +29,21 @@ public enum DdynamicEnum {
* 编写:wwl
*/
PROJ_TYPE_BLOCK_ID("proj_type_block_id", "natCode", "natName", "HGPZ008.queryComboBox"),
/**
* 模块:客户类型
* 用途:客户类型下拉框
* 编写:
*/
CUSTOMER_TYPE_BLOCK_ID("customer_type_block_id", "custType", "custTypeName", "HGPZ001.queryComboBox"),
/**
* 模块:客户档案
* 用途:客户档案下拉框
* 编写:wwl
*/
CUSTOMER_RECORD_BLOCK_ID("customer_record_block_id", "custCode", "custName", "HGPZ002.queryComboBox"),
/**
* 模块:供应商档案
* 用途:供应商档案下拉框
......@@ -73,6 +73,12 @@ public enum DdynamicEnum {
INVENT_RECORD_BLOCK_ID("invent_record_block_id","inventCode","inventName","HGPZ005.queryComboBox"),
/**
* 模块:存货档案
* 用途:存货档案下拉框,带id名称等信息
* 编写:
*/
PRODUCT_BLOCK_ID("product_block_id","inventCode","inventName","id","inventType","HGPZ005.queryProductComboBox"),
/**
* 模块:存货档案(ALL)
* 用途:存货档案下拉框
* 编写:
......@@ -85,37 +91,37 @@ public enum DdynamicEnum {
* 编写:
*/
SPEC_RECORD_BLOCK_ID("spec_record_block_id", "id", "spec", "HGPZ005.queryComboBoxAll"),
/**
* 模块:规格(无ID)
* 用途:存货档案下拉框
* 编写:
*/
SPEC_NAME_BLOCK_ID("spec_name_block_id", "spec", "spec", "HGPZ005.queryComboBoxSpecName"),
/**
* 模块:仓库类型
* 用途:仓库类型下拉框
* 编写:
*/
WH_TYPE_BLOCK_ID("wh_type_block_id", "whType", "whTypeName", "HGPZ006.queryComboBox"),
/**
* 模块:仓库档案
* 用途:仓库档案下拉框
* 编写:
*/
WH_RECORD_BLOCK_ID("wh_record_block_id", "whCode", "whName", "HGPZ007.queryComboBox"),
/**
* 模块:厂区管理
* 用途:厂区管理下拉框
* 编写:songx
*/
FACTORY_RECORD_BLOCK_ID("factory_record_block_id", "orgId", "orgCname", "HGXSOrg.queryFactoryComboBox"),
/**
* 模块:组管理
* 用途:组管理下拉框
......@@ -143,7 +149,7 @@ public enum DdynamicEnum {
* 编写:yk
*/
USER_BLOCK_ID("user_block_id","loginName","userName","HGXSUser.queryComboBox"),
/**
* 模块:系统管理
* 用途:部门
......@@ -153,7 +159,7 @@ public enum DdynamicEnum {
"companyName", "HGXSOrg.queryAll", new HashMap() {{
put("orgType", OrgTypeEnum.DEPT.getCode());
}}),
/**
* 模块:系统管理
* 用途:厂区查询
......@@ -163,7 +169,7 @@ public enum DdynamicEnum {
"companyName", "HGXSOrg.queryAll", new HashMap() {{
put("orgType", OrgTypeEnum.FACTORY.getCode());
}}),
/**
* 模块:系统管理
* 用途:公司查询
......@@ -174,7 +180,7 @@ public enum DdynamicEnum {
put("orgType", OrgTypeEnum.COMPANY.getCode());
}}
),
/**
* 模块:公司名称
* 用途:工序设计下拉框
......@@ -219,6 +225,13 @@ public enum DdynamicEnum {
*/
PROJ_RECORD_BLOCK_ID("proj_record_block_id", "projCode", "projName", "HGSC001.queryComboBox"),
/**
* 模块:蓝图
* 用途:蓝图下拉框
* 编写:jhs
*/
BLUEPRINT_BOX_BLOCK_ID("blueprint_box_block_id", "blueprintCode", "blueprintName", "HGSC003.queryComboBox"),
ITEM_CODE_BOX_BLOCK_ID("item_code_box_block_id", "itemCode", "itemCname", "HGPZ005A.queryEdcm01"),
/**
......@@ -249,7 +262,7 @@ public enum DdynamicEnum {
private String param4;
private String param5;
private String param6;
private String param7;
......@@ -261,7 +274,7 @@ public enum DdynamicEnum {
private final String dbSource;
private Map paramMap;
DdynamicEnum(String blockId, String value, String text, String param1, String dbSource) {
this.blockId = blockId;
this.value = value;
......@@ -278,7 +291,7 @@ public enum DdynamicEnum {
this.param2 = param2;
this.dbSource = dbSource;
}
DdynamicEnum(String blockId, String value, String text, String param1, String param2, String dbSource,
Map paramMap) {
this.blockId = blockId;
......@@ -289,7 +302,7 @@ public enum DdynamicEnum {
this.dbSource = dbSource;
this.paramMap = paramMap;
}
DdynamicEnum(String blockId, String value, String text, String param1, String param2, String param3, String dbSource) {
this.blockId = blockId;
this.value = value;
......@@ -310,7 +323,7 @@ public enum DdynamicEnum {
this.param4 = param4;
this.dbSource = dbSource;
}
DdynamicEnum(String blockId, String value, String text, String param1, String param2, String param3,
String param4, String dbSource, Map paramMap) {
this.blockId = blockId;
......@@ -323,7 +336,7 @@ public enum DdynamicEnum {
this.dbSource = dbSource;
this.paramMap = paramMap;
}
DdynamicEnum(String blockId, String value, String text, String param1, String param2, String param3, String param4, String param5, String dbSource) {
this.blockId = blockId;
this.value = value;
......@@ -335,7 +348,7 @@ public enum DdynamicEnum {
this.param5 = param5;
this.dbSource = dbSource;
}
DdynamicEnum(String blockId, String value, String text, String param1, String param2, String param3, String param4,
String param5, String param6,String dbSource) {
this.blockId = blockId;
......@@ -366,7 +379,7 @@ public enum DdynamicEnum {
this.param9 = param9;
this.dbSource = dbSource;
}
DdynamicEnum(String blockId, String value, String text, String param1, String param2, String param3,
String param4, String param5, String param6, String param7, String param8, String param9,
String dbSource, Map paramMap) {
......@@ -385,14 +398,14 @@ public enum DdynamicEnum {
this.dbSource = dbSource;
this.paramMap = paramMap;
}
DdynamicEnum(String blockId, String value, String text, String dbSource){
this.blockId = blockId;
this.value = value;
this.text = text;
this.dbSource = dbSource;
}
DdynamicEnum(String blockId, String value, String text, String dbSource, Map paramMap) {
this.blockId = blockId;
this.value = value;
......@@ -400,7 +413,7 @@ public enum DdynamicEnum {
this.dbSource = dbSource;
this.paramMap = paramMap;
}
public String getDbSource() {
return dbSource;
}
......@@ -456,11 +469,11 @@ public enum DdynamicEnum {
public void setParam5(String param5) {
this.param5 = param5;
}
public String getParam6() {
return param6;
}
public void setParam6(String param6) {
this.param6 = param6;
}
......@@ -488,7 +501,7 @@ public enum DdynamicEnum {
public void setParam9(String param9) {
this.param9 = param9;
}
public Map getParamMap() {
return paramMap;
}
......
......@@ -12,6 +12,7 @@ import org.apache.commons.collections.CollectionUtils;
import org.apache.commons.collections.MapUtils;
import org.apache.commons.lang.StringUtils;
import java.util.Collection;
import java.util.List;
import java.util.Map;
......@@ -23,7 +24,7 @@ import lombok.extern.slf4j.Slf4j;
*/
@Slf4j
public class DaoUtils {
/**
* count 查询
*
......@@ -36,7 +37,7 @@ public class DaoUtils {
List<Integer> countMaps = DaoBase.getInstance().query(sqlName, paramMap);
return CollectionUtils.isEmpty(countMaps) ? 0 : countMaps.get(0).intValue();
}
/**
* insert method.
*
......@@ -56,7 +57,7 @@ public class DaoUtils {
}
DaoBase.getInstance().insert(sql, obj);
}
/**
* update method.
*
......@@ -71,7 +72,24 @@ public class DaoUtils {
}
return DaoBase.getInstance().update(sql, obj);
}
/**
* update method.
*
* @param sql
* @param parameters
*/
public static int updateBatch(String sql, Collection parameters) {
parameters.forEach(obj->{
if (obj instanceof DaoEPBase) {
setRevisor((DaoEPBase) obj, true);
} else if (obj instanceof Map) {
setRevisor((Map) obj, true);
}
});
return DaoBase.getInstance().updateBatch(sql, parameters);
}
/**
* 创建人工号 创建人姓名 创建人岗号 创建时刻
*
......@@ -136,7 +154,7 @@ public class DaoUtils {
log.error("写入创建时刻失败:{}", e.getMessage(), e);
}
}
/**
* 创建人工号 创建人姓名 创建时刻.
*
......@@ -197,7 +215,7 @@ public class DaoUtils {
log.warn("写入创建时刻失败", e);
}
}
/**
* 修改人工号 修改人姓名 修改人岗号 修改时刻 记录修改代理人工号 记录修改代理人姓名.
*
......@@ -232,7 +250,7 @@ public class DaoUtils {
log.warn("写入修改时刻失败", e);
}
}
/**
* 修改人工号 修改人姓名 修改人岗号 修改时刻 记录修改代理人工号 记录修改代理人姓名.
*
......@@ -264,5 +282,5 @@ public class DaoUtils {
// 修改时间
map.put("updatedTime", DateUtils.shortDateTime());
}
}
......@@ -211,4 +211,32 @@ public class HGConstant {
public static final Integer YS = 2;
}
/**
*
* 物料提交状态
* @author:songx
* @date:2024/5/15,15:18
*/
public static class MaterialStatus {
// 未提交
public static final Integer WTJ = 0;
// 部分提交
public static final Integer BFTJ = 1;
// 全部提交
public static final Integer QBTJ = 2;
}
/**
*
* 物料提交状态
* @author:songx
* @date:2024/5/15,15:18
*/
public static class ProductStatus {
// 未提交
public static final Integer WTJ = 0;
// 已提交
public static final Integer YTJ = 1;
}
}
......@@ -315,6 +315,30 @@
ORDER BY INVENT_CODE
</select>
<select id="queryProductComboBox" parameterClass="java.util.HashMap"
resultClass="java.util.HashMap">
SELECT DISTINCT
a.ID as "id",
a.INVENT_TYPE as "inventType",
a.INVENT_CODE as "inventCode",
a.INVENT_NAME as "inventName",
b.PAR_INVENT_TYPE as "parInventType"
FROM ${hggpSchema}.HGPZ005 a
left join ${hggpSchema}.hgpz004 b on a.INVENT_TYPE = b.INVENT_TYPE and b.STATUS=1 and b.DELETE_FLAG = 0
WHERE a.DELETE_FLAG = 0
AND a.STATUS=1
<isNotEmpty prepend=" AND " property="accountCode">
a.ACCOUNT_CODE = #accountCode#
</isNotEmpty>
<isNotEmpty prepend=" AND " property="inventType">
a.INVENT_TYPE = #inventType#
</isNotEmpty>
<isNotEmpty prepend=" AND " property="parInventType">
b.PAR_INVENT_TYPE = #parInventType#
</isNotEmpty>
ORDER BY INVENT_CODE
</select>
<!-- 缺省下拉框 -->
<select id="queryComboBoxAll" parameterClass="java.util.HashMap" resultClass="java.util.HashMap">
SELECT DISTINCT
......
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:HGSC003A.java <br>
* Description: <br>
*
* Copyrigth:Baosight Software LTD.co Copyright (c) 2019. <br>
*
* @version 1.0
* @history 2024-05-16 14:38:47 create
*/
public class HGSC003A 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_blueprint_id = "blueprintId"; /* 蓝图id*/
public static final String FIELD_blueprint_code = "blueprintCode"; /* 蓝图编号*/
public static final String FIELD_blueprint_name = "blueprintName"; /* 蓝图名称*/
public static final String FIELD_proj_code = "projCode"; /* 项目编码*/
public static final String FIELD_proj_name = "projName"; /* 项目名称*/
public static final String FIELD_drawing_code = "drawingCode"; /* 图号*/
public static final String FIELD_drawing_name = "drawingName"; /* 图纸名称*/
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_blueprint_id = "blueprint_id"; /* 蓝图id*/
public static final String COL_blueprint_code = "blueprint_code"; /* 蓝图编号*/
public static final String COL_blueprint_name = "blueprint_name"; /* 蓝图名称*/
public static final String COL_proj_code = "proj_code"; /* 项目编码*/
public static final String COL_proj_name = "proj_name"; /* 项目名称*/
public static final String COL_drawing_code = "drawing_code"; /* 图号*/
public static final String COL_drawing_name = "drawing_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 = "HGSC003A.query";
public static final String COUNT = "HGSC003A.count";
public static final String INSERT = "HGSC003A.insert";
public static final String UPDATE = "HGSC003A.update";
public static final String DELETE = "HGSC003A.delete";
public static final String BATCH_DELETE = "HGSC003.batchDelete";
private Long id = new Long(0); /* 主键*/
private String companyCode = " "; /* 公司编码*/
private String companyName = " "; /* 公司名称*/
private String depCode = " "; /* 部门编号*/
private String depName = " "; /* 部门名称*/
private Long blueprintId = new Long(0); /* 蓝图id*/
private String blueprintCode = " "; /* 蓝图编号*/
private String blueprintName = " "; /* 蓝图名称*/
private String projCode = " "; /* 项目编码*/
private String projName = " "; /* 项目名称*/
private String drawingCode = " "; /* 图号*/
private String drawingName = " "; /* 图纸名称*/
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.setType("N");
eiColumn.setScaleLength(0);
eiColumn.setFieldLength(20);
eiColumn.setDescName("主键");
eiMetadata.addMeta(eiColumn);
eiColumn = new EiColumn(FIELD_company_code);
eiColumn.setFieldLength(32);
eiColumn.setDescName("公司编码");
eiMetadata.addMeta(eiColumn);
eiColumn = new EiColumn(FIELD_company_name);
eiColumn.setFieldLength(32);
eiColumn.setDescName("公司名称");
eiMetadata.addMeta(eiColumn);
eiColumn = new EiColumn(FIELD_dep_code);
eiColumn.setFieldLength(20);
eiColumn.setDescName("部门编号");
eiMetadata.addMeta(eiColumn);
eiColumn = new EiColumn(FIELD_dep_name);
eiColumn.setFieldLength(32);
eiColumn.setDescName("部门名称");
eiMetadata.addMeta(eiColumn);
eiColumn = new EiColumn(FIELD_blueprint_id);
eiColumn.setType("N");
eiColumn.setScaleLength(0);
eiColumn.setFieldLength(20);
eiColumn.setDescName("蓝图id");
eiMetadata.addMeta(eiColumn);
eiColumn = new EiColumn(FIELD_blueprint_code);
eiColumn.setFieldLength(32);
eiColumn.setDescName("蓝图编号");
eiMetadata.addMeta(eiColumn);
eiColumn = new EiColumn(FIELD_blueprint_name);
eiColumn.setFieldLength(50);
eiColumn.setDescName("蓝图名称");
eiMetadata.addMeta(eiColumn);
eiColumn = new EiColumn(FIELD_proj_code);
eiColumn.setFieldLength(20);
eiColumn.setDescName("项目编码");
eiMetadata.addMeta(eiColumn);
eiColumn = new EiColumn(FIELD_proj_name);
eiColumn.setFieldLength(50);
eiColumn.setDescName("项目名称");
eiMetadata.addMeta(eiColumn);
eiColumn = new EiColumn(FIELD_drawing_code);
eiColumn.setFieldLength(32);
eiColumn.setDescName("图号");
eiMetadata.addMeta(eiColumn);
eiColumn = new EiColumn(FIELD_drawing_name);
eiColumn.setFieldLength(100);
eiColumn.setDescName("图纸名称");
eiMetadata.addMeta(eiColumn);
eiColumn = new EiColumn(FIELD_account_code);
eiColumn.setFieldLength(32);
eiColumn.setDescName("帐套");
eiMetadata.addMeta(eiColumn);
eiColumn = new EiColumn(FIELD_created_by);
eiColumn.setFieldLength(32);
eiColumn.setDescName("创建人");
eiMetadata.addMeta(eiColumn);
eiColumn = new EiColumn(FIELD_created_name);
eiColumn.setFieldLength(32);
eiColumn.setDescName("创建人名称");
eiMetadata.addMeta(eiColumn);
eiColumn = new EiColumn(FIELD_created_time);
eiColumn.setFieldLength(14);
eiColumn.setDescName("创建时间");
eiMetadata.addMeta(eiColumn);
eiColumn = new EiColumn(FIELD_updated_by);
eiColumn.setFieldLength(32);
eiColumn.setDescName("更新人");
eiMetadata.addMeta(eiColumn);
eiColumn = new EiColumn(FIELD_updated_name);
eiColumn.setFieldLength(32);
eiColumn.setDescName("修改人名称");
eiMetadata.addMeta(eiColumn);
eiColumn = new EiColumn(FIELD_updated_time);
eiColumn.setFieldLength(14);
eiColumn.setDescName("更新时间");
eiMetadata.addMeta(eiColumn);
}
/**
* the constructor.
*/
public HGSC003A() {
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 blueprintId - 蓝图id.
* @return the blueprintId
*/
public Long getBlueprintId() {
return this.blueprintId;
}
/**
* set the blueprintId - 蓝图id.
*
* @param blueprintId - 蓝图id
*/
public void setBlueprintId(Long blueprintId) {
this.blueprintId = blueprintId;
}
/**
* get the blueprintCode - 蓝图编号.
* @return the blueprintCode
*/
public String getBlueprintCode() {
return this.blueprintCode;
}
/**
* set the blueprintCode - 蓝图编号.
*
* @param blueprintCode - 蓝图编号
*/
public void setBlueprintCode(String blueprintCode) {
this.blueprintCode = blueprintCode;
}
/**
* get the blueprintName - 蓝图名称.
* @return the blueprintName
*/
public String getBlueprintName() {
return this.blueprintName;
}
/**
* set the blueprintName - 蓝图名称.
*
* @param blueprintName - 蓝图名称
*/
public void setBlueprintName(String blueprintName) {
this.blueprintName = blueprintName;
}
/**
* 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 drawingCode - 图号.
* @return the drawingCode
*/
public String getDrawingCode() {
return this.drawingCode;
}
/**
* set the drawingCode - 图号.
*
* @param drawingCode - 图号
*/
public void setDrawingCode(String drawingCode) {
this.drawingCode = drawingCode;
}
/**
* get the drawingName - 图纸名称.
* @return the drawingName
*/
public String getDrawingName() {
return this.drawingName;
}
/**
* set the drawingName - 图纸名称.
*
* @param drawingName - 图纸名称
*/
public void setDrawingName(String drawingName) {
this.drawingName = drawingName;
}
/**
* 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));
setBlueprintId(NumberUtils.toLong(StringUtils.toString(map.get(FIELD_blueprint_id)), blueprintId));
setBlueprintCode(StringUtils.defaultIfEmpty(StringUtils.toString(map.get(FIELD_blueprint_code)), blueprintCode));
setBlueprintName(StringUtils.defaultIfEmpty(StringUtils.toString(map.get(FIELD_blueprint_name)), blueprintName));
setProjCode(StringUtils.defaultIfEmpty(StringUtils.toString(map.get(FIELD_proj_code)), projCode));
setProjName(StringUtils.defaultIfEmpty(StringUtils.toString(map.get(FIELD_proj_name)), projName));
setDrawingCode(StringUtils.defaultIfEmpty(StringUtils.toString(map.get(FIELD_drawing_code)), drawingCode));
setDrawingName(StringUtils.defaultIfEmpty(StringUtils.toString(map.get(FIELD_drawing_name)), drawingName));
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_blueprint_id, StringUtils.toString(blueprintId, eiMetadata.getMeta(FIELD_blueprint_id)));
map.put(FIELD_blueprint_code, StringUtils.toString(blueprintCode, eiMetadata.getMeta(FIELD_blueprint_code)));
map.put(FIELD_blueprint_name, StringUtils.toString(blueprintName, eiMetadata.getMeta(FIELD_blueprint_name)));
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_drawing_code, StringUtils.toString(drawingCode, eiMetadata.getMeta(FIELD_drawing_code)));
map.put(FIELD_drawing_name, StringUtils.toString(drawingName, eiMetadata.getMeta(FIELD_drawing_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.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:Hgsc004.java <br>
* Description: <br>
*
* Copyrigth:Baosight Software LTD.co Copyright (c) 2019. <br>
*
* @version 1.0
* @history 2024-05-16 14:38:04 create
*/
public class HGSC004 extends DaoEPBase {
private static final long serialVersionUID = 1L;
public static final String FIELD_id = "id"; /* 主键*/
public static final String FIELD_blueprint_id = "blueprintId"; /* 蓝图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_blueprint_code = "blueprintCode"; /* 蓝图编号*/
public static final String FIELD_blueprint_name = "blueprintName"; /* 蓝图名称*/
public static final String FIELD_proj_code = "projCode"; /* 项目编码*/
public static final String FIELD_proj_name = "projName"; /* 项目名称*/
public static final String FIELD_material_status = "materialStatus"; /* 物料状态 0:未提交,1:部分提交,2:全部提交*/
public static final String FIELD_approval_status = "approvalStatus"; /* 审批状态\t0:待审;1:审核中;2:已审*/
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 FIELD_del_status = "delStatus"; /* 数据状态 0:保存,1:删除*/
public static final String COL_id = "id"; /* 主键*/
public static final String COL_blueprint_id = "blueprint_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_blueprint_code = "blueprint_code"; /* 蓝图编号*/
public static final String COL_blueprint_name = "blueprint_name"; /* 蓝图名称*/
public static final String COL_proj_code = "proj_code"; /* 项目编码*/
public static final String COL_proj_name = "proj_name"; /* 项目名称*/
public static final String COL_material_status = "material_status"; /* 物料状态 0:未提交,1:部分提交,2:全部提交*/
public static final String COL_approval_status = "approval_status"; /* 审批状态\t0:待审;1:审核中;2:已审*/
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 COL_del_status = "del_status"; /* 数据状态 0:保存,1:删除*/
public static final String QUERY = "HGSC004.query";
public static final String COUNT = "HGSC004.count";
public static final String INSERT = "HGSC004.insert";
public static final String UPDATE = "HGSC004.update";
public static final String DELETE = "HGSC004.delete";
public static final String BATCH_DELETE = "HGSC004.batchDelete";
public static final String UPDATE_DEL = "HGSC004.updateDel";
public static final String UPDATE_MATERIAL_STATUS = "HGSC004.updateMaterialStatus";
private Long id = new Long(0); /* 主键*/
private Long blueprintId = new Long(0); /* 蓝图id*/
private String companyCode = " "; /* 公司编码*/
private String companyName = " "; /* 公司名称*/
private String depCode = " "; /* 部门编号*/
private String depName = " "; /* 部门名称*/
private String blueprintCode = " "; /* 蓝图编号*/
private String blueprintName = " "; /* 蓝图名称*/
private String projCode = " "; /* 项目编码*/
private String projName = " "; /* 项目名称*/
private Integer materialStatus = new Integer(0); /* 物料状态 0:未提交,1:部分提交,2:全部提交*/
private Integer approvalStatus = new Integer(0); /* 审批状态\t0:待审;1:审核中;2:已审*/
private String accountCode = " "; /* 帐套*/
private String createdBy = " "; /* 创建人*/
private String createdName = " "; /* 创建人名称*/
private String createdTime = " "; /* 创建时间*/
private String updatedBy = " "; /* 更新人*/
private String updatedName = " "; /* 修改人名称*/
private String updatedTime = " "; /* 更新时间*/
private Integer delStatus = new Integer(0); /* 数据状态 0:保存,1:删除*/
/**
* initialize the metadata.
*/
public void initMetaData() {
EiColumn eiColumn;
eiColumn = new EiColumn(FIELD_id);
eiColumn.setType("N");
eiColumn.setScaleLength(0);
eiColumn.setFieldLength(20);
eiColumn.setDescName("主键");
eiMetadata.addMeta(eiColumn);
eiColumn = new EiColumn(FIELD_blueprint_id);
eiColumn.setType("N");
eiColumn.setScaleLength(0);
eiColumn.setFieldLength(20);
eiColumn.setDescName("蓝图id");
eiMetadata.addMeta(eiColumn);
eiColumn = new EiColumn(FIELD_company_code);
eiColumn.setFieldLength(32);
eiColumn.setDescName("公司编码");
eiMetadata.addMeta(eiColumn);
eiColumn = new EiColumn(FIELD_company_name);
eiColumn.setFieldLength(32);
eiColumn.setDescName("公司名称");
eiMetadata.addMeta(eiColumn);
eiColumn = new EiColumn(FIELD_dep_code);
eiColumn.setFieldLength(20);
eiColumn.setDescName("部门编号");
eiMetadata.addMeta(eiColumn);
eiColumn = new EiColumn(FIELD_dep_name);
eiColumn.setFieldLength(32);
eiColumn.setDescName("部门名称");
eiMetadata.addMeta(eiColumn);
eiColumn = new EiColumn(FIELD_blueprint_code);
eiColumn.setFieldLength(32);
eiColumn.setDescName("蓝图编号");
eiMetadata.addMeta(eiColumn);
eiColumn = new EiColumn(FIELD_blueprint_name);
eiColumn.setFieldLength(50);
eiColumn.setDescName("蓝图名称");
eiMetadata.addMeta(eiColumn);
eiColumn = new EiColumn(FIELD_proj_code);
eiColumn.setFieldLength(20);
eiColumn.setDescName("项目编码");
eiMetadata.addMeta(eiColumn);
eiColumn = new EiColumn(FIELD_proj_name);
eiColumn.setFieldLength(50);
eiColumn.setDescName("项目名称");
eiMetadata.addMeta(eiColumn);
eiColumn = new EiColumn(FIELD_material_status);
eiColumn.setType("N");
eiColumn.setScaleLength(0);
eiColumn.setFieldLength(4);
eiColumn.setDescName("物料状态 0:未提交,1:部分提交,2:全部提交");
eiMetadata.addMeta(eiColumn);
eiColumn = new EiColumn(FIELD_approval_status);
eiColumn.setType("N");
eiColumn.setScaleLength(0);
eiColumn.setFieldLength(4);
eiColumn.setDescName("审批状态\t0:待审;1:审核中;2:已审");
eiMetadata.addMeta(eiColumn);
eiColumn = new EiColumn(FIELD_account_code);
eiColumn.setFieldLength(32);
eiColumn.setDescName("帐套");
eiMetadata.addMeta(eiColumn);
eiColumn = new EiColumn(FIELD_created_by);
eiColumn.setFieldLength(32);
eiColumn.setDescName("创建人");
eiMetadata.addMeta(eiColumn);
eiColumn = new EiColumn(FIELD_created_name);
eiColumn.setFieldLength(32);
eiColumn.setDescName("创建人名称");
eiMetadata.addMeta(eiColumn);
eiColumn = new EiColumn(FIELD_created_time);
eiColumn.setFieldLength(14);
eiColumn.setDescName("创建时间");
eiMetadata.addMeta(eiColumn);
eiColumn = new EiColumn(FIELD_updated_by);
eiColumn.setFieldLength(32);
eiColumn.setDescName("更新人");
eiMetadata.addMeta(eiColumn);
eiColumn = new EiColumn(FIELD_updated_name);
eiColumn.setFieldLength(32);
eiColumn.setDescName("修改人名称");
eiMetadata.addMeta(eiColumn);
eiColumn = new EiColumn(FIELD_updated_time);
eiColumn.setFieldLength(14);
eiColumn.setDescName("更新时间");
eiMetadata.addMeta(eiColumn);
eiColumn = new EiColumn(FIELD_del_status);
eiColumn.setDescName("数据状态 0:保存,1:删除");
eiMetadata.addMeta(eiColumn);
}
/**
* the constructor.
*/
public HGSC004() {
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 blueprintId - 蓝图id.
* @return the blueprintId
*/
public Long getBlueprintId() {
return this.blueprintId;
}
/**
* set the blueprintId - 蓝图id.
*
* @param blueprintId - 蓝图id
*/
public void setBlueprintId(Long blueprintId) {
this.blueprintId = blueprintId;
}
/**
* 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 blueprintCode - 蓝图编号.
* @return the blueprintCode
*/
public String getBlueprintCode() {
return this.blueprintCode;
}
/**
* set the blueprintCode - 蓝图编号.
*
* @param blueprintCode - 蓝图编号
*/
public void setBlueprintCode(String blueprintCode) {
this.blueprintCode = blueprintCode;
}
/**
* get the blueprintName - 蓝图名称.
* @return the blueprintName
*/
public String getBlueprintName() {
return this.blueprintName;
}
/**
* set the blueprintName - 蓝图名称.
*
* @param blueprintName - 蓝图名称
*/
public void setBlueprintName(String blueprintName) {
this.blueprintName = blueprintName;
}
/**
* 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 materialStatus - 物料状态 0:未提交,1:部分提交,2:全部提交.
* @return the materialStatus
*/
public Integer getMaterialStatus() {
return this.materialStatus;
}
/**
* set the materialStatus - 物料状态 0:未提交,1:部分提交,2:全部提交.
*
* @param materialStatus - 物料状态 0:未提交,1:部分提交,2:全部提交
*/
public void setMaterialStatus(Integer materialStatus) {
this.materialStatus = materialStatus;
}
/**
* 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 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;
}
public Integer getDelStatus() {
return delStatus;
}
public void setDelStatus(Integer delStatus) {
this.delStatus = delStatus;
}
/**
* 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));
setBlueprintId(NumberUtils.toLong(StringUtils.toString(map.get(FIELD_blueprint_id)), blueprintId));
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));
setBlueprintCode(StringUtils.defaultIfEmpty(StringUtils.toString(map.get(FIELD_blueprint_code)), blueprintCode));
setBlueprintName(StringUtils.defaultIfEmpty(StringUtils.toString(map.get(FIELD_blueprint_name)), blueprintName));
setProjCode(StringUtils.defaultIfEmpty(StringUtils.toString(map.get(FIELD_proj_code)), projCode));
setProjName(StringUtils.defaultIfEmpty(StringUtils.toString(map.get(FIELD_proj_name)), projName));
setMaterialStatus(NumberUtils.toInteger(StringUtils.toString(map.get(FIELD_material_status)), materialStatus));
setApprovalStatus(NumberUtils.toInteger(StringUtils.toString(map.get(FIELD_approval_status)), approvalStatus));
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));
setDelStatus(NumberUtils.toInteger(StringUtils.toString(map.get(FIELD_del_status)), delStatus));
}
/**
* 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_blueprint_id, StringUtils.toString(blueprintId, eiMetadata.getMeta(FIELD_blueprint_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_blueprint_code, StringUtils.toString(blueprintCode, eiMetadata.getMeta(FIELD_blueprint_code)));
map.put(FIELD_blueprint_name, StringUtils.toString(blueprintName, eiMetadata.getMeta(FIELD_blueprint_name)));
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_material_status, StringUtils.toString(materialStatus, eiMetadata.getMeta(FIELD_material_status)));
map.put(FIELD_approval_status, StringUtils.toString(approvalStatus, eiMetadata.getMeta(FIELD_approval_status)));
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)));
map.put(FIELD_del_status, StringUtils.toString(delStatus, eiMetadata.getMeta(FIELD_del_status)));
return map;
}
}
package com.baosight.hggp.hg.sc.domain;
import com.baosight.iplat4j.core.util.NumberUtils;
import java.math.BigDecimal;
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:Hgsc004a.java <br>
* Description: <br>
*
* Copyrigth:Baosight Software LTD.co Copyright (c) 2019. <br>
*
* @version 1.0
* @history 2024-05-16 14:38:53 create
*/
public class HGSC004A 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_proj_code = "projCode"; /* 项目编码(预留)*/
public static final String FIELD_proj_name = "projName"; /* 项目名称(预留)*/
public static final String FIELD_parent_prod_code = "parentProdCode"; /* 父节点-产品编码*/
public static final String FIELD_parent_prod_name = "parentProdName"; /* 父节点-产品名称*/
public static final String FIELD_leaf = "leaf"; /* 是否有叶子节点*/
public static final String FIELD_sort = "sort"; /* 排序字段*/
public static final String FIELD_lv = "lv"; /* 层级*/
public static final String FIELD_material_id = "materialId"; /* 物料清单id*/
public static final String FIELD_product_id = "productId"; /* 产品id*/
public static final String FIELD_product_code = "productCode"; /* 产品编号*/
public static final String FIELD_product_name = "productName"; /* 产品名称*/
public static final String FIELD_product_type = "productType"; /* 产品type*/
public static final String FIELD_product_status = "productStatus"; /* 产品状态 0:未提交,1:已提交*/
public static final String FIELD_change_type = "changeType"; /* 变更类型:默认0,1:增加,2:替换,3:删除*/
public static final String FIELD_quantity = "quantity"; /* 数量*/
public static final String FIELD_single_weight = "singleWeight"; /* 单重*/
public static final String FIELD_total_weight = "totalWeight"; /* 总重*/
public static final String FIELD_approval_status = "approvalStatus"; /* 审批状态\t0:待审;1:审核中;2:已审*/
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_proj_code = "proj_code"; /* 项目编码(预留)*/
public static final String COL_proj_name = "proj_name"; /* 项目名称(预留)*/
public static final String COL_parent_prod_code = "parent_prod_code"; /* 父节点-产品编码*/
public static final String COL_parent_prod_name = "parent_prod_name"; /* 父节点-产品名称*/
public static final String COL_leaf = "leaf"; /* 是否有叶子节点*/
public static final String COL_sort = "sort"; /* 排序字段*/
public static final String COL_lv = "lv"; /* 层级*/
public static final String COL_material_id = "material_id"; /* 物料清单id*/
public static final String COL_product_id = "product_id"; /* 产品id*/
public static final String COL_product_code = "product_code"; /* 产品编号*/
public static final String COL_product_name = "product_name"; /* 产品名称*/
public static final String COL_product_type = "product_type"; /* 产品类型*/
public static final String COL_product_status = "product_status"; /* 产品状态 0:未提交,1:已提交*/
public static final String COL_change_type = "change_type"; /* 变更类型:默认0,1:增加,2:替换,3:删除*/
public static final String COL_quantity = "quantity"; /* 数量*/
public static final String COL_single_weight = "single_weight"; /* 单重*/
public static final String COL_total_weight = "total_weight"; /* 总重*/
public static final String COL_approval_status = "approval_status"; /* 审批状态\t0:待审;1:审核中;2:已审*/
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 = "HGSC004A.query";
public static final String COUNT = "HGSC004A.count";
public static final String INSERT = "HGSC004A.insert";
public static final String UPDATE = "HGSC004A.update";
public static final String DELETE = "HGSC004A.delete";
public static final String BATCH_DELETE = "HGSC004A.batchDelete";
public static final String QUERY_ALL = "HGSC004A.queryAll";
public static final String UPDATE_PRODUCT_STATUS = "HGSC004A.updateProductStatus";
private Long id = new Long(0); /* 主键*/
private String companyCode = " "; /* 公司编码(预留)*/
private String companyName = " "; /* 公司名称(预留)*/
private String depCode = " "; /* 部门编号(预留)*/
private String depName = " "; /* 部门名称(预留)*/
private String projCode = " "; /* 项目编码(预留)*/
private String projName = " "; /* 项目名称(预留)*/
private String parentProdCode = " "; /* 父节点-产品编码*/
private String parentProdName = " "; /* 父节点-产品名称*/
private Integer leaf = new Integer(1); /* 是否有叶子节点*/
private Integer sort = new Integer(1); /* 排序字段*/
private Integer lv = new Integer(0);; /* 树的层级*/
private Long materialId = new Long(0); /* 物料清单id*/
private Long productId = new Long(0); /* 产品id*/
private String productCode = " "; /* 产品编号*/
private String productName = " "; /* 产品名称*/
private String productType = " "; /* 产品id*/
private Integer productStatus = new Integer(0); /* 产品状态 0:未提交,1:已提交*/
private Integer changeType = new Integer(0); /* 变更类型:默认0,1:增加,2:替换,3:删除*/
private Integer quantity = new Integer(0); /* 数量*/
private BigDecimal singleWeight = new BigDecimal(0.000); /* 单重*/
private BigDecimal totalWeight = new BigDecimal(0.000); /* 总重*/
private Integer approvalStatus = new Integer(0); /* 审批状态\t0:待审;1:审核中;2:已审*/
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.setType("N");
eiColumn.setScaleLength(0);
eiColumn.setFieldLength(20);
eiColumn.setDescName("主键");
eiMetadata.addMeta(eiColumn);
eiColumn = new EiColumn(FIELD_company_code);
eiColumn.setFieldLength(32);
eiColumn.setDescName("公司编码(预留)");
eiMetadata.addMeta(eiColumn);
eiColumn = new EiColumn(FIELD_company_name);
eiColumn.setFieldLength(32);
eiColumn.setDescName("公司名称(预留)");
eiMetadata.addMeta(eiColumn);
eiColumn = new EiColumn(FIELD_dep_code);
eiColumn.setFieldLength(20);
eiColumn.setDescName("部门编号(预留)");
eiMetadata.addMeta(eiColumn);
eiColumn = new EiColumn(FIELD_dep_name);
eiColumn.setFieldLength(32);
eiColumn.setDescName("部门名称(预留)");
eiMetadata.addMeta(eiColumn);
eiColumn = new EiColumn(FIELD_proj_code);
eiColumn.setFieldLength(20);
eiColumn.setDescName("项目编码(预留)");
eiMetadata.addMeta(eiColumn);
eiColumn = new EiColumn(FIELD_proj_name);
eiColumn.setFieldLength(50);
eiColumn.setDescName("项目名称(预留)");
eiMetadata.addMeta(eiColumn);
eiColumn = new EiColumn(FIELD_parent_prod_code);
eiColumn.setFieldLength(32);
eiColumn.setDescName("父节点-产品编码");
eiMetadata.addMeta(eiColumn);
eiColumn = new EiColumn(FIELD_parent_prod_name);
eiColumn.setFieldLength(50);
eiColumn.setDescName("父节点-产品名称");
eiMetadata.addMeta(eiColumn);
eiColumn = new EiColumn(FIELD_leaf);
eiColumn.setDescName("是否有叶子节点");
eiMetadata.addMeta(eiColumn);
eiColumn = new EiColumn(FIELD_sort);
eiColumn.setDescName("排序字段");
eiMetadata.addMeta(eiColumn);
eiColumn = new EiColumn(FIELD_lv);
eiColumn.setDescName("层级");
eiMetadata.addMeta(eiColumn);
eiColumn = new EiColumn(FIELD_material_id);
eiColumn.setType("N");
eiColumn.setScaleLength(0);
eiColumn.setFieldLength(20);
eiColumn.setDescName("物料清单id");
eiMetadata.addMeta(eiColumn);
eiColumn = new EiColumn(FIELD_product_id);
eiColumn.setFieldLength(20);
eiColumn.setDescName("产品Id");
eiMetadata.addMeta(eiColumn);
eiColumn = new EiColumn(FIELD_product_code);
eiColumn.setFieldLength(32);
eiColumn.setDescName("产品编号");
eiMetadata.addMeta(eiColumn);
eiColumn = new EiColumn(FIELD_product_name);
eiColumn.setFieldLength(50);
eiColumn.setDescName("产品名称");
eiMetadata.addMeta(eiColumn);
eiColumn = new EiColumn(FIELD_product_type);
eiColumn.setFieldLength(32);
eiColumn.setDescName("产品类型");
eiMetadata.addMeta(eiColumn);
eiColumn = new EiColumn(FIELD_product_status);
eiColumn.setType("N");
eiColumn.setScaleLength(0);
eiColumn.setFieldLength(4);
eiColumn.setDescName("产品状态 0:未提交,1:已提交");
eiMetadata.addMeta(eiColumn);
eiColumn = new EiColumn(FIELD_change_type);
eiColumn.setType("N");
eiColumn.setScaleLength(0);
eiColumn.setFieldLength(4);
eiColumn.setDescName("变更类型:默认0,1:增加,2:替换,3:删除");
eiMetadata.addMeta(eiColumn);
eiColumn = new EiColumn(FIELD_quantity);
eiColumn.setType("N");
eiColumn.setScaleLength(0);
eiColumn.setFieldLength(8);
eiColumn.setDescName("数量");
eiMetadata.addMeta(eiColumn);
eiColumn = new EiColumn(FIELD_single_weight);
eiColumn.setType("N");
eiColumn.setScaleLength(3);
eiColumn.setFieldLength(20);
eiColumn.setDescName("单重");
eiMetadata.addMeta(eiColumn);
eiColumn = new EiColumn(FIELD_total_weight);
eiColumn.setType("N");
eiColumn.setScaleLength(3);
eiColumn.setFieldLength(20);
eiColumn.setDescName("总重");
eiMetadata.addMeta(eiColumn);
eiColumn = new EiColumn(FIELD_approval_status);
eiColumn.setType("N");
eiColumn.setScaleLength(0);
eiColumn.setFieldLength(4);
eiColumn.setDescName("审批状态\t0:待审;1:审核中;2:已审");
eiMetadata.addMeta(eiColumn);
eiColumn = new EiColumn(FIELD_account_code);
eiColumn.setFieldLength(32);
eiColumn.setDescName("帐套");
eiMetadata.addMeta(eiColumn);
eiColumn = new EiColumn(FIELD_created_by);
eiColumn.setFieldLength(32);
eiColumn.setDescName("创建人");
eiMetadata.addMeta(eiColumn);
eiColumn = new EiColumn(FIELD_created_name);
eiColumn.setFieldLength(32);
eiColumn.setDescName("创建人名称");
eiMetadata.addMeta(eiColumn);
eiColumn = new EiColumn(FIELD_created_time);
eiColumn.setFieldLength(14);
eiColumn.setDescName("创建时间");
eiMetadata.addMeta(eiColumn);
eiColumn = new EiColumn(FIELD_updated_by);
eiColumn.setFieldLength(32);
eiColumn.setDescName("更新人");
eiMetadata.addMeta(eiColumn);
eiColumn = new EiColumn(FIELD_updated_name);
eiColumn.setFieldLength(32);
eiColumn.setDescName("修改人名称");
eiMetadata.addMeta(eiColumn);
eiColumn = new EiColumn(FIELD_updated_time);
eiColumn.setFieldLength(14);
eiColumn.setDescName("更新时间");
eiMetadata.addMeta(eiColumn);
}
/**
* the constructor.
*/
public HGSC004A() {
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 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 parentProdCode - 父节点-产品编码.
* @return the parentProdCode
*/
public String getParentProdCode() {
return this.parentProdCode;
}
/**
* set the parentProdCode - 父节点-产品编码.
*
* @param parentProdCode - 父节点-产品编码
*/
public void setParentProdCode(String parentProdCode) {
this.parentProdCode = parentProdCode;
}
/**
* get the parentProdName - 父节点-产品名称.
* @return the parentProdName
*/
public String getParentProdName() {
return this.parentProdName;
}
/**
* set the parentProdName - 父节点-产品名称.
*
* @param parentProdName - 父节点-产品名称
*/
public void setParentProdName(String parentProdName) {
this.parentProdName = parentProdName;
}
/**
* get the materialId - 物料清单id.
* @return the materialId
*/
public Long getMaterialId() {
return this.materialId;
}
/**
* set the materialId - 物料清单id.
*
* @param materialId - 物料清单id
*/
public void setMaterialId(Long materialId) {
this.materialId = materialId;
}
/**
* get the productCode - 产品编号.
* @return the productCode
*/
public String getProductCode() {
return this.productCode;
}
/**
* set the productCode - 产品编号.
*
* @param productCode - 产品编号
*/
public void setProductCode(String productCode) {
this.productCode = productCode;
}
/**
* get the productName - 产品名称.
* @return the productName
*/
public String getProductName() {
return this.productName;
}
/**
* set the productName - 产品名称.
*
* @param productName - 产品名称
*/
public void setProductName(String productName) {
this.productName = productName;
}
/**
* get the productStatus - 产品状态 0:未提交,1:已提交.
* @return the productStatus
*/
public Integer getProductStatus() {
return this.productStatus;
}
/**
* set the productStatus - 产品状态 0:未提交,1:已提交.
*
* @param productStatus - 产品状态 0:未提交,1:已提交
*/
public void setProductStatus(Integer productStatus) {
this.productStatus = productStatus;
}
/**
* get the changeType - 变更类型:默认0,1:增加,2:替换,3:删除.
* @return the changeType
*/
public Integer getChangeType() {
return this.changeType;
}
/**
* set the changeType - 变更类型:默认0,1:增加,2:替换,3:删除.
*
* @param changeType - 变更类型:默认0,1:增加,2:替换,3:删除
*/
public void setChangeType(Integer changeType) {
this.changeType = changeType;
}
/**
* get the quantity - 数量.
* @return the quantity
*/
public Integer getQuantity() {
return this.quantity;
}
/**
* set the quantity - 数量.
*
* @param quantity - 数量
*/
public void setQuantity(Integer quantity) {
this.quantity = quantity;
}
/**
* get the singleWeight - 单重.
* @return the singleWeight
*/
public BigDecimal getSingleWeight() {
return this.singleWeight;
}
/**
* set the singleWeight - 单重.
*
* @param singleWeight - 单重
*/
public void setSingleWeight(BigDecimal singleWeight) {
this.singleWeight = singleWeight;
}
/**
* get the totalWeight - 总重.
* @return the totalWeight
*/
public BigDecimal getTotalWeight() {
return this.totalWeight;
}
/**
* set the totalWeight - 总重.
*
* @param totalWeight - 总重
*/
public void setTotalWeight(BigDecimal totalWeight) {
this.totalWeight = totalWeight;
}
/**
* 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 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;
}
public Integer getLeaf() {
return leaf;
}
public void setLeaf(Integer leaf) {
this.leaf = leaf;
}
public Integer getSort() {
return sort;
}
public void setSort(Integer sort) {
this.sort = sort;
}
public Integer getLv() {
return lv;
}
public void setLv(Integer lv) {
this.lv = lv;
}
public Long getProductId() {
return productId;
}
public void setProductId(Long productId) {
this.productId = productId;
}
public String getProductType() {
return productType;
}
public void setProductType(String productType) {
this.productType = productType;
}
/**
* 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));
setProjCode(StringUtils.defaultIfEmpty(StringUtils.toString(map.get(FIELD_proj_code)), projCode));
setProjName(StringUtils.defaultIfEmpty(StringUtils.toString(map.get(FIELD_proj_name)), projName));
setParentProdCode(StringUtils.defaultIfEmpty(StringUtils.toString(map.get(FIELD_parent_prod_code)), parentProdCode));
setParentProdName(StringUtils.defaultIfEmpty(StringUtils.toString(map.get(FIELD_parent_prod_name)), parentProdName));
setLeaf(NumberUtils.toInteger(StringUtils.toString(map.get(FIELD_leaf)), leaf));
setSort(NumberUtils.toInteger(StringUtils.toString(map.get(FIELD_sort)), sort));
setLv(NumberUtils.toInteger(StringUtils.toString(map.get(FIELD_lv)), lv));
setMaterialId(NumberUtils.toLong(StringUtils.toString(map.get(FIELD_material_id)), materialId));
setProductCode(StringUtils.defaultIfEmpty(StringUtils.toString(map.get(FIELD_product_code)), productCode));
setProductName(StringUtils.defaultIfEmpty(StringUtils.toString(map.get(FIELD_product_name)), productName));
setProductId(NumberUtils.toLong(StringUtils.toString(map.get(FIELD_product_id)), productId));
setProductType(StringUtils.defaultIfEmpty(StringUtils.toString(map.get(FIELD_product_type)), productType));
setProductStatus(NumberUtils.toInteger(StringUtils.toString(map.get(FIELD_product_status)), productStatus));
setChangeType(NumberUtils.toInteger(StringUtils.toString(map.get(FIELD_change_type)), changeType));
setQuantity(NumberUtils.toInteger(StringUtils.toString(map.get(FIELD_quantity)), quantity));
setSingleWeight(NumberUtils.toBigDecimal(StringUtils.toString(map.get(FIELD_single_weight)), singleWeight));
setTotalWeight(NumberUtils.toBigDecimal(StringUtils.toString(map.get(FIELD_total_weight)), totalWeight));
setApprovalStatus(NumberUtils.toInteger(StringUtils.toString(map.get(FIELD_approval_status)), approvalStatus));
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_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_parent_prod_code, StringUtils.toString(parentProdCode, eiMetadata.getMeta(FIELD_parent_prod_code)));
map.put(FIELD_parent_prod_name, StringUtils.toString(parentProdName, eiMetadata.getMeta(FIELD_parent_prod_name)));
map.put(FIELD_leaf, StringUtils.toString(leaf, eiMetadata.getMeta(FIELD_leaf)));
map.put(FIELD_sort, StringUtils.toString(sort, eiMetadata.getMeta(FIELD_sort)));
map.put(FIELD_lv, StringUtils.toString(lv, eiMetadata.getMeta(FIELD_lv)));
map.put(FIELD_material_id, StringUtils.toString(materialId, eiMetadata.getMeta(FIELD_material_id)));
map.put(FIELD_product_code, StringUtils.toString(productCode, eiMetadata.getMeta(FIELD_product_code)));
map.put(FIELD_product_name, StringUtils.toString(productName, eiMetadata.getMeta(FIELD_product_name)));
map.put(FIELD_product_id, StringUtils.toString(productId, eiMetadata.getMeta(FIELD_product_id)));
map.put(FIELD_product_type, StringUtils.toString(productName, eiMetadata.getMeta(FIELD_product_type)));
map.put(FIELD_product_status, StringUtils.toString(productStatus, eiMetadata.getMeta(FIELD_product_status)));
map.put(FIELD_change_type, StringUtils.toString(changeType, eiMetadata.getMeta(FIELD_change_type)));
map.put(FIELD_quantity, StringUtils.toString(quantity, eiMetadata.getMeta(FIELD_quantity)));
map.put(FIELD_single_weight, StringUtils.toString(singleWeight, eiMetadata.getMeta(FIELD_single_weight)));
map.put(FIELD_total_weight, StringUtils.toString(totalWeight, eiMetadata.getMeta(FIELD_total_weight)));
map.put(FIELD_approval_status, StringUtils.toString(approvalStatus, eiMetadata.getMeta(FIELD_approval_status)));
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 java.math.BigDecimal;
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:Hgsc004b.java <br>
* Description: <br>
*
* Copyrigth:Baosight Software LTD.co Copyright (c) 2019. <br>
*
* @version 1.0
* @history 2024-05-16 14:38:56 create
*/
public class HGSC004B extends DaoEPBase {
private static final long serialVersionUID = 1L;
public static final String FIELD_id = "id"; /* 主键*/
public static final String FIELD_product_id = "productId"; /* 变更产品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_proj_code = "projCode"; /* 项目编码(预留)*/
public static final String FIELD_proj_name = "projName"; /* 项目名称(预留)*/
public static final String FIELD_parent_prod_code = "parentProdCode"; /* 父节点-产品编码*/
public static final String FIELD_parent_prod_name = "parentProdName"; /* 父节点-产品名称*/
public static final String FIELD_material_id = "materialId"; /* 物料清单id*/
public static final String FIELD_product_code = "productCode"; /* 产品编号*/
public static final String FIELD_product_name = "productName"; /* 产品名称*/
public static final String FIELD_product_status = "productStatus"; /* 产品状态 0:未提交,1:已提交*/
public static final String FIELD_change_type = "changeType"; /* 变更类型:默认0,1:增加,2:替换,3:删除*/
public static final String FIELD_quantity = "quantity"; /* 数量*/
public static final String FIELD_single_weight = "singleWeight"; /* 单重*/
public static final String FIELD_total_weight = "totalWeight"; /* 总重*/
public static final String FIELD_approval_status = "approvalStatus"; /* 审批状态\t0:待审;1:审核中;2:已审*/
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_product_id = "product_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_proj_code = "proj_code"; /* 项目编码(预留)*/
public static final String COL_proj_name = "proj_name"; /* 项目名称(预留)*/
public static final String COL_parent_prod_code = "parent_prod_code"; /* 父节点-产品编码*/
public static final String COL_parent_prod_name = "parent_prod_name"; /* 父节点-产品名称*/
public static final String COL_material_id = "material_id"; /* 物料清单id*/
public static final String COL_product_code = "product_code"; /* 产品编号*/
public static final String COL_product_name = "product_name"; /* 产品名称*/
public static final String COL_product_status = "product_status"; /* 产品状态 0:未提交,1:已提交*/
public static final String COL_change_type = "change_type"; /* 变更类型:默认0,1:增加,2:替换,3:删除*/
public static final String COL_quantity = "quantity"; /* 数量*/
public static final String COL_single_weight = "single_weight"; /* 单重*/
public static final String COL_total_weight = "total_weight"; /* 总重*/
public static final String COL_approval_status = "approval_status"; /* 审批状态\t0:待审;1:审核中;2:已审*/
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 = "HGSC004B.query";
public static final String COUNT = "HGSC004B.count";
public static final String INSERT = "HGSC004B.insert";
public static final String UPDATE = "HGSC004B.update";
public static final String DELETE = "HGSC004B.delete";
private Long id = new Long(0); /* 主键*/
private Long productId = new Long(0); /* 变更产品id*/
private String companyCode = " "; /* 公司编码(预留)*/
private String companyName = " "; /* 公司名称(预留)*/
private String depCode = " "; /* 部门编号(预留)*/
private String depName = " "; /* 部门名称(预留)*/
private String projCode = " "; /* 项目编码(预留)*/
private String projName = " "; /* 项目名称(预留)*/
private String parentProdCode = " "; /* 父节点-产品编码*/
private String parentProdName = " "; /* 父节点-产品名称*/
private Long materialId = new Long(0); /* 物料清单id*/
private String productCode = " "; /* 产品编号*/
private String productName = " "; /* 产品名称*/
private Integer productStatus = new Integer(0); /* 产品状态 0:未提交,1:已提交*/
private Integer changeType = new Integer(0); /* 变更类型:默认0,1:增加,2:替换,3:删除*/
private Integer quantity = new Integer(0); /* 数量*/
private BigDecimal singleWeight = new BigDecimal(0.000); /* 单重*/
private BigDecimal totalWeight = new BigDecimal(0.000); /* 总重*/
private Integer approvalStatus = new Integer(0); /* 审批状态\t0:待审;1:审核中;2:已审*/
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.setType("N");
eiColumn.setScaleLength(0);
eiColumn.setFieldLength(20);
eiColumn.setDescName("主键");
eiMetadata.addMeta(eiColumn);
eiColumn = new EiColumn(FIELD_product_id);
eiColumn.setType("N");
eiColumn.setScaleLength(0);
eiColumn.setFieldLength(20);
eiColumn.setDescName("变更产品id");
eiMetadata.addMeta(eiColumn);
eiColumn = new EiColumn(FIELD_company_code);
eiColumn.setFieldLength(32);
eiColumn.setDescName("公司编码(预留)");
eiMetadata.addMeta(eiColumn);
eiColumn = new EiColumn(FIELD_company_name);
eiColumn.setFieldLength(32);
eiColumn.setDescName("公司名称(预留)");
eiMetadata.addMeta(eiColumn);
eiColumn = new EiColumn(FIELD_dep_code);
eiColumn.setFieldLength(20);
eiColumn.setDescName("部门编号(预留)");
eiMetadata.addMeta(eiColumn);
eiColumn = new EiColumn(FIELD_dep_name);
eiColumn.setFieldLength(32);
eiColumn.setDescName("部门名称(预留)");
eiMetadata.addMeta(eiColumn);
eiColumn = new EiColumn(FIELD_proj_code);
eiColumn.setFieldLength(20);
eiColumn.setDescName("项目编码(预留)");
eiMetadata.addMeta(eiColumn);
eiColumn = new EiColumn(FIELD_proj_name);
eiColumn.setFieldLength(50);
eiColumn.setDescName("项目名称(预留)");
eiMetadata.addMeta(eiColumn);
eiColumn = new EiColumn(FIELD_parent_prod_code);
eiColumn.setFieldLength(32);
eiColumn.setDescName("父节点-产品编码");
eiMetadata.addMeta(eiColumn);
eiColumn = new EiColumn(FIELD_parent_prod_name);
eiColumn.setFieldLength(50);
eiColumn.setDescName("父节点-产品名称");
eiMetadata.addMeta(eiColumn);
eiColumn = new EiColumn(FIELD_material_id);
eiColumn.setType("N");
eiColumn.setScaleLength(0);
eiColumn.setFieldLength(20);
eiColumn.setDescName("物料清单id");
eiMetadata.addMeta(eiColumn);
eiColumn = new EiColumn(FIELD_product_code);
eiColumn.setFieldLength(32);
eiColumn.setDescName("产品编号");
eiMetadata.addMeta(eiColumn);
eiColumn = new EiColumn(FIELD_product_name);
eiColumn.setFieldLength(50);
eiColumn.setDescName("产品名称");
eiMetadata.addMeta(eiColumn);
eiColumn = new EiColumn(FIELD_product_status);
eiColumn.setType("N");
eiColumn.setScaleLength(0);
eiColumn.setFieldLength(4);
eiColumn.setDescName("产品状态 0:未提交,1:已提交");
eiMetadata.addMeta(eiColumn);
eiColumn = new EiColumn(FIELD_change_type);
eiColumn.setType("N");
eiColumn.setScaleLength(0);
eiColumn.setFieldLength(4);
eiColumn.setDescName("变更类型:默认0,1:增加,2:替换,3:删除");
eiMetadata.addMeta(eiColumn);
eiColumn = new EiColumn(FIELD_quantity);
eiColumn.setType("N");
eiColumn.setScaleLength(0);
eiColumn.setFieldLength(8);
eiColumn.setDescName("数量");
eiMetadata.addMeta(eiColumn);
eiColumn = new EiColumn(FIELD_single_weight);
eiColumn.setType("N");
eiColumn.setScaleLength(3);
eiColumn.setFieldLength(20);
eiColumn.setDescName("单重");
eiMetadata.addMeta(eiColumn);
eiColumn = new EiColumn(FIELD_total_weight);
eiColumn.setType("N");
eiColumn.setScaleLength(3);
eiColumn.setFieldLength(20);
eiColumn.setDescName("总重");
eiMetadata.addMeta(eiColumn);
eiColumn = new EiColumn(FIELD_approval_status);
eiColumn.setType("N");
eiColumn.setScaleLength(0);
eiColumn.setFieldLength(4);
eiColumn.setDescName("审批状态\t0:待审;1:审核中;2:已审");
eiMetadata.addMeta(eiColumn);
eiColumn = new EiColumn(FIELD_account_code);
eiColumn.setFieldLength(32);
eiColumn.setDescName("帐套");
eiMetadata.addMeta(eiColumn);
eiColumn = new EiColumn(FIELD_created_by);
eiColumn.setFieldLength(32);
eiColumn.setDescName("创建人");
eiMetadata.addMeta(eiColumn);
eiColumn = new EiColumn(FIELD_created_name);
eiColumn.setFieldLength(32);
eiColumn.setDescName("创建人名称");
eiMetadata.addMeta(eiColumn);
eiColumn = new EiColumn(FIELD_created_time);
eiColumn.setFieldLength(14);
eiColumn.setDescName("创建时间");
eiMetadata.addMeta(eiColumn);
eiColumn = new EiColumn(FIELD_updated_by);
eiColumn.setFieldLength(32);
eiColumn.setDescName("更新人");
eiMetadata.addMeta(eiColumn);
eiColumn = new EiColumn(FIELD_updated_name);
eiColumn.setFieldLength(32);
eiColumn.setDescName("修改人名称");
eiMetadata.addMeta(eiColumn);
eiColumn = new EiColumn(FIELD_updated_time);
eiColumn.setFieldLength(14);
eiColumn.setDescName("更新时间");
eiMetadata.addMeta(eiColumn);
}
/**
* the constructor.
*/
public HGSC004B() {
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 productId - 变更产品id.
* @return the productId
*/
public Long getProductId() {
return this.productId;
}
/**
* set the productId - 变更产品id.
*
* @param productId - 变更产品id
*/
public void setProductId(Long productId) {
this.productId = productId;
}
/**
* 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 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 parentProdCode - 父节点-产品编码.
* @return the parentProdCode
*/
public String getParentProdCode() {
return this.parentProdCode;
}
/**
* set the parentProdCode - 父节点-产品编码.
*
* @param parentProdCode - 父节点-产品编码
*/
public void setParentProdCode(String parentProdCode) {
this.parentProdCode = parentProdCode;
}
/**
* get the parentProdName - 父节点-产品名称.
* @return the parentProdName
*/
public String getParentProdName() {
return this.parentProdName;
}
/**
* set the parentProdName - 父节点-产品名称.
*
* @param parentProdName - 父节点-产品名称
*/
public void setParentProdName(String parentProdName) {
this.parentProdName = parentProdName;
}
/**
* get the materialId - 物料清单id.
* @return the materialId
*/
public Long getMaterialId() {
return this.materialId;
}
/**
* set the materialId - 物料清单id.
*
* @param materialId - 物料清单id
*/
public void setMaterialId(Long materialId) {
this.materialId = materialId;
}
/**
* get the productCode - 产品编号.
* @return the productCode
*/
public String getProductCode() {
return this.productCode;
}
/**
* set the productCode - 产品编号.
*
* @param productCode - 产品编号
*/
public void setProductCode(String productCode) {
this.productCode = productCode;
}
/**
* get the productName - 产品名称.
* @return the productName
*/
public String getProductName() {
return this.productName;
}
/**
* set the productName - 产品名称.
*
* @param productName - 产品名称
*/
public void setProductName(String productName) {
this.productName = productName;
}
/**
* get the productStatus - 产品状态 0:未提交,1:已提交.
* @return the productStatus
*/
public Integer getProductStatus() {
return this.productStatus;
}
/**
* set the productStatus - 产品状态 0:未提交,1:已提交.
*
* @param productStatus - 产品状态 0:未提交,1:已提交
*/
public void setProductStatus(Integer productStatus) {
this.productStatus = productStatus;
}
/**
* get the changeType - 变更类型:默认0,1:增加,2:替换,3:删除.
* @return the changeType
*/
public Integer getChangeType() {
return this.changeType;
}
/**
* set the changeType - 变更类型:默认0,1:增加,2:替换,3:删除.
*
* @param changeType - 变更类型:默认0,1:增加,2:替换,3:删除
*/
public void setChangeType(Integer changeType) {
this.changeType = changeType;
}
/**
* get the quantity - 数量.
* @return the quantity
*/
public Integer getQuantity() {
return this.quantity;
}
/**
* set the quantity - 数量.
*
* @param quantity - 数量
*/
public void setQuantity(Integer quantity) {
this.quantity = quantity;
}
/**
* get the singleWeight - 单重.
* @return the singleWeight
*/
public BigDecimal getSingleWeight() {
return this.singleWeight;
}
/**
* set the singleWeight - 单重.
*
* @param singleWeight - 单重
*/
public void setSingleWeight(BigDecimal singleWeight) {
this.singleWeight = singleWeight;
}
/**
* get the totalWeight - 总重.
* @return the totalWeight
*/
public BigDecimal getTotalWeight() {
return this.totalWeight;
}
/**
* set the totalWeight - 总重.
*
* @param totalWeight - 总重
*/
public void setTotalWeight(BigDecimal totalWeight) {
this.totalWeight = totalWeight;
}
/**
* 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 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));
setProductId(NumberUtils.toLong(StringUtils.toString(map.get(FIELD_product_id)), productId));
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));
setProjCode(StringUtils.defaultIfEmpty(StringUtils.toString(map.get(FIELD_proj_code)), projCode));
setProjName(StringUtils.defaultIfEmpty(StringUtils.toString(map.get(FIELD_proj_name)), projName));
setParentProdCode(StringUtils.defaultIfEmpty(StringUtils.toString(map.get(FIELD_parent_prod_code)), parentProdCode));
setParentProdName(StringUtils.defaultIfEmpty(StringUtils.toString(map.get(FIELD_parent_prod_name)), parentProdName));
setMaterialId(NumberUtils.toLong(StringUtils.toString(map.get(FIELD_material_id)), materialId));
setProductCode(StringUtils.defaultIfEmpty(StringUtils.toString(map.get(FIELD_product_code)), productCode));
setProductName(StringUtils.defaultIfEmpty(StringUtils.toString(map.get(FIELD_product_name)), productName));
setProductStatus(NumberUtils.toInteger(StringUtils.toString(map.get(FIELD_product_status)), productStatus));
setChangeType(NumberUtils.toInteger(StringUtils.toString(map.get(FIELD_change_type)), changeType));
setQuantity(NumberUtils.toInteger(StringUtils.toString(map.get(FIELD_quantity)), quantity));
setSingleWeight(NumberUtils.toBigDecimal(StringUtils.toString(map.get(FIELD_single_weight)), singleWeight));
setTotalWeight(NumberUtils.toBigDecimal(StringUtils.toString(map.get(FIELD_total_weight)), totalWeight));
setApprovalStatus(NumberUtils.toInteger(StringUtils.toString(map.get(FIELD_approval_status)), approvalStatus));
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_product_id, StringUtils.toString(productId, eiMetadata.getMeta(FIELD_product_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_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_parent_prod_code, StringUtils.toString(parentProdCode, eiMetadata.getMeta(FIELD_parent_prod_code)));
map.put(FIELD_parent_prod_name, StringUtils.toString(parentProdName, eiMetadata.getMeta(FIELD_parent_prod_name)));
map.put(FIELD_material_id, StringUtils.toString(materialId, eiMetadata.getMeta(FIELD_material_id)));
map.put(FIELD_product_code, StringUtils.toString(productCode, eiMetadata.getMeta(FIELD_product_code)));
map.put(FIELD_product_name, StringUtils.toString(productName, eiMetadata.getMeta(FIELD_product_name)));
map.put(FIELD_product_status, StringUtils.toString(productStatus, eiMetadata.getMeta(FIELD_product_status)));
map.put(FIELD_change_type, StringUtils.toString(changeType, eiMetadata.getMeta(FIELD_change_type)));
map.put(FIELD_quantity, StringUtils.toString(quantity, eiMetadata.getMeta(FIELD_quantity)));
map.put(FIELD_single_weight, StringUtils.toString(singleWeight, eiMetadata.getMeta(FIELD_single_weight)));
map.put(FIELD_total_weight, StringUtils.toString(totalWeight, eiMetadata.getMeta(FIELD_total_weight)));
map.put(FIELD_approval_status, StringUtils.toString(approvalStatus, eiMetadata.getMeta(FIELD_approval_status)));
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;
}
}
......@@ -60,7 +60,6 @@ public class ServiceHGSC003 extends ServiceBase {
// 蓝图ids
List<Long> ids = ObjectUtils.listKey(resultRows, HGSC003.FIELD_id);
DaoUtils.update(HGSC003.BATCH_DELETE, new HashMap<String,Object>(){{put("ids",ids);}});
// HGSCTools.THGSC003A.deleteByProIds(ids);
inInfo = this.query(inInfo);
inInfo.setStatus(EiConstant.STATUS_DEFAULT);
inInfo.setMsg("操作成功!本次对[" + resultRows.size() + "]条数据删除成功!");
......@@ -121,7 +120,11 @@ public class ServiceHGSC003 extends ServiceBase {
map.put("projCode",hgsc003.getProjCode());
List<HGSC003> oldHgsc003List = this.dao.query(HGSC003.QUERY,map);
for(HGSC003 o : oldHgsc003List){
AssertUtils.isTrue(!(o.getId().intValue() == hgsc003.getId().intValue()),"已存在此项目号的蓝图!");
if(Objects.nonNull(hgsc003.getId())&&hgsc003.getId()>0){
AssertUtils.isTrue(!(o.getId().intValue() == hgsc003.getId().intValue()),"已存在此项目号的蓝图!");
}else{
AssertUtils.isTrue(Objects.nonNull(o),"已存在此项目号的蓝图!");
}
}
AssertUtils.isEmpty(UserSessionUtils.getAccountCode(), "当前用户未绑定公司,无法操作数据,请联系管理员!");
......@@ -178,5 +181,22 @@ public class ServiceHGSC003 extends ServiceBase {
}
/**
* 蓝图查询下拉框
* @param inInfo
* @return
*/
public EiInfo blueprintComboBox(EiInfo inInfo){
Map queryMap = EiInfoUtils.getFirstRow(inInfo);
String companyCode = MapUtils.getString(queryMap, HGSC003.FIELD_company_code);
String blueprintStatus = MapUtils.getString(queryMap, HGSC003.FIELD_blueprint_status);
Map map = new HashMap();
map.put(HGSC003.FIELD_account_code, UserSessionUtils.getAccountCode());
map.put(HGSC003.FIELD_company_code, companyCode);
map.put(HGSC003.FIELD_blueprint_status, blueprintStatus);
CommonMethod.initBlock(inInfo, Arrays.asList(DdynamicEnum.BLUEPRINT_BOX_BLOCK_ID), map,false);
return inInfo;
}
}
package com.baosight.hggp.hg.sc.service;
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.HGSC003;
import com.baosight.hggp.hg.sc.domain.HGSC003A;
import com.baosight.hggp.util.*;
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.*;
/**
* @Author jhs
* @Date 2024/5/14 14:46
*/
public class ServiceHGSC003A extends ServiceBase {
public EiInfo initLoad(EiInfo inInfo) {
try {
inInfo = super.query(inInfo, HGSC003A.QUERY, new HGSC003A());
} catch (PlatException e) {
LogUtils.setDetailMsg(inInfo, e, "初始化失败");
}
return inInfo;
}
public EiInfo query(EiInfo inInfo) {
try {
inInfo = super.query(inInfo, HGSC003A.QUERY, new HGSC003A());
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();
// 蓝图ids
List<Long> ids = ObjectUtils.listKey(resultRows, HGSC003A.FIELD_id);
DaoUtils.update(HGSC003A.BATCH_DELETE, new HashMap<String,Object>(){{put("ids",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);
HGSC003A hgsc003a = new HGSC003A();
hgsc003a.fromMap(resultMap);
//查询蓝图
HGSC003 hgsc003 = (HGSC003) super.dao.get(HGSC003.QUERY,HGSC003.FIELD_id,hgsc003a.getBlueprintId());
//复制蓝图基本信息
hgsc003a.setCompanyCode(hgsc003.getCompanyCode());
hgsc003a.setCompanyName(hgsc003.getCompanyName());
hgsc003a.setDepCode(hgsc003.getDepCode());
hgsc003a.setDepName(hgsc003.getDepName());
hgsc003a.setProjCode(hgsc003.getProjCode());
hgsc003a.setProjName(hgsc003.getProjName());
this.checkSaveData(hgsc003a,hgsc003);
if(Objects.nonNull(hgsc003a.getId())&&hgsc003a.getId()!=0){
DaoUtils.update(HGSC003A.UPDATE, hgsc003a);
}else {
DaoUtils.insert(HGSC003A.INSERT, hgsc003a);
}
inInfo.setStatus(EiConstant.STATUS_DEFAULT);
inInfo.setMsg("保存成功!");
} catch (Exception e) {
LogUtils.setDetailMsg(inInfo, e, "保存失败");
}
return inInfo;
}
/**
* 校验保存的数据
*
* @param hgsc003a
*/
private void checkSaveData(HGSC003A hgsc003a,HGSC003 hgsc003) {
if(Objects.nonNull(hgsc003a.getId())&&hgsc003a.getId()>0){
AssertUtils.isTrue(hgsc003.getBlueprintStatus().compareTo(HGConstant.EnablingStatus.TY) == 0,"蓝图已停用不可修改!");
}
AssertUtils.isEmpty(hgsc003a.getDrawingCode(), "请填写图号!");
AssertUtils.isEmpty(hgsc003a.getDrawingName(), "请填写图纸名称!");
Map<String,Object> map = new HashMap<>();
map.put("blueprintId",hgsc003a.getBlueprintId());
map.put("drawingCode",hgsc003a.getDrawingCode());
List<HGSC003A> oldhgsc003aList = this.dao.query(HGSC003A.QUERY,map);
for(HGSC003A o : oldhgsc003aList){
AssertUtils.isTrue(!(o.getId().intValue() == hgsc003a.getId().intValue()),"当前图号已存在!");
}
AssertUtils.isEmpty(UserSessionUtils.getAccountCode(), "当前用户未绑定公司,无法操作数据,请联系管理员!");
AssertUtils.isEmpty(UserSessionUtils.getOrgId(), "当前用户未绑定部门,无法操作数据,请联系管理员!");
AssertUtils.isEmpty(hgsc003a.getCompanyCode(), "请选择公司!");
AssertUtils.isEmpty(hgsc003a.getProjCode(), "请填写项目编号!");
AssertUtils.isEmpty(hgsc003a.getProjName(), "请填写项目名称!");
AssertUtils.isEmpty(hgsc003a.getBlueprintName(), "请填写蓝图名称!");
}
}
package com.baosight.hggp.hg.sc.service;
import cn.hutool.core.bean.BeanUtil;
import com.baosight.hggp.common.DdynamicEnum;
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.HGSC003;
import com.baosight.hggp.hg.sc.domain.HGSC004;
import com.baosight.hggp.hg.sc.domain.HGSC004A;
import com.baosight.hggp.util.*;
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 org.springframework.util.CollectionUtils;
import java.util.*;
import java.util.stream.Collectors;
/**
* @Author jhs
* @Date 2024/5/14 14:46
*/
public class ServiceHGSC004 extends ServiceBase {
public EiInfo initLoad(EiInfo inInfo) {
try {
inInfo = super.query(inInfo, HGSC004.QUERY, new HGSC004());
Map map = new HashMap();
map.put(HGSC004.FIELD_account_code, UserSessionUtils.getAccountCode());
map.put(HGSC003.FIELD_blueprint_status, HGConstant.EnablingStatus.QY);
CommonMethod.initBlock(inInfo,
Arrays.asList(DdynamicEnum.COMPANY_BOX_BLOCK_ID,DdynamicEnum.PROJ_RECORD_BLOCK_ID,DdynamicEnum.BLUEPRINT_BOX_BLOCK_ID),map,false
);
} catch (PlatException e) {
LogUtils.setDetailMsg(inInfo, e, "初始化失败");
}
return inInfo;
}
public EiInfo query(EiInfo inInfo) {
try {
inInfo = super.query(inInfo, HGSC004.QUERY, new HGSC004());
Map map = new HashMap();
map.put(HGSC004.FIELD_account_code, UserSessionUtils.getAccountCode());
map.put(HGSC003.FIELD_blueprint_status, HGConstant.EnablingStatus.QY);
CommonMethod.initBlock(inInfo,
Arrays.asList(DdynamicEnum.COMPANY_BOX_BLOCK_ID,DdynamicEnum.PROJ_RECORD_BLOCK_ID,DdynamicEnum.BLUEPRINT_BOX_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();
// 蓝图ids
List<Long> ids = ObjectUtils.listKey(resultRows, HGSC004.FIELD_id);
//变更清单里面的公司、项目信息
Map<String,Object> map = new HashMap<>();
map.put("ids",ids);
List<HGSC004> hgsc004List = this.dao.query(HGSC004.QUERY,map, 0, -999999);
for(HGSC004 hgsc004 : hgsc004List){
//如果
if(hgsc004.getMaterialStatus().intValue() == HGConstant.MaterialStatus.WTJ.intValue()){
//变更清单里面的公司、项目信息
Map<String,Object> mapA = new HashMap<>();
mapA.put("materialIds",ids);
List<HGSC004A> hgsc004AList = dao.query(HGSC004A.QUERY_ALL,mapA, 0, -999999);
if(!CollectionUtils.isEmpty(hgsc004AList)){
List<Long> detailIds = hgsc004AList.stream().map(HGSC004A::getId).collect(Collectors.toList());
DaoUtils.update(HGSC004A.BATCH_DELETE, new HashMap<String,Object>(){{put("ids",detailIds);}});
}
DaoUtils.update(HGSC004.DELETE, hgsc004);
}else{
DaoUtils.update(HGSC004.UPDATE_DEL, hgsc004);
}
}
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);
HGSC004 hgsc004 = new HGSC004();
hgsc004.fromMap(resultMap);
HGSC003 hgsc003 = (HGSC003) super.dao.get(HGSC003.QUERY,HGSC004.FIELD_blueprint_code,hgsc004.getBlueprintCode());
hgsc004.setBlueprintId(hgsc003.getId());
this.checkSaveData(hgsc004,hgsc003);
if(Objects.nonNull(hgsc004.getId())&&hgsc004.getId()!=0){
DaoUtils.update(HGSC004.UPDATE, hgsc004);
//变更清单里面的公司、项目信息
Map<String,Object> map = new HashMap<>();
map.put("materialId",hgsc004.getId());
List<HGSC004A> hgsc004AList = dao.query(HGSC004A.QUERY_ALL,map, 0, -999999);
hgsc004AList.forEach(o->{
o.setProjCode(hgsc004.getProjCode());
o.setProjName(hgsc004.getProjName());
o.setCompanyCode(hgsc004.getCompanyCode());
o.setCompanyName(hgsc004.getCompanyName());
});
DaoUtils.updateBatch(HGSC004A.UPDATE, hgsc004AList);
}else {
hgsc004.setMaterialStatus(HGConstant.MaterialStatus.WTJ);
DaoUtils.insert(HGSC004.INSERT, hgsc004);
this.insertTree(hgsc004);
}
inInfo.setStatus(EiConstant.STATUS_DEFAULT);
inInfo.setMsg("保存成功!");
} catch (Exception e) {
LogUtils.setDetailMsg(inInfo, e, "保存失败");
}
return inInfo;
}
/**
* 校验保存的数据
*
* @param hgsc004
*/
private void checkSaveData(HGSC004 hgsc004,HGSC003 hgsc003) {
if(Objects.nonNull(hgsc004.getId())&&hgsc004.getId()>0){
AssertUtils.isTrue(hgsc004.getMaterialStatus().compareTo(HGConstant.MaterialStatus.WTJ) > 0,"非未提交不可修改!");
AssertUtils.isTrue(hgsc003.getBlueprintStatus().compareTo(HGConstant.EnablingStatus.TY) == 0,"蓝图已停用不可修改!");
}
Map<String,Object> map = new HashMap<>();
map.put("blueprintId",hgsc004.getBlueprintId());
List<HGSC004> hgsc004List = this.dao.query(HGSC004.QUERY,map);
for(HGSC004 o : hgsc004List){
if(Objects.nonNull(hgsc004.getId())&&hgsc004.getId()>0){
AssertUtils.isTrue(!(o.getId().intValue() == hgsc004.getId().intValue()),"当前蓝图已存在!");
}else{
AssertUtils.isTrue(Objects.nonNull(o),"当前蓝图已存在!");
}
}
AssertUtils.isEmpty(UserSessionUtils.getAccountCode(), "当前用户未绑定公司,无法操作数据,请联系管理员!");
AssertUtils.isEmpty(UserSessionUtils.getOrgId(), "当前用户未绑定部门,无法操作数据,请联系管理员!");
AssertUtils.isEmpty(hgsc004.getCompanyCode(), "请选择公司!");
AssertUtils.isEmpty(hgsc004.getProjCode(), "请填写项目编号!");
AssertUtils.isEmpty(hgsc004.getProjName(), "请填写项目名称!");
AssertUtils.isEmpty(hgsc004.getBlueprintName(), "请填写蓝图名称!");
}
/**
* 录入树结构
*
* @param hgsc004
*/
private void insertTree(HGSC004 hgsc004) {
//变更清单里面的公司、项目信息
Map<String,Object> map = new HashMap<>();
map.put("companyCode",hgsc004.getCompanyCode());
map.put("projCode",hgsc004.getProjCode());
List<HGSC004A> hgsc004AList = dao.query(HGSC004A.QUERY_ALL,map, 0, -999999);
if(CollectionUtils.isEmpty(hgsc004AList)){
//录入树结构,公司
HGSC004A rootHgsc004A = new HGSC004A();
BeanUtil.copyProperties(hgsc004,rootHgsc004A,"id");
//因为获取不到id,所以根据公司编号+项目编号得到树结构
rootHgsc004A.setMaterialId(hgsc004.getId());
rootHgsc004A.setParentProdCode("root");
rootHgsc004A.setParentProdName(hgsc004.getCompanyName());
rootHgsc004A.setLeaf(2);//有叶子节点
rootHgsc004A.setLv(1);
rootHgsc004A.setSort(1);
rootHgsc004A.setProductCode(hgsc004.getCompanyCode());
rootHgsc004A.setProductName(hgsc004.getCompanyName());
DaoUtils.insert(HGSC004A.INSERT, rootHgsc004A);
//录入2级目录,项目
HGSC004A projectHgsc004A = new HGSC004A();
BeanUtil.copyProperties(hgsc004,projectHgsc004A,"id");
projectHgsc004A.setMaterialId(hgsc004.getId());
projectHgsc004A.setParentProdCode(rootHgsc004A.getProductCode());
projectHgsc004A.setParentProdName(rootHgsc004A.getProductName());
projectHgsc004A.setLeaf(2);//有叶子节点
projectHgsc004A.setLv(2);
projectHgsc004A.setSort(1);
projectHgsc004A.setProductCode(hgsc004.getProjCode());
projectHgsc004A.setProductName(hgsc004.getProjName());
DaoUtils.insert(HGSC004A.INSERT, projectHgsc004A);
}
}
}
package com.baosight.hggp.hg.sc.service;
import com.baosight.hggp.aspect.annotation.OperationLogAnnotation;
import com.baosight.hggp.common.DdynamicEnum;
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.pz.domain.HGPZ005A;
import com.baosight.hggp.hg.sc.domain.HGSC001;
import com.baosight.hggp.hg.sc.domain.HGSC003;
import com.baosight.hggp.hg.sc.domain.HGSC004;
import com.baosight.hggp.hg.sc.domain.HGSC004A;
import com.baosight.hggp.util.*;
import com.baosight.hggp.util.contants.ACConstants;
import com.baosight.iplat4j.core.ei.EiBlock;
import com.baosight.iplat4j.core.ei.EiConstant;
import com.baosight.iplat4j.core.ei.EiInfo;
import com.baosight.iplat4j.core.exception.PlatException;
import com.baosight.iplat4j.core.resource.I18nMessages;
import com.baosight.iplat4j.core.service.impl.ServiceBase;
import com.baosight.iplat4j.core.util.StringUtils;
import org.springframework.util.CollectionUtils;
import java.util.*;
/**
* @Author jhs
* @Date 2024/5/14 14:46
*/
public class ServiceHGSC004A extends ServiceBase {
public EiInfo initLoad(EiInfo inInfo) {
try {
inInfo = super.query(inInfo, HGSC004A.QUERY, new HGSC004A());
Map map = new HashMap();
map.put(HGSC004A.FIELD_account_code, UserSessionUtils.getAccountCode());
CommonMethod.initBlock(inInfo,
Arrays.asList(DdynamicEnum.PRODUCT_BLOCK_ID),map,false
);
} catch (PlatException e) {
LogUtils.setDetailMsg(inInfo, e, "初始化失败");
}
return inInfo;
}
public EiInfo query(EiInfo inInfo) {
try {
inInfo = super.query(inInfo, HGSC004A.QUERY, new HGSC004A());
Map map = new HashMap();
map.put(HGSC004A.FIELD_account_code, UserSessionUtils.getAccountCode());
CommonMethod.initBlock(inInfo,
Arrays.asList(DdynamicEnum.PRODUCT_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();
// 蓝图ids
List<Long> ids = ObjectUtils.listKey(resultRows, HGSC004A.FIELD_id);
DaoUtils.update(HGSC004A.BATCH_DELETE, new HashMap<String,Object>(){{put("ids",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);
HGSC004A hgsc004a = new HGSC004A();
hgsc004a.fromMap(resultMap);
//蓝图信息,用于蓝图状态校验
HGSC003 hgsc003 = (HGSC003) super.dao.get(HGSC003.QUERY,HGSC004A.FIELD_id,hgsc004a.getId());
//主表信息,用于取值
Long materialId = Long.valueOf(inInfo.getCellStr(EiConstant.queryBlock, ACConstants.ROW_CODE_0, HGSC004A.FIELD_material_id));
HGSC004 hgsc004 = (HGSC004) super.dao.get(HGSC004.QUERY,HGSC004A.FIELD_id,materialId);
if(Objects.nonNull(hgsc004)){
hgsc004a.setCompanyCode(hgsc004.getCompanyCode());
hgsc004a.setCompanyName(hgsc004.getCompanyName());
hgsc004a.setProjCode(hgsc004.getProjCode());
hgsc004a.setProjName(hgsc004.getProjName());
hgsc004a.setDepCode(hgsc004.getDepCode());
hgsc004a.setDepName(hgsc004.getDepName());
hgsc004a.setMaterialId(hgsc004.getId());
hgsc004a.setLv(hgsc004a.getLv() + 1);
//不为4级都有叶子节点
if(hgsc004a.getLv().intValue() <= 4){
hgsc004a.setLeaf(2);
}else{
hgsc004a.setLeaf(1);
}
}
this.checkSaveData(hgsc004a,hgsc003);
if(Objects.nonNull(hgsc004a.getId())&&hgsc004a.getId()!=0){
DaoUtils.update(HGSC004A.UPDATE, hgsc004a);
}else {
hgsc004a.setProductStatus(HGConstant.ProductStatus.WTJ);
DaoUtils.insert(HGSC004A.INSERT, hgsc004a);
}
inInfo.setStatus(EiConstant.STATUS_DEFAULT);
inInfo.setMsg("保存成功!");
} catch (Exception e) {
LogUtils.setDetailMsg(inInfo, e, "保存失败");
}
return inInfo;
}
/**
* 校验保存的数据
*
* @param hgsc004a
*/
private void checkSaveData(HGSC004A hgsc004a,HGSC003 hgsc003) {
if(Objects.nonNull(hgsc004a.getId())&&hgsc004a.getId()>0){
AssertUtils.isTrue(hgsc003.getBlueprintStatus().compareTo(HGConstant.EnablingStatus.TY) == 0,"蓝图已停用不可修改!");
}
AssertUtils.isEmpty(UserSessionUtils.getAccountCode(), "当前用户未绑定公司,无法操作数据,请联系管理员!");
AssertUtils.isEmpty(UserSessionUtils.getOrgId(), "当前用户未绑定部门,无法操作数据,请联系管理员!");
AssertUtils.isEmpty(hgsc004a.getCompanyCode(), "请选择公司!");
AssertUtils.isEmpty(hgsc004a.getProjCode(), "请填写项目编号!");
AssertUtils.isEmpty(hgsc004a.getProjName(), "请填写项目名称!");
}
//树查询服务
public EiInfo queryTreeNode(EiInfo inInfo) {
Map queryRow = EiInfoUtils.getFirstRow(inInfo);
String node = MapUtils.getString(queryRow, "node");
//获取物料详情数据
String projCode = StringUtils.toString(inInfo.get("projCode"));
String companyCode = StringUtils.toString(inInfo.get("companyCode"));
Map queryMap = new HashMap();
queryMap.put("companyCode", com.baosight.hggp.util.StringUtils.isNotBlank(companyCode) ? companyCode : "null");
queryMap.put("projCode", com.baosight.hggp.util.StringUtils.isNotBlank(projCode) ? projCode : "null");
queryMap.put("pEname", "$".equals(node) ? "root" : node);
//2 查询节点
List rows = dao.query("HGSC004A.queryTree", queryMap);
//3 增加节点block块
EiInfo outInfo = new EiInfo();
EiBlock outBlock = outInfo.addBlock(node);
outBlock.addRows(rows);
return outInfo;
}
/**
* 下拉框
*
* @param inInfo
* @return
*/
@OperationLogAnnotation(operModul = "存货档案",operType = "查询",operDesc = "下拉框")
public EiInfo queryProductComboBox(EiInfo inInfo) {
try {
List<DdynamicEnum> list = new ArrayList<>();
list.add(DdynamicEnum.PRODUCT_BLOCK_ID);
CommonMethod.initBlock(inInfo, list, EiInfoUtils.getFirstRow(inInfo), false);
} catch (Exception e) {
LogUtils.setDetailMsg(inInfo, e, "查询存货档案失败");
}
return inInfo;
}
/**
* 修改提交状态
* @param inInfo
* @return
*/
public EiInfo updateProductStatus(EiInfo inInfo){
int i = 0;
try {
HGSC004A hgsc004a = new HGSC004A();
EiBlock eiBlock = inInfo.getBlock(EiConstant.resultBlock);
for (i = 0; i < eiBlock.getRowCount(); i++) {
Map<?, ?> map = eiBlock.getRow(i);
hgsc004a.fromMap(map);
DaoUtils.update(HGSC004A.UPDATE_PRODUCT_STATUS, hgsc004a);
}
HGSC004 hgsc004 = (HGSC004) super.dao.get(HGSC004.QUERY,HGSC001.FIELD_id,hgsc004a.getMaterialId());
if(Objects.nonNull(hgsc004)){
if(hgsc004.getMaterialStatus().intValue() == HGConstant.MaterialStatus.WTJ.intValue()){
//如果是未提交则修改为部分提交
hgsc004.setMaterialStatus(HGConstant.MaterialStatus.BFTJ);
DaoUtils.update(HGSC004.UPDATE_MATERIAL_STATUS, hgsc004);
}else if(hgsc004.getMaterialStatus().intValue() == HGConstant.MaterialStatus.BFTJ.intValue()){
//如果不存在未提交的,就标记主表为全部提交
Map<String,Object> mapA = new HashMap<>();
mapA.put("materialId",hgsc004a.getMaterialId());
mapA.put("productStatus",HGConstant.ProductStatus.WTJ);
mapA.put("notId",hgsc004a.getId());
List<HGSC004A> hgsc004AList = dao.query(HGSC004A.QUERY_ALL,mapA, 0, -999999);
if(!CollectionUtils.isEmpty(hgsc004AList)){
hgsc004.setMaterialStatus(HGConstant.MaterialStatus.QBTJ);
DaoUtils.update(HGSC004.UPDATE_MATERIAL_STATUS, hgsc004);
}
}
}
inInfo.setStatus(EiConstant.STATUS_SUCCESS);
inInfo.setMsgByKey("ep.1000", new String[]{String.valueOf(i), I18nMessages.getText("label.update", "修改")});
} catch (PlatException e) {
e.printStackTrace();
inInfo.setStatus(EiConstant.STATUS_FAILURE);
ErrorCodeUtils.handleUpdateException(inInfo,i,e);
logError("修改失败", e.getMessage());
return inInfo;
}
return inInfo;
}
}
......@@ -114,31 +114,30 @@
</insert>
<delete id="delete">
DELETE FROM ${hggpSchema}.HGSC003 WHERE
DELETE FROM ${hggpSchema}.HGSC003 WHERE id = #id#
</delete>
<update id="update">
UPDATE ${hggpSchema}.HGSC003
SET
id = #id#, <!-- 主键 -->
company_code = #companyCode#, <!-- 公司编码 -->
company_name = #companyName#, <!-- 公司名称 -->
dep_code = #depCode#, <!-- 部门编码 -->
dep_name = #depName#, <!-- 部门名称 -->
blueprint_code = #blueprintCode#, <!-- 蓝图编号 -->
blueprint_name = #blueprintName#, <!-- 蓝图名称 -->
proj_code = #projCode#, <!-- 项目编码 -->
proj_name = #projName#, <!-- 项目名称 -->
blueprint_status = #blueprintStatus#, <!-- 蓝图状态 0:停用,1:启用 -->
approval_status = #approvalStatus#, <!-- 审批状态 0:待审;1:审核中;2:已审 -->
account_code = #accountCode#, <!-- 帐套 -->
created_by = #createdBy#, <!-- 创建人 -->
created_name = #createdName#, <!-- 创建人名称 -->
created_time = #createdTime#, <!-- 创建时间 -->
updated_by = #updatedBy#, <!-- 更新人 -->
updated_name = #updatedName#, <!-- 修改人名称 -->
updated_time = #updatedTime# <!-- 更新时间 -->
WHERE
company_code = #companyCode#, <!-- 公司编码 -->
company_name = #companyName#, <!-- 公司名称 -->
dep_code = #depCode#, <!-- 部门编码 -->
dep_name = #depName#, <!-- 部门名称 -->
blueprint_code = #blueprintCode#, <!-- 蓝图编号 -->
blueprint_name = #blueprintName#, <!-- 蓝图名称 -->
proj_code = #projCode#, <!-- 项目编码 -->
proj_name = #projName#, <!-- 项目名称 -->
blueprint_status = #blueprintStatus#, <!-- 蓝图状态 0:停用,1:启用 -->
approval_status = #approvalStatus#, <!-- 审批状态 0:待审;1:审核中;2:已审 -->
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>
<delete id="batchDelete">
......@@ -167,4 +166,30 @@
WHERE
ID = #id#
</update>
<select id="queryComboBox" parameterClass="java.util.HashMap"
resultClass="java.util.HashMap">
SELECT DISTINCT
BLUEPRINT_CODE as "blueprintCode", <!-- 蓝图编号 -->
BLUEPRINT_NAME as "blueprintName" <!-- 蓝图名称 -->
FROM ${hggpSchema}.HGSC003
WHERE 1=1
<isNotEmpty prepend=" AND " property="accountCode">
ACCOUNT_CODE = #accountCode#
</isNotEmpty>
<isNotEmpty prepend=" AND " property="companyCode">
COMPANY_CODE = #companyCode#
</isNotEmpty>
<isNotEmpty prepend=" AND " property="projCode">
PROJ_CODE = #projCode#
</isNotEmpty>
<isNotEmpty prepend=" AND " property="companyCodes">
COMPANY_CODE IN <iterate close=")" open="(" conjunction="," property="companyCodes">#companyCodes[]#</iterate>
</isNotEmpty>
<isNotEmpty prepend=" AND " property="blueprintStatus">
BLUEPRINT_STATUS = #blueprintStatus#
</isNotEmpty>
ORDER BY BLUEPRINT_CODE
</select>
</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">
<sqlMap namespace="HGSC003A">
<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 = #companyName#
</isNotEmpty>
<isNotEmpty prepend=" AND " property="depCode">
dep_code = #depCode#
</isNotEmpty>
<isNotEmpty prepend=" AND " property="depName">
dep_name = #depName#
</isNotEmpty>
<isNotEmpty prepend=" AND " property="blueprintId">
blueprint_id = #blueprintId#
</isNotEmpty>
<isNotEmpty prepend=" AND " property="blueprintCode">
blueprint_code = #blueprintCode#
</isNotEmpty>
<isNotEmpty prepend=" AND " property="blueprintName">
blueprint_name = #blueprintName#
</isNotEmpty>
<isNotEmpty prepend=" AND " property="projCode">
proj_code = #projCode#
</isNotEmpty>
<isNotEmpty prepend=" AND " property="projName">
proj_name = #projName#
</isNotEmpty>
<isNotEmpty prepend=" AND " property="drawingCode">
drawing_code like ('%$drawingCode$%')
</isNotEmpty>
<isNotEmpty prepend=" AND " property="drawingName">
drawing_name like ('%$drawingName$%')
</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.HGSC003A">
SELECT
id as "id", <!-- 主键 -->
company_code as "companyCode", <!-- 公司编码 -->
company_name as "companyName", <!-- 公司名称 -->
dep_code as "depCode", <!-- 部门编号 -->
dep_name as "depName", <!-- 部门名称 -->
blueprint_id as "blueprintId", <!-- 蓝图id -->
blueprint_code as "blueprintCode", <!-- 蓝图编号 -->
blueprint_name as "blueprintName", <!-- 蓝图名称 -->
proj_code as "projCode", <!-- 项目编码 -->
proj_name as "projName", <!-- 项目名称 -->
drawing_code as "drawingCode", <!-- 图号 -->
drawing_name as "drawingName", <!-- 图纸名称 -->
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}.HGSC003A WHERE 1=1
<include refid="condition" />
<dynamic prepend="ORDER BY">
<isNotEmpty property="orderBy">
$orderBy$
</isNotEmpty>
</dynamic>
</select>
<select id="count" resultClass="int">
SELECT COUNT(*) FROM ${hggpSchema}.HGSC003A WHERE 1=1
<include refid="condition" />
</select>
<insert id="insert">
INSERT INTO ${hggpSchema}.HGSC003A (id, <!-- 主键 -->
company_code, <!-- 公司编码 -->
company_name, <!-- 公司名称 -->
dep_code, <!-- 部门编号 -->
dep_name, <!-- 部门名称 -->
blueprint_id, <!-- 蓝图id -->
blueprint_code, <!-- 蓝图编号 -->
blueprint_name, <!-- 蓝图名称 -->
proj_code, <!-- 项目编码 -->
proj_name, <!-- 项目名称 -->
drawing_code, <!-- 图号 -->
drawing_name, <!-- 图纸名称 -->
account_code, <!-- 帐套 -->
created_by, <!-- 创建人 -->
created_name, <!-- 创建人名称 -->
created_time, <!-- 创建时间 -->
updated_by, <!-- 更新人 -->
updated_name, <!-- 修改人名称 -->
updated_time <!-- 更新时间 -->
)
VALUES (#id#, #companyCode#, #companyName#, #depCode#, #depName#, #blueprintId#, #blueprintCode#, #blueprintName#, #projCode#, #projName#, #drawingCode#, #drawingName#, #accountCode#, #createdBy#, #createdName#, #createdTime#, #updatedBy#, #updatedName#, #updatedTime#)
</insert>
<delete id="delete">
DELETE FROM ${hggpSchema}.HGSC003A WHERE id = #id#
</delete>
<update id="update">
UPDATE ${hggpSchema}.HGSC003A
SET
company_code = #companyCode#, <!-- 公司编码 -->
company_name = #companyName#, <!-- 公司名称 -->
dep_code = #depCode#, <!-- 部门编号 -->
dep_name = #depName#, <!-- 部门名称 -->
blueprint_id = #blueprintId#, <!-- 蓝图id -->
blueprint_code = #blueprintCode#, <!-- 蓝图编号 -->
blueprint_name = #blueprintName#, <!-- 蓝图名称 -->
proj_code = #projCode#, <!-- 项目编码 -->
proj_name = #projName#, <!-- 项目名称 -->
drawing_code = #drawingCode#, <!-- 图号 -->
drawing_name = #drawingName#, <!-- 图纸名称 -->
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">
<sqlMap namespace="HGSC004">
<sql id="condition">
<isNotEmpty prepend=" AND " property="id">
id = #id#
</isNotEmpty>
<isNotEmpty prepend=" AND " property="blueprintId">
blueprint_id = #blueprintId#
</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="blueprintCode">
blueprint_code = #blueprintCode#
</isNotEmpty>
<isNotEmpty prepend=" AND " property="blueprintName">
blueprint_name like ('%$blueprintName$%')
</isNotEmpty>
<isNotEmpty prepend=" AND " property="projCode">
proj_code = #projCode#
</isNotEmpty>
<isNotEmpty prepend=" AND " property="projName">
proj_name like ('%$projName$%')
</isNotEmpty>
<isNotEmpty prepend=" AND " property="materialStatus">
material_status = #materialStatus#
</isNotEmpty>
<isNotEmpty prepend=" AND " property="approvalStatus">
approval_status = #approvalStatus#
</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>
<isNotEmpty prepend=" AND " property="delStatus">
del_status = #delStatus#
</isNotEmpty>
<isNotEmpty prepend=" AND " property="ids">
ID IN <iterate close=")" open="(" conjunction="," property="ids">#ids[]#</iterate>
</isNotEmpty>
</sql>
<select id="query" parameterClass="java.util.HashMap"
resultClass="com.baosight.hggp.hg.sc.domain.HGSC004">
SELECT
id as "id", <!-- 主键 -->
blueprint_id as "blueprintId", <!-- 蓝图id -->
company_code as "companyCode", <!-- 公司编码 -->
company_name as "companyName", <!-- 公司名称 -->
dep_code as "depCode", <!-- 部门编号 -->
dep_name as "depName", <!-- 部门名称 -->
blueprint_code as "blueprintCode", <!-- 蓝图编号 -->
blueprint_name as "blueprintName", <!-- 蓝图名称 -->
proj_code as "projCode", <!-- 项目编码 -->
proj_name as "projName", <!-- 项目名称 -->
material_status as "materialStatus", <!-- 物料状态 0:未提交,1:部分提交,2:全部提交 -->
approval_status as "approvalStatus", <!-- 审批状态 0:待审;1:审核中;2:已审 -->
del_status as "delStatus", <!-- 数据状态 0:保存,1:删除 -->
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}.HGSC004 WHERE 1=1
<include refid="condition" />
<dynamic prepend="ORDER BY">
<isNotEmpty property="orderBy">
$orderBy$
</isNotEmpty>
</dynamic>
</select>
<select id="count" resultClass="int">
SELECT COUNT(*) FROM ${hggpSchema}.HGSC004 WHERE 1=1
<include refid="condition" />
</select>
<insert id="insert">
INSERT INTO ${hggpSchema}.HGSC004 (id, <!-- 主键 -->
blueprint_id, <!-- 蓝图id -->
company_code, <!-- 公司编码 -->
company_name, <!-- 公司名称 -->
dep_code, <!-- 部门编号 -->
dep_name, <!-- 部门名称 -->
blueprint_code, <!-- 蓝图编号 -->
blueprint_name, <!-- 蓝图名称 -->
proj_code, <!-- 项目编码 -->
proj_name, <!-- 项目名称 -->
material_status, <!-- 物料状态 0:未提交,1:部分提交,2:全部提交 -->
del_status, <!-- 数据状态 0:保存,1:删除 -->
approval_status, <!-- 审批状态 0:待审;1:审核中;2:已审 -->
account_code, <!-- 帐套 -->
created_by, <!-- 创建人 -->
created_name, <!-- 创建人名称 -->
created_time, <!-- 创建时间 -->
updated_by, <!-- 更新人 -->
updated_name, <!-- 修改人名称 -->
updated_time <!-- 更新时间 -->
)
VALUES (#id#, #blueprintId#, #companyCode#, #companyName#, #depCode#, #depName#, #blueprintCode#, #blueprintName#, #projCode#, #projName#, #materialStatus#, #delStatus#, #approvalStatus#, #accountCode#, #createdBy#, #createdName#, #createdTime#, #updatedBy#, #updatedName#, #updatedTime#)
</insert>
<delete id="delete">
DELETE FROM ${hggpSchema}.HGSC004 WHERE id = #id#
</delete>
<update id="update">
UPDATE ${hggpSchema}.HGSC004
SET
blueprint_id = #blueprintId#, <!-- 蓝图id -->
company_code = #companyCode#, <!-- 公司编码 -->
company_name = #companyName#, <!-- 公司名称 -->
dep_code = #depCode#, <!-- 部门编号 -->
dep_name = #depName#, <!-- 部门名称 -->
blueprint_code = #blueprintCode#, <!-- 蓝图编号 -->
blueprint_name = #blueprintName#, <!-- 蓝图名称 -->
proj_code = #projCode#, <!-- 项目编码 -->
proj_name = #projName#, <!-- 项目名称 -->
material_status = #materialStatus#, <!-- 物料状态 0:未提交,1:部分提交,2:全部提交 -->
del_status = #delStatus#, <!-- 数据状态 0:保存,1:删除 -->
approval_status = #approvalStatus#, <!-- 审批状态 0:待审;1:审核中;2:已审 -->
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>
<delete id="batchDelete">
DELETE FROM ${hggpSchema}.HGSC004 WHERE
id IN <iterate close=")" open="(" conjunction="," property="ids">#ids[]#</iterate>
</delete>
<update id="updateDel">
UPDATE ${hggpSchema}.HGSC004
SET
UPDATED_BY = #updatedBy#, <!-- 更新人 -->
UPDATED_NAME = #updatedName#, <!-- 更新人名称 -->
UPDATED_TIME = #updatedTime#, <!-- 更新时间 -->
DEL_STATUS = 1 <!-- 数据状态 0:保存,1:删除 -->
WHERE
ID = #id#
</update>
<update id="updateMaterialStatus">
UPDATE ${hggpSchema}.HGSC004
SET
UPDATED_BY = #updatedBy#, <!-- 更新人 -->
UPDATED_NAME = #updatedName#, <!-- 更新人名称 -->
UPDATED_TIME = #updatedTime#, <!-- 更新时间 -->
MATERIAL_STATUS = #materialStatus#
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">
<sqlMap namespace="HGSC004A">
<sql id="column">
id as "id", <!-- 主键 -->
company_code as "companyCode", <!-- 公司编码(预留) -->
company_name as "companyName", <!-- 公司名称(预留) -->
dep_code as "depCode", <!-- 部门编号(预留) -->
dep_name as "depName", <!-- 部门名称(预留) -->
proj_code as "projCode", <!-- 项目编码(预留) -->
proj_name as "projName", <!-- 项目名称(预留) -->
parent_prod_code as "parentProdCode", <!-- 父节点-产品编码 -->
parent_prod_name as "parentProdName", <!-- 父节点-产品名称 -->
material_id as "materialId", <!-- 物料清单id -->
product_id as "productId", <!-- 产品id -->
product_type as "productType", <!-- 产品类别 -->
product_code as "productCode", <!-- 产品编号 -->
product_name as "productName", <!-- 产品名称 -->
product_status as "productStatus", <!-- 产品状态 0:未提交,1:已提交 -->
change_type as "changeType", <!-- 变更类型:默认0,1:增加,2:替换,3:删除 -->
quantity as "quantity", <!-- 数量 -->
single_weight as "singleWeight", <!-- 单重 -->
total_weight as "totalWeight", <!-- 总重 -->
approval_status as "approvalStatus", <!-- 审批状态 0:待审;1:审核中;2:已审 -->
leaf as "leaf", <!-- 是否有叶子节点 -->
sort as "sort", <!-- 排序字段 -->
lv as "lv", <!-- 层级 -->
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" <!-- 更新时间 -->
</sql>
<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 = #companyName#
</isNotEmpty>
<isNotEmpty prepend=" AND " property="depCode">
dep_code = #depCode#
</isNotEmpty>
<isNotEmpty prepend=" AND " property="depName">
dep_name = #depName#
</isNotEmpty>
<isNotEmpty prepend=" AND " property="projCode">
proj_code = #projCode#
</isNotEmpty>
<isNotEmpty prepend=" AND " property="projName">
proj_name = #projName#
</isNotEmpty>
<isNotEmpty prepend=" AND " property="parentProdCode">
parent_prod_code = #parentProdCode#
</isNotEmpty>
<isNotEmpty prepend=" AND " property="parentProdName">
parent_prod_name = #parentProdName#
</isNotEmpty>
<isNotEmpty prepend=" AND " property="materialId">
material_id = #materialId#
</isNotEmpty>
<isNotEmpty prepend=" AND " property="productCode">
product_code = #productCode#
</isNotEmpty>
<isNotEmpty prepend=" AND " property="productName">
product_name = #productName#
</isNotEmpty>
<isNotEmpty prepend=" AND " property="productStatus">
product_status = #productStatus#
</isNotEmpty>
<isNotEmpty prepend=" AND " property="changeType">
change_type = #changeType#
</isNotEmpty>
<isNotEmpty prepend=" AND " property="quantity">
quantity = #quantity#
</isNotEmpty>
<isNotEmpty prepend=" AND " property="singleWeight">
single_weight = #singleWeight#
</isNotEmpty>
<isNotEmpty prepend=" AND " property="totalWeight">
total_weight = #totalWeight#
</isNotEmpty>
<isNotEmpty prepend=" AND " property="approvalStatus">
approval_status = #approvalStatus#
</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>
<isNotEmpty prepend=" AND " property="materialIds">
material_Id IN <iterate close=")" open="(" conjunction="," property="materialIds">#materialIds[]#</iterate>
</isNotEmpty>
<isNotEmpty prepend=" AND " property="productId">
product_id = #productId#
</isNotEmpty>
<isNotEmpty prepend=" AND " property="productType">
product_type = #productType#
</isNotEmpty>
<isNotEmpty prepend=" AND " property="notId">
id != #notId#
</isNotEmpty>
</sql>
<select id="query" parameterClass="java.util.HashMap"
resultClass="com.baosight.hggp.hg.sc.domain.HGSC004A">
SELECT
<include refid="column"/>
FROM ${hggpSchema}.HGSC004A WHERE 1=1
AND lv NOT IN (1,2)
<include refid="condition" />
<dynamic prepend="ORDER BY">
<isNotEmpty property="orderBy">
$orderBy$
</isNotEmpty>
</dynamic>
</select>
<select id="queryAll" parameterClass="java.util.HashMap"
resultClass="com.baosight.hggp.hg.sc.domain.HGSC004A">
SELECT
<include refid="column"/>
FROM ${hggpSchema}.HGSC004A WHERE 1=1
<include refid="condition" />
<dynamic prepend="ORDER BY">
<isNotEmpty property="orderBy">
$orderBy$
</isNotEmpty>
</dynamic>
</select>
<select id="count" resultClass="int">
SELECT COUNT(*) FROM ${hggpSchema}.HGSC004A WHERE 1=1
<include refid="condition" />
</select>
<insert id="insert">
INSERT INTO ${hggpSchema}.HGSC004A (id, <!-- 主键 -->
company_code, <!-- 公司编码(预留) -->
company_name, <!-- 公司名称(预留) -->
dep_code, <!-- 部门编号(预留) -->
dep_name, <!-- 部门名称(预留) -->
proj_code, <!-- 项目编码(预留) -->
proj_name, <!-- 项目名称(预留) -->
parent_prod_code, <!-- 父节点-产品编码 -->
parent_prod_name, <!-- 父节点-产品名称 -->
leaf, <!-- 是否有叶子节点 -->
sort, <!-- 排序字段 -->
lv, <!-- 层级 -->
material_id, <!-- 物料清单id -->
product_id, <!-- 产品id -->
product_type, <!-- 产品类别 -->
product_code, <!-- 产品编号 -->
product_name, <!-- 产品名称 -->
product_status, <!-- 产品状态 0:未提交,1:已提交 -->
change_type, <!-- 变更类型:默认0,1:增加,2:替换,3:删除 -->
quantity, <!-- 数量 -->
single_weight, <!-- 单重 -->
total_weight, <!-- 总重 -->
approval_status, <!-- 审批状态 0:待审;1:审核中;2:已审 -->
account_code, <!-- 帐套 -->
created_by, <!-- 创建人 -->
created_name, <!-- 创建人名称 -->
created_time, <!-- 创建时间 -->
updated_by, <!-- 更新人 -->
updated_name, <!-- 修改人名称 -->
updated_time <!-- 更新时间 -->
)
VALUES (#id#, #companyCode#, #companyName#, #depCode#, #depName#, #projCode#, #projName#,
#parentProdCode#, #parentProdName#,#leaf#,#sort#,#lv#, #materialId#, #productId#,#productType#,
#productCode#, #productName#, #productStatus#, #changeType#, #quantity#, #singleWeight#, #totalWeight#,
#approvalStatus#, #accountCode#, #createdBy#, #createdName#, #createdTime#, #updatedBy#,
#updatedName#, #updatedTime#)
</insert>
<delete id="delete">
DELETE FROM ${hggpSchema}.HGSC004A WHERE id = #id#
</delete>
<update id="update">
UPDATE ${hggpSchema}.HGSC004A
SET
company_code = #companyCode#, <!-- 公司编码(预留) -->
company_name = #companyName#, <!-- 公司名称(预留) -->
dep_code = #depCode#, <!-- 部门编号(预留) -->
dep_name = #depName#, <!-- 部门名称(预留) -->
proj_code = #projCode#, <!-- 项目编码(预留) -->
proj_name = #projName#, <!-- 项目名称(预留) -->
parent_prod_code = #parentProdCode#, <!-- 父节点-产品编码 -->
parent_prod_name = #parentProdName#, <!-- 父节点-产品名称 -->
leaf = #leaf#, <!-- 是否有叶子节点 -->
sort = #sort#, <!-- 排序字段 -->
lv = #lv#, <!-- 层级 -->
material_id = #materialId#, <!-- 物料清单id -->
product_id = #productId#, <!-- 产品id -->
product_type = #productType#, <!-- 产品类别 -->
product_code = #productCode#, <!-- 产品编号 -->
product_name = #productName#, <!-- 产品名称 -->
product_status = #productStatus#, <!-- 产品状态 0:未提交,1:已提交 -->
change_type = #changeType#, <!-- 变更类型:默认0,1:增加,2:替换,3:删除 -->
quantity = #quantity#, <!-- 数量 -->
single_weight = #singleWeight#, <!-- 单重 -->
total_weight = #totalWeight#, <!-- 总重 -->
approval_status = #approvalStatus#, <!-- 审批状态 0:待审;1:审核中;2:已审 -->
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>
<!--查询公司树-->
<select id="queryCompany" parameterClass="java.util.HashMap" resultClass="com.baosight.hggp.hg.xs.domain.Org">
select
a.ORG_ENAME as "orgEname",
a.ORG_CNAME as "orgCname"
from ${platSchema}.txsog01 a
left join ${platSchema}.txsog02 b on a.ORG_ID = b.ORG_ID
where
a.ACCOUNT_CODE = #accountCode#
and a.ORG_TYPE = #orgType#
<isNotEmpty prepend=" AND " property="orgEname">
a.ORG_ENAME = #orgEname#
</isNotEmpty>
</select>
<select id="queryTree" resultClass="java.util.HashMap">
SELECT
PRODUCT_CODE as "nodeId",
product_id as "productId", <!-- 产品id -->
product_type as "productType", <!-- 产品类别 -->
PRODUCT_CODE as "productCode", <!-- 产品编码 -->
PROJ_CODE as "projCode", <!-- 项目编码 -->
PROJ_NAME as "projName",<!-- 项目名称 -->
PRODUCT_NAME as "productName", <!-- 产品名称 -->
PRODUCT_CODE as "label", <!-- 名部件编码-->
case when lv = 3 then concat(PRODUCT_CODE,' ',PRODUCT_NAME) else PRODUCT_NAME end as "text", <!-- 部件名称 -->
PARENT_PROD_CODE as "pId", <!-- 父节点编码 -->
PARENT_PROD_NAME as "pName", <!-- 父节点名称 -->
LEAF as "leaf", <!-- 是否有叶子节点 -->
SORT as "sort", <!-- 排序字段 -->
lv as "lv"
FROM
${hggpSchema}.HGSC004A
WHERE 1=1
<isNotEmpty prepend=" AND " property="pEname">
PARENT_PROD_CODE = #pEname#
</isNotEmpty>
<isNotEmpty prepend=" AND " property="projCode">
PROJ_CODE = #projCode#
</isNotEmpty>
<isNotEmpty prepend=" AND " property="companyCode">
COMPANY_CODE = #companyCode#
</isNotEmpty>
<isNotEmpty prepend=" AND " property="materialId">
MATERIAL_ID = #materialId#
</isNotEmpty>
ORDER BY CREATED_TIME DESC
</select>
<delete id="batchDelete">
DELETE FROM ${hggpSchema}.HGSC004A WHERE
id IN <iterate close=")" open="(" conjunction="," property="ids">#ids[]#</iterate>
</delete>
<update id="updateProductStatus">
UPDATE ${hggpSchema}.HGSC004A
SET
UPDATED_BY = #updatedBy#, <!-- 更新人 -->
UPDATED_NAME = #updatedName#, <!-- 更新人名称 -->
UPDATED_TIME = #updatedTime#, <!-- 更新时间 -->
PRODUCT_STATUS = #productStatus# <!-- 产品状态 0:未提交,1:已提交 -->
WHERE
ID = #id#
</update>
</sqlMap>
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE sqlMap PUBLIC "-//ibatis.apache.org//DTD SQL Map 2.0//EN" "http://ibatis.apache.org/dtd/sql-map-2.dtd">
<sqlMap namespace="HGSC004B">
<sql id="condition">
<isNotEmpty prepend=" AND " property="id">
id = #id#
</isNotEmpty>
<isNotEmpty prepend=" AND " property="productId">
product_id = #productId#
</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="projCode">
proj_code = #projCode#
</isNotEmpty>
<isNotEmpty prepend=" AND " property="projName">
proj_name = #projName#
</isNotEmpty>
<isNotEmpty prepend=" AND " property="parentProdCode">
parent_prod_code = #parentProdCode#
</isNotEmpty>
<isNotEmpty prepend=" AND " property="parentProdName">
parent_prod_name = #parentProdName#
</isNotEmpty>
<isNotEmpty prepend=" AND " property="materialId">
material_id = #materialId#
</isNotEmpty>
<isNotEmpty prepend=" AND " property="productCode">
product_code = #productCode#
</isNotEmpty>
<isNotEmpty prepend=" AND " property="productName">
product_name = #productName#
</isNotEmpty>
<isNotEmpty prepend=" AND " property="productStatus">
product_status = #productStatus#
</isNotEmpty>
<isNotEmpty prepend=" AND " property="changeType">
change_type = #changeType#
</isNotEmpty>
<isNotEmpty prepend=" AND " property="quantity">
quantity = #quantity#
</isNotEmpty>
<isNotEmpty prepend=" AND " property="singleWeight">
single_weight = #singleWeight#
</isNotEmpty>
<isNotEmpty prepend=" AND " property="totalWeight">
total_weight = #totalWeight#
</isNotEmpty>
<isNotEmpty prepend=" AND " property="approvalStatus">
approval_status = #approvalStatus#
</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.HGSC004B">
SELECT
id as "id", <!-- 主键 -->
product_id as "productId", <!-- 变更产品id -->
company_code as "companyCode", <!-- 公司编码(预留) -->
company_name as "companyName", <!-- 公司名称(预留) -->
dep_code as "depCode", <!-- 部门编号(预留) -->
dep_name as "depName", <!-- 部门名称(预留) -->
proj_code as "projCode", <!-- 项目编码(预留) -->
proj_name as "projName", <!-- 项目名称(预留) -->
parent_prod_code as "parentProdCode", <!-- 父节点-产品编码 -->
parent_prod_name as "parentProdName", <!-- 父节点-产品名称 -->
material_id as "materialId", <!-- 物料清单id -->
product_code as "productCode", <!-- 产品编号 -->
product_name as "productName", <!-- 产品名称 -->
product_status as "productStatus", <!-- 产品状态 0:未提交,1:已提交 -->
change_type as "changeType", <!-- 变更类型:默认0,1:增加,2:替换,3:删除 -->
quantity as "quantity", <!-- 数量 -->
single_weight as "singleWeight", <!-- 单重 -->
total_weight as "totalWeight", <!-- 总重 -->
approval_status as "approvalStatus", <!-- 审批状态 0:待审;1:审核中;2:已审 -->
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}.HGSC004B WHERE 1=1
<include refid="condition" />
<dynamic prepend="ORDER BY">
<isNotEmpty property="orderBy">
$orderBy$
</isNotEmpty>
</dynamic>
</select>
<select id="count" resultClass="int">
SELECT COUNT(*) FROM ${hggpSchema}.HGSC004B WHERE 1=1
<include refid="condition" />
</select>
<!--
<isNotEmpty prepend=" AND " property="id">
id = #id#
</isNotEmpty>
<isNotEmpty prepend=" AND " property="productId">
product_id = #productId#
</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="projCode">
proj_code = #projCode#
</isNotEmpty>
<isNotEmpty prepend=" AND " property="projName">
proj_name = #projName#
</isNotEmpty>
<isNotEmpty prepend=" AND " property="parentProdCode">
parent_prod_code = #parentProdCode#
</isNotEmpty>
<isNotEmpty prepend=" AND " property="parentProdName">
parent_prod_name = #parentProdName#
</isNotEmpty>
<isNotEmpty prepend=" AND " property="materialId">
material_id = #materialId#
</isNotEmpty>
<isNotEmpty prepend=" AND " property="productCode">
product_code = #productCode#
</isNotEmpty>
<isNotEmpty prepend=" AND " property="productName">
product_name = #productName#
</isNotEmpty>
<isNotEmpty prepend=" AND " property="productStatus">
product_status = #productStatus#
</isNotEmpty>
<isNotEmpty prepend=" AND " property="changeType">
change_type = #changeType#
</isNotEmpty>
<isNotEmpty prepend=" AND " property="quantity">
quantity = #quantity#
</isNotEmpty>
<isNotEmpty prepend=" AND " property="singleWeight">
single_weight = #singleWeight#
</isNotEmpty>
<isNotEmpty prepend=" AND " property="totalWeight">
total_weight = #totalWeight#
</isNotEmpty>
<isNotEmpty prepend=" AND " property="approvalStatus">
approval_status = #approvalStatus#
</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}.HGSC004B (id, <!-- 主键 -->
product_id, <!-- 变更产品id -->
company_code, <!-- 公司编码(预留) -->
company_name, <!-- 公司名称(预留) -->
dep_code, <!-- 部门编号(预留) -->
dep_name, <!-- 部门名称(预留) -->
proj_code, <!-- 项目编码(预留) -->
proj_name, <!-- 项目名称(预留) -->
parent_prod_code, <!-- 父节点-产品编码 -->
parent_prod_name, <!-- 父节点-产品名称 -->
material_id, <!-- 物料清单id -->
product_code, <!-- 产品编号 -->
product_name, <!-- 产品名称 -->
product_status, <!-- 产品状态 0:未提交,1:已提交 -->
change_type, <!-- 变更类型:默认0,1:增加,2:替换,3:删除 -->
quantity, <!-- 数量 -->
single_weight, <!-- 单重 -->
total_weight, <!-- 总重 -->
approval_status, <!-- 审批状态 0:待审;1:审核中;2:已审 -->
account_code, <!-- 帐套 -->
created_by, <!-- 创建人 -->
created_name, <!-- 创建人名称 -->
created_time, <!-- 创建时间 -->
updated_by, <!-- 更新人 -->
updated_name, <!-- 修改人名称 -->
updated_time <!-- 更新时间 -->
)
VALUES (#id#, #productId#, #companyCode#, #companyName#, #depCode#, #depName#, #projCode#, #projName#, #parentProdCode#, #parentProdName#, #materialId#, #productCode#, #productName#, #productStatus#, #changeType#, #quantity#, #singleWeight#, #totalWeight#, #approvalStatus#, #accountCode#, #createdBy#, #createdName#, #createdTime#, #updatedBy#, #updatedName#, #updatedTime#)
</insert>
<delete id="delete">
DELETE FROM ${hggpSchema}.HGSC004B WHERE id = #id#
</delete>
<update id="update">
UPDATE ${hggpSchema}.HGSC004B
SET
product_id = #productId#, <!-- 变更产品id -->
company_code = #companyCode#, <!-- 公司编码(预留) -->
company_name = #companyName#, <!-- 公司名称(预留) -->
dep_code = #depCode#, <!-- 部门编号(预留) -->
dep_name = #depName#, <!-- 部门名称(预留) -->
proj_code = #projCode#, <!-- 项目编码(预留) -->
proj_name = #projName#, <!-- 项目名称(预留) -->
parent_prod_code = #parentProdCode#, <!-- 父节点-产品编码 -->
parent_prod_name = #parentProdName#, <!-- 父节点-产品名称 -->
material_id = #materialId#, <!-- 物料清单id -->
product_code = #productCode#, <!-- 产品编号 -->
product_name = #productName#, <!-- 产品名称 -->
product_status = #productStatus#, <!-- 产品状态 0:未提交,1:已提交 -->
change_type = #changeType#, <!-- 变更类型:默认0,1:增加,2:替换,3:删除 -->
quantity = #quantity#, <!-- 数量 -->
single_weight = #singleWeight#, <!-- 单重 -->
total_weight = #totalWeight#, <!-- 总重 -->
approval_status = #approvalStatus#, <!-- 审批状态 0:待审;1:审核中;2:已审 -->
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>
......@@ -30,7 +30,7 @@ $(function (){
let template = '';
if (item.id){
template += '<a style="cursor: pointer;display: inline-flex;justify-content: center;margin:auto 5px" '
+ 'onclick="showDetail(' + item.id +'\')" >蓝图详情</a>';
+ 'onclick="showDetail(' + item.id +',\''+item.blueprintCode+'\',\''+item.blueprintName+'\',\''+item.companyName+'\')" >蓝图详情</a>';
if (status == 0) {
template += '<a style="cursor: pointer;display: inline-flex;justify-content: center;margin:auto 5px" '
+ 'onclick="updateBlueprintStatus(' + item.id + ',1)" >启用</a>';
......@@ -137,14 +137,6 @@ $(function (){
},
onRowClick: function (e) {
},
exportGrid : {
exportFileName: function (gridInstance) {
// 导出的文件名包含时间戳 yyyy-MM-dd HH:mm:ss
return "工艺流程_" + kendo.toString(new Date(), IPLAT.FORMAT.DATE_14_PR);
},
exportFileType: "xls",
exportBlockId: "result",
}
}
}
......@@ -231,10 +223,10 @@ function deactivate() {
/**
* 显示详情
*/
function showDetail(id,factoryCode,flowCode,flowName) {
function showDetail(id,blueprintCode,blueprintName,companyName) {
JSColorbox.open({
href: "HGSC003A?methodName=initLoad&inqu_status-0-parendId=" + id+
"&inqu_status-0-flowCode="+flowCode+"&inqu_status-0-flowName="+flowName+"&inqu_status-0-factoryCode="+factoryCode,
href: "HGSC003A?methodName=initLoad&inqu_status-0-blueprintId=" + id +"&inqu_status-0-blueprintCode="+ blueprintCode
+"&inqu_status-0-blueprintName="+blueprintName+"&inqu_status-0-companyName="+companyName,
title: "<div style='text-align: center;'>蓝图清单详情</div>",
width: "80%",
height: "80%",
......
......@@ -25,7 +25,7 @@
<EF:EFRegion id="result" title="记录集">
<EF:EFGrid blockId="result" autoDraw="no" isFloat="true" copyToAdd="false">
<EF:EFColumn ename="id" cname="主键" hidden="true"/>
<EF:EFColumn ename="operator" cname="操作" locked="true" enable="false" width="100" align="center"/>
<EF:EFColumn ename="operator" cname="操作" locked="true" enable="false" width="120" align="center"/>
<EF:EFComboColumn ename="companyCode" cname="公司名称"
columnTemplate="#=textField#" itemTemplate="#=textField#"
textField="textField" valueField="valueField"
......
$(function (){
$(".row").children().attr("class", "col-md-3");
$("#QUERY").on("click", query);
/* 页面查询框的尺寸设置 */
$.extend(true, IPLATUI.Config, {
EFGrid: {
height: $(document).height() - $("#inqu").height() - $("#ef_form_head").height() - 100,
}
});
IPLATUI.EFGrid = {
"result": {
pageable: {
pageSize: 10,
pageSizes: [10, 20, 50, 100],
},
columns: [
{
field: "operator",
title: "操作",
template: function (item) {
let template = '';
if (item.id){
template = '<a style="cursor: pointer;display: inline-flex;justify-content: center;margin:auto 5px" ' +
'onclick="showUploadFile(' + item.id + ')" >附件详情</a>';
}
return template;
}
},
{
field: "companyName",
template: function (item) {
item['companyName'] =$("#inqu_status-0-companyName").val();
return $("#inqu_status-0-companyName").val();
}
},{
field: "blueprintId",
template: function (item) {
item['blueprintId'] =$("#inqu_status-0-blueprintId").val();
return $("#inqu_status-0-blueprintId").val();
}
},{
field: "blueprintCode",
template: function (item) {
item['blueprintCode'] =$("#inqu_status-0-blueprintCode").val();
return $("#inqu_status-0-blueprintCode").val();
}
},{
field: "blueprintName",
template: function (item) {
item['blueprintName'] =$("#inqu_status-0-blueprintName").val();
return $("#inqu_status-0-blueprintName").val();
}
}
],
loadComplete: function(grid) {
},
afterEdit:function (e) {
},
onSave: function (e) {
// 阻止默认请求,使用自定义保存
e.preventDefault();
let btnNode = $(this);
//禁用按钮
btnNode.attr("disabled", true);
save(btnNode);
},
onDelete: function (e) {
// 阻止默认请求,使用自定义删除
//e.preventDefault();
//deleteFunc();
},
onSuccess: function (e) {
if (e.eiInfo.extAttr.methodName == 'save' || e.eiInfo.extAttr.methodName == 'delete') {
query();
}
},
onRowClick: function (e) {
},
}
}
downKeyUp();
})
let query = function () {
resultGrid.dataSource.page(1);
}
/**
* 保存
*/
let save = function (btnNode) {
let rows = resultGrid.getCheckedRows();
if (rows.length < 1) {
message("请选择数据");
return;
}
let flag = true;
if(flag) {
JSUtils.confirm("确定对勾选中的[" + rows.length + "]条数据做\"保存\"操作? ", {
ok: function () {
JSUtils.submitGridsData("result", "HGSC003A", "save", true,
function (e) {
query();
});
btnNode.attr("disabled", false);
}
});
}
}
/**
* 显示详情
*/
function showDetail(id,factoryCode,flowCode,flowName) {
JSColorbox.open({
href: "HGSC003AA?methodName=initLoad&inqu_status-0-parendId=" + id+
"&inqu_status-0-flowCode="+flowCode+"&inqu_status-0-flowName="+flowName+"&inqu_status-0-factoryCode="+factoryCode,
title: "<div style='text-align: center;'>蓝图清单详情</div>",
width: "80%",
height: "80%",
});
}
/**
* 显示附件清单
*
* @param id
*/
function showUploadFile(id) {
JSColorbox.open({
href: "HGSC099?methodName=initLoad&inqu_status-0-bizType=LTXQ&inqu_status-0-matId=" + id,
title: "<div style='text-align: center;'>附件详情</div>",
width: "80%",
height: "80%",
});
}
<!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="查询条件">
<EF:EFInput ename="inqu_status-0-blueprintId" cname="蓝图id" colWidth="3" type="hidden"/>
<EF:EFInput ename="inqu_status-0-blueprintCode" cname="蓝图编号" colWidth="3" type="hidden"/>
<EF:EFInput ename="inqu_status-0-blueprintName" cname="蓝图名称" colWidth="3" type="hidden"/>
<EF:EFInput ename="inqu_status-0-companyName" cname="公司名称" colWidth="3" type="hidden"/>
<div class="row">
<EF:EFInput ename="inqu_status-0-drawingCode" cname="图号" colWidth="3"/>
<EF:EFInput ename="inqu_status-0-drawingName" cname="图纸名称" colWidth="3"/>
</div>
</EF:EFRegion>
<EF:EFRegion id="result" title="记录集">
<EF:EFGrid blockId="result" autoDraw="no" isFloat="true" copyToAdd="false">
<EF:EFColumn ename="id" cname="主键" hidden="true"/>
<EF:EFColumn ename="operator" cname="操作" locked="true" enable="false" width="120" align="center"/>
<EF:EFColumn ename="blueprintId" cname="蓝图id" hidden="true"/>
<EF:EFColumn ename="companyName" cname="公司名称" enable="false" width="120" align="center"/>
<EF:EFColumn ename="blueprintCode" cname="蓝图编码" enable="false" width="120" align="center"/>
<EF:EFColumn ename="blueprintName" cname="蓝图名称" enable="false" width="120" align="center"/>
<EF:EFColumn ename="drawingCode" cname="图号" enable="true" width="120" align="center" required="true"/>
<EF:EFColumn ename="drawingName" cname="图纸名称" enable="true" width="120" align="center" required="true"/>
</EF:EFGrid>
</EF:EFRegion>
</EF:EFPage>
$(function (){
var companyCodes = __eiInfo.getBlock("companyBox_block_id").getMappedRows();
var projCodes = __eiInfo.getBlock("proj_record_block_id").getMappedRows();
var blueprintCodes = __eiInfo.getBlock("blueprint_box_block_id").getMappedRows();
$(".row").children().attr("class", "col-md-3");
$("#QUERY").on("click", query);
/* 页面查询框的尺寸设置 */
$.extend(true, IPLATUI.Config, {
EFGrid: {
height: $(document).height() - $("#inqu").height() - $("#ef_form_head").height() - 100,
}
});
IPLATUI.EFGrid = {
"result": {
pageable: {
pageSize: 10,
pageSizes: [10, 20, 50, 100],
},
columns: [
{
field: "operator",
title: "操作",
template: function (item) {
let status = item.blueprintStatus;
let template = '';
if (item.id){
template += '<a style="cursor: pointer;display: inline-flex;justify-content: center;margin:auto 5px" '
+ 'onclick="showDetail(' + item.id +',\''+item.companyCode+'\',\''+item.projCode+'\')" >物料清单</a>';
template += '<a style="cursor: pointer;display: inline-flex;justify-content: center;margin:auto 5px" ' +
'onclick="showUploadFile(' + item.id + ')" >附件</a>';
}
return template;
}
},{
field: "companyCode",
template: function (dataItem) {
for (let i = 0; i < companyCodes.length; i++) {
if (companyCodes[i]['valueField'] === dataItem['companyCode']){
dataItem['companyName'] = companyCodes[i]['textField']
return companyCodes[i]['textField'];
}
}
return dataItem["companyCode"];
}
}, {
field: "projCode",
template: function (item) {
let template = "";
if(item.projCode){
for(let i=0;i<projCodes.length;i++){
if(item.projCode === projCodes[i]['valueField']){
item['projName'] = projCodes[i]['textField'];
template = projCodes[i]['valueField'];
}
}
}
return template;
},
editor: function (container, options) {
let inInfo = new EiInfo();
inInfo.set("inqu_status-0-companyCode", options.model["companyCode"]);
inInfo.set("inqu_status-0-approvalStatus", 2);
inInfo.set("field", options.field);
let dataSource;
EiCommunicator.send("HGSC003", "projComboBox", inInfo, {
onSuccess: function (ei) {
dataSource = ei.getBlock("proj_record_block_id").getMappedRows();
},
onFail: function (ei) {
}
}, {async: false});
var input = $('<input />');
input.attr("name", options.field);
input.attr("id", options.field);
input.appendTo(container);
input.kendoDropDownList({
dataSource: dataSource,
minLength: 0,
dataTextField: "textField",
dataValueField: "valueField",
optionLabelTemplate: "[#:valueField#]#:textField#",
valueTemplate: "[#:valueField#]#:textField#",
template: "[#:valueField#]#:textField#",
filter: "contains"
});
}
}, {
field: "blueprintCode",
template: function (item) {
let template = "";
if(item.blueprintCode){
for(let i=0;i<blueprintCodes.length;i++){
if(item.blueprintCode === blueprintCodes[i]['valueField']){
item['blueprintName'] = blueprintCodes[i]['textField'];
template = blueprintCodes[i]['valueField'];
}
}
}
return template;
},
editor: function (container, options) {
let inInfo = new EiInfo();
inInfo.set("inqu_status-0-companyCode", options.model["companyCode"]);
inInfo.set("inqu_status-0-blueprintStatus", 1);
inInfo.set("inqu_status-0-projCode", options.model["projCode"]);
inInfo.set("field", options.field);
let dataSource;
EiCommunicator.send("HGSC003", "blueprintComboBox", inInfo, {
onSuccess: function (ei) {
dataSource = ei.getBlock("blueprint_box_block_id").getMappedRows();
},
onFail: function (ei) {
}
}, {async: false});
var input = $('<input />');
input.attr("name", options.field);
input.attr("id", options.field);
input.appendTo(container);
input.kendoDropDownList({
dataSource: dataSource,
minLength: 0,
dataTextField: "textField",
dataValueField: "valueField",
optionLabelTemplate: "[#:valueField#]#:textField#",
valueTemplate: "[#:valueField#]#:textField#",
template: "[#:valueField#]#:textField#",
filter: "contains"
});
}
}
],
loadComplete: function(grid) {
// 此 grid 对象
// 处理父子级联动,通过监听 change 事件,判断父级节点是否发生变化
grid.dataSource.bind("change", function(e) {
// 判断父级节点是否发生变化
if (e.field == "blueprintCode") {
loadChange(grid,e,"blueprintName");
}
if (e.field == "projCode") {
e.items[0].blueprintCode = "";
e.items[0].blueprintNmae = "";
loadChange(grid,e,"projName");
}
if (e.field == "companyCode") {
e.items[0].projCode = "";
e.items[0].projName = "";
e.items[0].blueprintCode = "";
e.items[0].blueprintNmae = "";
loadChange(grid,e,"projCode");
}
});
},
afterEdit:function (e) {
},
onSave: function (e) {
// 阻止默认请求,使用自定义保存
e.preventDefault();
let btnNode = $(this);
//禁用按钮
btnNode.attr("disabled", true);
save(btnNode);
},
onDelete: function (e) {
// 阻止默认请求,使用自定义删除
//e.preventDefault();
//deleteFunc();
},
onSuccess: function (e) {
if (e.eiInfo.extAttr.methodName == 'save' || e.eiInfo.extAttr.methodName == 'delete') {
query();
}
},
onRowClick: function (e) {
},
}
}
downKeyUp();
})
let query = function () {
resultGrid.dataSource.page(1);
}
/**
* 保存
*/
let save = function (btnNode) {
let rows = resultGrid.getCheckedRows();
if (rows.length < 1) {
message("请选择数据");
return;
}
let flag = true;
if(flag) {
JSUtils.confirm("确定对勾选中的[" + rows.length + "]条数据做\"保存\"操作? ", {
ok: function () {
JSUtils.submitGridsData("result", "HGSC004", "save", true,
function (e) {
query();
});
btnNode.attr("disabled", false);
}
});
}
}
/**
* 显示详情
*/
function showDetail(id,companyCode,projCode) {
JSColorbox.open({
href: "HGSC004A?companyCode="+companyCode+"&projCode="+projCode+"&methodName=initLoad&inqu_status-0-materialId=" + id,
title: "<div style='text-align: center;'>蓝图清单详情</div>",
width: "80%",
height: "80%",
});
}
/**
* 显示附件清单
*
* @param id
*/
function showUploadFile(id) {
JSColorbox.open({
href: "HGSC099?methodName=initLoad&inqu_status-0-bizType=WLQD&inqu_status-0-matId=" + id,
title: "<div style='text-align: center;'>附件详情</div>",
width: "80%",
height: "80%",
});
}
function loadChange(grid,e,field) {
var cell_label = field,that = grid;
// locked 表示是否为固定列
var locked = that.isCellLocked(cell_label);
// tr 表示 locked 和非 locked 的行,index 表示此行的第几列
var tr,index;
// 获取此 model 元素信息
var item = e.items[0];
var _uid = item.uid;
if (locked) {
tr = $(".k-grid-content-locked tr[data-uid="+ _uid +"]");
index = $("th[data-field='"+cell_label+"']").data("index");
} else {
tr = $(".k-grid-content tr[data-uid="+ _uid +"]");
index = parseInt($("th[data-field='"+cell_label+"']").data("index")) - that.lockedHeader.find("th").length;
}
// 获取子 cell(td)
var td = tr.children("td:eq("+index+")");
// 触发 td.click 事件,
td.trigger("click");
}
<!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-projName" cname="项目名称" colWidth="3"/>
<EF:EFInput ename="inqu_status-0-blueprintName" cname="蓝图名称" colWidth="3"/>
<EF:EFSelect cname="提交状态" ename="inqu_status-0-materialStatus" colWidth="3" filter="contains">
<EF:EFOption label="全部" value=""/>
<EF:EFCodeOption codeName="hggp.sc.materialStatus" />
</EF:EFSelect>
</div>
</EF:EFRegion>
<EF:EFRegion id="result" title="记录集">
<EF:EFGrid blockId="result" autoDraw="no" isFloat="true" copyToAdd="false">
<EF:EFColumn ename="id" cname="主键" hidden="true"/>
<EF:EFColumn ename="operator" cname="操作" locked="true" enable="false" width="120" align="center"/>
<EF:EFComboColumn ename="companyCode" cname="公司名称"
columnTemplate="#=textField#" itemTemplate="#=textField#"
textField="textField" valueField="valueField"
maxLength="16" width="120" required="true"
align="center" filter="contains" sort="true">
<EF:EFOptions blockId="companyBox_block_id" textField="textField" valueField="valueField"/>
</EF:EFComboColumn>
<EF:EFColumn ename="companyName" cname="公司名称" hidden="true"/>
<EF:EFColumn ename="projCode" cname="项目编码" enable="true" width="120" align="center"/>
<EF:EFColumn ename="projName" cname="项目名称" width="120" align="center" enable="false"/>
<EF:EFColumn ename="blueprintCode" cname="蓝图编码" enable="true" width="120" align="center"/>
<EF:EFColumn ename="blueprintName" cname="蓝图名称" enable="false" width="120" align="center" required="true"/>
<EF:EFComboColumn ename="materialStatus" cname="提交状态" width="80" align="center" enable="false" required="false" readonly="true">
<EF:EFCodeOption codeName="hggp.sc.materialStatus" />
</EF:EFComboColumn>
</EF:EFGrid>
</EF:EFRegion>
</EF:EFPage>
let projCode = '';
var companyCode='';
$(function () {
var productCodeBox = __eiInfo.getBlock("product_block_id").getMappedRows();
$(".row").children().attr("class", "col-md-3");
$("#QUERY").on("click", function () {
query();
});
let inventNameGlobalData = [];
let parentId = '';
var strs;
var url = location.search; //获取url中"?"符后的字串
if (url.indexOf("?") != -1) { //判断是否有参数
var str = url.substr(1); //从第一个字符开始 因为第0个是?号 获取所有除问号的所有符串
strs = str.split("&"); //用等号进行分隔 (因为知道只有一个参数 所以直接用等号进分隔 如果有多个参数 要用&号分隔 再用等号进行分隔)
//完全确定的数据,不能复用,获取公司编码
companyCode = strs[0].split("=")[1];
projCode = strs[1].split("=")[1];
}
IPLATUI.EFTree = {
"materialTree": {
// ROOT: "root:公司列表",
/**
* 树加载完成后的回调函数
* @param options: 树的配置项
*/
query: function (postEiInfo, model) {
postEiInfo.set("companyCode",companyCode ? companyCode : null);
postEiInfo.set("projCode",projCode ? projCode : null);
return postEiInfo;
},
loadComplete: function (options) {
// 保持结点展开状态
var expanded = Cookies.get('expanded');
if (expanded) {
Cookies.remove('expanded');
expanded = JSON.parse(expanded);
$("#menu").data("kendoTreeView").expandPath(_.keys(expanded));
}
},
/**
* 选中树结点时触发的事件,注意点击树 折叠/展开 的图标不会触发此事件
*
* @param e
* e.sender kendoTree对象, tree01Tree(EFTree的id + "Tree")
* e.node 点击的节点DOM元素
*/
select: function (e) {
var nodeData = this.dataItem(e.node);
// 选择最后一级时,自动点击上一级
if (nodeData.lv == 4) {
IPLATUI.EFTree.materialTree.selectTreeNode.nodeId = nodeData.pId;
// 刷新树
refreshTree();
} else {
let eiInfo = new EiInfo();
if (nodeData.lv == 2) {
eiInfo.set("inqu_status-0-parInventType", "root");
} else if (nodeData.lv == 3) {
eiInfo.set("inqu_status-0-parInventType", nodeData.productType);
}
var dataSource;
EiCommunicator.send("HGSC004A", "queryProductComboBox", eiInfo, {
onSuccess: function (ei) {
dataSource = ei.getBlock("product_block_id").getMappedRows();
productCodeBox = dataSource;
},
onFail: function (ei) {
}
}, {async: false});
// 设置树节点的值
setTreeNodeValue(nodeData);
}
// 动态显示列名
dynamicColumnName();
// 刷新列表数据
$("#inqu_status-0-parentProdCode").val(IPLATUI.EFTree.materialTree.selectTreeNode.nodeId);
query();
},
selectTreeNode: {}
}
};
IPLATUI.EFGrid = {
result: {
pageable: {
pageSize: 10,
pageSizes: [10, 20, 50, 100,200],
},
columns: [
{
field: "operator",
title: "操作",
template: function (item) {
let status = item.productStatus;
let template = '';
if (item.id){
template += '<a style="cursor: pointer;display: inline-flex;justify-content: center;margin:auto 5px" '
+ 'onclick="showDetail(' + item.id +')" >变更详情</a>';
if (status == 0) {
template += '<a style="cursor: pointer;display: inline-flex;justify-content: center;margin:auto 5px" '
+ 'onclick="updateProductStatus(' + item.id + ',1)" >提交</a>';
}
// else if (status == 1) {
// template += '<a style="cursor: pointer;display: inline-flex;justify-content: center;margin:auto 5px" ' +
// 'onclick="updateProductStatus(' + item.id + ',0)" >取消提交</a>';
// }
}
return template;
}
}, {
field: "productCode",
template: function (item) {
let template = "";
if(item.productCode){
for(let i=0;i<productCodeBox.length;i++){
if(item.productCode === productCodeBox[i]['valueField']){
item['productName'] = productCodeBox[i]['textField'];
item['productId'] = productCodeBox[i]['param1Field'];
item['productType'] = productCodeBox[i]['param2Field'];
console.log(item)
template = productCodeBox[i]['valueField'];
}
}
}
return template;
},
editor: function (container, options) {
let inInfo = new EiInfo();
inInfo.set("inqu_status-0-companyCode", options.model["companyCode"]);
var nodeData = IPLATUI.EFTree.materialTree.selectTreeNode;
if (nodeData.lv == 2) {
inInfo.set("inqu_status-0-parInventType", "root");
} else if (nodeData.lv == 3) {
inInfo.set("inqu_status-0-parInventType", nodeData.productType);
}else if (nodeData.lv == 4) {
//上方刷新过树结构了
inInfo.set("inqu_status-0-parInventType", nodeData.productType);
}
inInfo.set("field", options.field);
let dataSource = inventNameGlobalData;
EiCommunicator.send("HGSC004A", "queryProductComboBox", inInfo, {
onSuccess: function (ei) {
dataSource = ei.getBlock("product_block_id").getMappedRows();
},
onFail: function (ei) {
}
}, {async: false});
var input = $('<input />');
input.attr("name", options.field);
input.attr("id", options.field);
input.appendTo(container);
input.kendoDropDownList({
dataSource: dataSource,
minLength: 0,
dataTextField: "textField",
dataValueField: "valueField",
optionLabelTemplate: "[#:valueField#]#:textField#",
valueTemplate: "[#:valueField#]#:textField#",
template: "[#:valueField#]#:textField#",
filter: "contains"
});
}
}
],
loadComplete: function (grid) { // 在Grid加载完成后,才能给Grid上的按钮绑定事件
$("#SC02").on("click", function () {
if (grid.getCheckedBlockData().rows.length === 0) {
IPLAT.alert({
message: '<b>请勾选一项</b>',
okFn: function (e) {
},
title: '提示'
});
} else {
console.log(grid.getCheckedBlockData().rows[0][10]);
}
});
// 此 grid 对象
// 处理父子级联动,通过监听 change 事件,判断父级节点是否发生变化
grid.dataSource.bind("change", function(e) {
// 判断父级节点是否发生变化
if (e.field == "productCode") {
loadChange(grid,e,"productId");
loadChange(grid,e,"productType");
loadChange(grid,e,"productName");
}
});
},
onSuccess: function (e) {
if(e.eiInfo.extAttr.methodName == 'update'
||e.eiInfo.extAttr.methodName == 'insert'){
query();
}
},
/**
* 点击行首checkbox,勾选行时触发的事件
* @param e kendo的Event对象
* e.sender kendoGrid对象,resultGrid
* e.fake 用于区分是手动点击的事件还是模拟的事件
* e.checked 用于区分是勾选还是取消勾选
* e.model 勾选或取消勾选的行数据,kendo.data.Model
* e.row 当前行的行号
* e.tr 行的tr,包括固定列和数据列 jquery对象
*/
onCheckRow: function (e) {
if (e.checked) {
console.log('选中');
}
},
/**
* EFGrid新增行之前触发的事件,可以根据业务逻辑控制是否进行新增
* @param e 事件对象
* e.sender Grid对象
* e.preventDefault 阻止事件发生
*/
beforeAdd: function (e) {
var logic = IPLATUI.EFTree.materialTree.selectTreeNode.nodeId ? false : true;
if (logic) { // 通过业务逻辑判断, 控制是否进行新增
IPLAT.alert({
message: '<b>请选择项目列表</b>',
okFn: function (e) {
},
title: '提示'
});
e.preventDefault();
}
var logicLv = IPLATUI.EFTree.materialTree.selectTreeNode.lv === '1' ? true : false;
if (logicLv) { // 通过业务逻辑判断, 控制是否进行新增
IPLAT.alert({
message: '<b>请选择项目或产品层级</b>',
okFn: function (e) {
},
title: '提示'
});
e.preventDefault();
}
},
/**
* EFGrid新增行时触发的事件,此时数据行tr元素还未渲染
* @param e 事件对象
* e.sender Grid对象
* e.preventDefault 不会触发dataBound,不渲染tr
* e.index 插入的行号
* e.items 将要插入的数据行数组([Model,Model, ...])
*/
onAdd: function (e) {
// 动态设置默认邮箱
let selectTreeNode = IPLATUI.EFTree.materialTree.selectTreeNode;
$.each(e.items, function (index, item) {
item['projCode'] = selectTreeNode.projCode;
item['projName'] = selectTreeNode.projName;
item['parentProdCode'] = selectTreeNode.nodeId;
item['parentProdName'] = selectTreeNode.pName;
item['lv'] = selectTreeNode.lv;
});
},
/**
* 点击Grid保存按钮时触发的事件
* @param e 事件对象
* e.sender Grid对象
*/
onSave: function (e) {
// 阻止默认请求,使用自定义保存
e.preventDefault();
let btnNode = $(this);
//禁用按钮
btnNode.attr("disabled", true);
save(btnNode);
var tree = $("#materialTree").data("kendoTreeView");
var inInfo = new EiInfo();
EiCommunicator.send("HGSC004A", "queryTreeNode", inInfo, {//传入参数
onSuccess: function (inInfo) {
tree.reload("root");//更新树
}
});
},
/**
* 点击Grid删除按钮时触发的事件
* @param e 事件对象
* e.sender Grid对象
*/
onDelete: function (e) {
// 不向后台保存
console.log(e)
var tree = $("#materialTree").data("kendoTreeView");
var inInfo = new EiInfo();
EiCommunicator.send("HGSC004A", "queryTreeNode", inInfo, {//传入参数
onSuccess: function (inInfo) {
tree.reload("root");//更新树
}
});
refreshTree();
},
toolbarConfig: {
hidden: false, // true时,不显示功能按钮,但保留setting导出按钮
// add: false, // 不显示新增按钮
// cancel: false, // 不显示取消按钮
// save: false, // 不显示保存按钮
delete: true, // 显示删除按钮
}
},
};
// 关闭事件
IPLATUI.EFWindow = {
"uploadFile": {
close: function (e) {
let $iframe = uploadFileWindow.element.children("iframe");
let iframejQuery = $iframe[0].contentWindow.$; // 子窗口中的jQuery对象
let uploadFile = iframejQuery("#fileDocId").val();
if (isBlank(uploadFile)) {
return;
}
let inEiInfo = new EiInfo();
// inEiInfo.set("result-0-id", rowId);
inEiInfo.set("result-0-filePath1", uploadFile);
EiCommunicator.send('HGSC004A', 'bindDocIdById', inEiInfo, {
onSuccess(response) {
query();
},
onFail(errorMessage, status, e) {
NotificationUtil("执行失败!", "error");
}
},
{
async: false
}
);
},
}
};
//产品类型下拉联动
$('input[name="inqu_status-0-prdtType"]').change(function () {
var inInfo=new EiInfo();
var prdtType=$("#inqu_status-0-prdtType").val();
inInfo.set("inventType",prdtType);
EiCommunicator.send("HPPZ004", "queryComboBox", inInfo, {
onSuccess: function (ei) {
var input=$("#inqu_status-0-productCode");
dataEdition=ei.getBlock("invent_name_block_id").getMappedRows();
input.kendoDropDownList({
valuePrimitive: true,
dataTextField: "textField",
dataValueField: "valueField",
optionLabel:"请选择",
dataSource: dataEdition,
template: "#=textField#"
});
}, onFail: function (ei) {
}
}, {async: false});
});
});
$(window).load(function () {
query();
});
/**
* 查询
*/
let query = function () {
resultGrid.dataSource.page(1);
}
function openUploadFile(id) {
uploadFileWindow.open().center();
// rowId = id;
}
/**
* 显示附件清单
*
* @param id
*/
function showUploadFile(id) {
JSColorbox.open({
href: "HGSC004AA?methodName=initLoad&inqu_status-0-id=" + id,
title: "<div style='text-align: center;'>附件清单</div>",
width: "80%",
height: "80%",
});
}
function check(id, auditStatus) {
const inEiInfo = new EiInfo();
inEiInfo.set("result-0-id", id);
inEiInfo.set("result-0-status", auditStatus);
EiCommunicator.send('HGSC004A', 'check', inEiInfo, {
onSuccess(response) {
NotificationUtil(response.msg);
query();
},
onFail(errorMessage, status, e) {
NotificationUtil("执行失败!", "error");
}
},
{
async: false
}
);
}
/**
* 刷新树
*/
let refreshTree = function () {
setTimeout(() => {
// 刷新树节点
const tree = $("#materialTree").data("kendoTreeView");
// 选中的节点
const treeId = IPLATUI.EFTree.materialTree.selectTreeNode.nodeId;
tree.reload(treeId)
// 展开成功后选中对应的树节点
expandTreeNode(tree, treeId);
// 展开成功后选中对应的树节点
selectTreeNode(tree, treeId);
}, 500);
}
/**
* 展开对应的树节点
*
* @param tree
* @param treeId
*/
let expandTreeNode = function (tree, treeId) {
if (!tree || treeId == null) {
return
}
setTimeout(() => {
let barDataItem = tree.dataSource.get(treeId);
if (barDataItem) {
tree.expandPath([treeId])
} else {
expandTreeNode(tree, treeId)
}
}, 300);
}
/**
* 选中树节点
*
* @param tree
* @param treeId
*/
let selectTreeNode = (tree, treeId) => {
if (!tree || treeId == null) {
return
}
setTimeout(() => {
let barDataItem = tree.dataSource.get(treeId);
if (barDataItem) {
let barElement = tree.findByUid(barDataItem.uid);
// 刷新完成后选中对应的树节点
tree.select(barElement);
// 赋值
setTreeNodeValue(barDataItem);
} else {
selectTreeNode(tree, treeId)
}
}, 300)
}
/**
* 设置树节点的值
*
* @param nodeData
*/
let setTreeNodeValue = function (nodeData) {
IPLATUI.EFTree.materialTree.selectTreeNode.nodeId = nodeData.nodeId;
IPLATUI.EFTree.materialTree.selectTreeNode.pId = nodeData.pId;
IPLATUI.EFTree.materialTree.selectTreeNode.pName = nodeData.pName;
IPLATUI.EFTree.materialTree.selectTreeNode.productType = nodeData.productType;
IPLATUI.EFTree.materialTree.selectTreeNode.productCode = nodeData.productCode;
IPLATUI.EFTree.materialTree.selectTreeNode.productName = nodeData.productName;
IPLATUI.EFTree.materialTree.selectTreeNode.projCode = nodeData.projCode;
IPLATUI.EFTree.materialTree.selectTreeNode.projName = nodeData.projName;
IPLATUI.EFTree.materialTree.selectTreeNode.lv = nodeData.lv;
}
/**
* 保存
*/
let save = function (btnNode) {
let rows = resultGrid.getCheckedRows();
if (rows.length < 1) {
message("请选择数据");
return;
}
let flag = true;
if(flag) {
JSUtils.confirm("确定对勾选中的[" + rows.length + "]条数据做\"保存\"操作? ", {
ok: function () {
JSUtils.submitGridsData("result", "HGSC004A", "save", true,
function (e) {
query();
});
btnNode.attr("disabled", false);
}
});
}
}
/**
* 动态显示列名
*/
let dynamicColumnName = function () {
// 根据叶子节点动态设置列名
let lv = IPLATUI.EFTree.materialTree.selectTreeNode.lv;
let th = $("th[data-field='prdtName']");
if (lv == 2) {
th.html("<span class=\"i-input-required\">*</span>项目名称");
} else {
th.html("<span class=\"i-input-required\">*</span>产品名称");
}
}
function updateProductStatus(id,status) {
let inEiInfo = new EiInfo();
inEiInfo.set("result-0-id", id);
inEiInfo.set("result-0-productStatus", status);
inEiInfo.set("result-0-materialId", $("#inqu_status-0-materialId").val());
EiCommunicator.send('HGSC004A', 'updateProductStatus', inEiInfo, {
onSuccess(response) {
NotificationUtil(response.msg);
query();
},
onFail(errorMessage, status, e) {
NotificationUtil("执行失败!", "error");
}
}, {
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="查询条件">
<EF:EFInput ename="inqu_status-0-materialId" type="hidden"/>
<EF:EFInput ename="inqu_status-0-parentProdCode" type="hidden"/>
<div class="row">
<EF:EFInput ename="inqu_status-0-productName" cname="产品名称" colWidth="3"/>
<EF:EFSelect cname="变更类型" ename="inqu_status-0-changeType" colWidth="3" filter="contains">
<EF:EFOption label="全部" value=""/>
<EF:EFCodeOption codeName="hggp.sc.changeType" />
</EF:EFSelect>
<EF:EFSelect cname="提交状态" ename="inqu_status-0-productStatus" colWidth="3" filter="contains">
<EF:EFOption label="全部" value=""/>
<EF:EFCodeOption codeName="hggp.sc.productStatus" />
</EF:EFSelect>
</div>
</EF:EFRegion>
<div id="splitter" class="i-fit-height" style="display: inline">
<div id="left-pane" class="i-fit-height" style="width: 20%;float:left;">
<EF:EFRegion id="companyTree" title="BOM结构图" fitHeight="true">
<EF:EFTree id="materialTree"
valueField="label"
textField="text"
hasChildren="leaf"
serviceName="HGSC004A"
methodName="queryTreeNode">
</EF:EFTree>
</EF:EFRegion>
</div>
<div id="right-pane" class="i-fit-height" style="width: 80%;float: right">
<EF:EFRegion id="result" title="明细信息">
<EF:EFGrid blockId="result" autoDraw="no" checkMode="single">
<EF:EFColumn ename="id" cname="主键" hidden="true"/>
<EF:EFColumn ename="lv" cname="层级" hidden="true"/>
<EF:EFColumn enable="false" ename="parentProdCode" hidden="true" cname="上级产品编号"/>
<EF:EFColumn enable="false" ename="parentProdName" hidden="true" cname="上级产品名称"/>
<EF:EFColumn enable="false" ename="productId" hidden="true" cname="产品id"/>
<EF:EFColumn enable="false" ename="productType" hidden="true" cname="产品类型"/>
<EF:EFColumn ename="operator" cname="操作" width="140" enable="false" readonly="false"/>
<EF:EFComboColumn cname="变更类型" ename="changeType" width="90" align="center" enable="false" required="false">
<EF:EFCodeOption codeName="hggp.sc.changeType" />
</EF:EFComboColumn>
<EF:EFColumn ename="productCode" required="true" cname="产品编号" />
<EF:EFColumn ename="productName" cname="产品名称" width="120" align="center" enable="false"/>
<EF:EFColumn ename="quantity" required="true" cname="数量"/>
<EF:EFColumn ename="singleWeight" required="true" format="{0:N3}" cname="单重(kg)"/>
<EF:EFColumn enable="true" required="true" format="{0:N3}" ename="totalWeight" cname="总重(kg)"/>
<EF:EFComboColumn cname="提交状态" ename="productStatus" width="90" align="center" required="false">
<EF:EFCodeOption codeName="hggp.sc.productStatus" />
</EF:EFComboColumn>
</EF:EFGrid>
</EF:EFRegion>
</div>
</div>
</EF:EFPage>
<script>
let ctx="${ctx}";
</script>
<script src="${ctx}/HG/SC/HGSC004A.js"></script>
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