Commit 812510a5 by 971729

修改HPKC006 HPKC007

parent 8be369a9
......@@ -14,19 +14,42 @@ package com.baosight.hpjx.common;
*}});
*/
public enum DdynamicEnum {
//------------------------------------配置管理-----------------------------------
/**
* 模块:供应商档案
* 用途:供应商档案下拉框.
* 编写:wwl.
* 用途:供应商档案下拉框
* 编写:wwl
*/
SUPPLIER_RECORD_BLOCK_ID("supplier_record_block_id","CUST_CODE","CUST_NAME","HPPZ002.queryComboBox"),
SUPPLIER_RECORD_BLOCK_ID("supplier_record_block_id","custCode","custName","HPPZ002.queryComboBox"),
/**
* 模块:客户档案
* 用途:客户档案下拉框.
* 编写:wwl.
* 用途:客户档案下拉框
* 编写:wwl
*/
CUSTOMER_RECORD_BLOCK_ID("customer_record_block_id","CUST_CODE","CUST_NAME","HPPZ003.queryComboBox");
CUSTOMER_RECORD_BLOCK_ID("customer_record_block_id","custCode","custName","HPPZ003.queryComboBox"),
/**
* 模块:存货名称
* 用途:存货名称下拉框
* 编写:wwl
*/
INVENT_NAME_BLOCK_ID("invent_name_block_id","inventCode","inventName","HPPZ004.queryComboBox"),
/**
* 模块:仓库档案
* 用途:仓库档案下拉框
* 编写:wwl
*/
WH_RECORD_BLOCK_ID("wh_record_block_id","whCode","whName","HPPZ007.queryComboBox"),
//------------------------------------生产管理-----------------------------------
/**
* 模块:项目档案
* 用途:项目档案下拉框
* 编写:wwl
*/
PROJ_RECORD_BLOCK_ID("proj_record_block_id","projCode","projName","HPSC001.queryComboBox");
/** 将结果集放入的块名 */
......
package com.baosight.hpjx.common;
import com.baosight.iplat4j.core.ei.EiBlock;
import java.util.ArrayList;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
/**
* @Author wwl
* @Date 2024/1/10 14:29
*/
public enum InventTypeEnun {
MATERIAL(1,"原材料"),
CONSUMABLE(2,"耗材"),
SEMI_FINISHED_PRODUCT(2,"半成品"),
FINISHED_PRODUCT(2,"产成品");
private Integer code;
private String value;
InventTypeEnun(Integer code, String value) {
this.code = code;
this.value = value;
}
public Integer getCode() {
return code;
}
public void setCode(Integer code) {
this.code = code;
}
public String getValue() {
return value;
}
public void setValue(String value) {
this.value = value;
}
public static EiBlock generatorEiBlock() {
EiBlock block = new EiBlock("customer_type_block_id");
List<Map<String, Object>> rows = new ArrayList<Map<String, Object>>() {{
add(new HashMap<String, Object>() {{
put(HPConstants.TEXT_FIELD, MATERIAL.code);
put(HPConstants.VALUE_FIELD, MATERIAL.value);
}});
add(new HashMap<String, Object>() {{
put(HPConstants.TEXT_FIELD, CONSUMABLE.code);
put(HPConstants.VALUE_FIELD, CONSUMABLE.value);
}});
add(new HashMap<String, Object>() {{
put(HPConstants.TEXT_FIELD, SEMI_FINISHED_PRODUCT.code);
put(HPConstants.VALUE_FIELD, SEMI_FINISHED_PRODUCT.value);
}});
add(new HashMap<String, Object>() {{
put(HPConstants.TEXT_FIELD, FINISHED_PRODUCT.code);
put(HPConstants.VALUE_FIELD, FINISHED_PRODUCT.value);
}});
}};
block.setRows(rows);
return block;
}
}
......@@ -15,6 +15,7 @@ import java.sql.Timestamp;
import com.baosight.iplat4j.core.ei.EiColumn;
import com.baosight.iplat4j.core.data.DaoEPBase;
import java.util.Date;
import java.util.HashMap;
import java.util.Map;
......@@ -29,7 +30,7 @@ public class HPKC006 extends DaoEPBase {
private Integer id = 0;
private String companyCode = " "; /* 企业编码 预留*/
private String depCode = " "; /* 部门编码 预留*/
private Timestamp receiptTime; /* 单据日期*/
private Date receiptTime; /* 单据日期*/
private String otherEnthouse = " "; /* 其他入库单号*/
private String whCode = " "; /* 仓库编码*/
private String whName = " "; /* 仓库名称*/
......@@ -174,14 +175,14 @@ public class HPKC006 extends DaoEPBase {
* get the receiptTime - 单据日期
* @return the receiptTime
*/
public Timestamp getReceiptTime() {
public Date getReceiptTime() {
return this.receiptTime;
}
/**
* set the receiptTime - 单据日期
*/
public void setReceiptTime(Timestamp receiptTime) {
public void setReceiptTime(Date receiptTime) {
this.receiptTime = receiptTime;
}
......@@ -358,7 +359,7 @@ public class HPKC006 extends DaoEPBase {
setId(NumberUtils.toInteger(StringUtils.toString(map.get("id")), id));
setCompanyCode(StringUtils.defaultIfEmpty(StringUtils.toString(map.get("companyCode")), companyCode));
setDepCode(StringUtils.defaultIfEmpty(StringUtils.toString(map.get("depCode")), depCode));
setReceiptTime(DateUtils.toTimestamp(StringUtils.toString(map.get("receiptTime"))));
setReceiptTime(DateUtils.toDate(StringUtils.toString(map.get("receiptTime"))));
setOtherEnthouse(StringUtils.defaultIfEmpty(StringUtils.toString(map.get("otherEnthouse")), otherEnthouse));
setWhCode(StringUtils.defaultIfEmpty(StringUtils.toString(map.get("whCode")), whCode));
setWhName(StringUtils.defaultIfEmpty(StringUtils.toString(map.get("whName")), whName));
......@@ -381,7 +382,7 @@ public class HPKC006 extends DaoEPBase {
map.put("id", StringUtils.toString(id, eiMetadata.getMeta("id")));
map.put("companyCode", StringUtils.toString(companyCode, eiMetadata.getMeta("companyCode")));
map.put("depCode", StringUtils.toString(depCode, eiMetadata.getMeta("depCode")));
map.put("receiptTime", StringUtils.toString(receiptTime, eiMetadata.getMeta("receiptTime")));
map.put("receiptTime",StringUtils.toString(receiptTime, eiMetadata.getMeta("receiptTime")));
map.put("otherEnthouse", StringUtils.toString(otherEnthouse, eiMetadata.getMeta("otherEnthouse")));
map.put("whCode", StringUtils.toString(whCode, eiMetadata.getMeta("whCode")));
......
......@@ -9,6 +9,8 @@ import com.baosight.iplat4j.core.util.DateUtils;
import java.sql.Timestamp;
import com.baosight.iplat4j.core.ei.EiColumn;
import com.baosight.iplat4j.core.data.DaoEPBase;
import java.util.Date;
import java.util.HashMap;
import java.util.Map;
import com.baosight.iplat4j.core.util.StringUtils;
......@@ -22,7 +24,7 @@ public class HPKC007 extends DaoEPBase {
private Integer id = 0;
private String companyCode = " "; /* 企业编码 预留*/
private String depCode = " "; /* 部门编码 预留*/
private Timestamp receiptTime ; /* 单据日期*/
private Date receiptTime ; /* 单据日期*/
private String otherEnthouse = " "; /* 其他入库单号*/
private String whCode = " "; /* 仓库编码*/
private String whName = " "; /* 仓库名称*/
......@@ -157,14 +159,14 @@ initMetaData();
* get the receiptTime - 单据日期
* @return the receiptTime
*/
public Timestamp getReceiptTime() {
public Date getReceiptTime() {
return this.receiptTime;
}
/**
* set the receiptTime - 单据日期
*/
public void setReceiptTime(Timestamp receiptTime) {
public void setReceiptTime(Date receiptTime) {
this.receiptTime = receiptTime;
}
/**
......@@ -315,7 +317,9 @@ public void fromMap(Map map) {
setId(NumberUtils.toInteger(StringUtils.toString(map.get("id")), id));
setCompanyCode(StringUtils.defaultIfEmpty(StringUtils.toString(map.get("companyCode")), companyCode));
setDepCode(StringUtils.defaultIfEmpty(StringUtils.toString(map.get("depCode")), depCode));
setReceiptTime(DateUtils.toTimestamp(StringUtils.toString(map.get("receiptTime"))));
setReceiptTime(DateUtils.toDate(StringUtils.toString(map.get("receiptTime"))));
setOtherEnthouse(StringUtils.defaultIfEmpty(StringUtils.toString(map.get("otherEnthouse")), otherEnthouse));
setWhCode(StringUtils.defaultIfEmpty(StringUtils.toString(map.get("whCode")), whCode));
setWhName(StringUtils.defaultIfEmpty(StringUtils.toString(map.get("whName")), whName));
......
......@@ -15,7 +15,7 @@ import com.baosight.iplat4j.core.util.StringUtils;
* Thpkc008
*
*/
public class Thpkc008 extends DaoEPBase {
public class HPKC008 extends DaoEPBase {
private Long id = 0L;
private String companyCode = " "; /* 企业编码 预留*/
......@@ -113,7 +113,7 @@ EiColumn eiColumn;
/**
* the constructor
*/
public Thpkc008() {
public HPKC008() {
initMetaData();
}
......
......@@ -6,9 +6,12 @@ import com.baosight.iplat4j.core.ei.EiInfo;
import com.baosight.iplat4j.core.exception.PlatException;
import com.baosight.iplat4j.core.service.impl.ServiceBase;
import com.baosight.hpjx.hp.kc.domain.HPKC006;
import com.baosight.iplat4j.core.web.threadlocal.UserSession;
import java.sql.Timestamp;
import java.text.SimpleDateFormat;
import java.util.Date;
import java.util.Map;
public class ServiceHPKC006 extends ServiceBase {
......@@ -28,6 +31,7 @@ public class ServiceHPKC006 extends ServiceBase {
public EiInfo query(EiInfo inInfo) {
/* 调用EI查询方法.*/
EiInfo outInfo = super.query(inInfo, "HPKC006.query", new HPKC006());
System.out.println(outInfo);
return outInfo;
}
......@@ -37,7 +41,7 @@ public class ServiceHPKC006 extends ServiceBase {
*/
@Override
public EiInfo insert(EiInfo inInfo) {
SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss");
SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd");
try {
HPKC006 hpkc006 = new HPKC006();
// System.out.println(inInfo.getBlock("result"));
......@@ -48,6 +52,8 @@ public class ServiceHPKC006 extends ServiceBase {
Map<?, ?> map = eiBlock.getRow(i);
// System.out.println(map);
hpkc006.fromMap(map);
System.out.println(UserSession.getSessionJson());
System.out.println(Timestamp.valueOf(sdf.format(new Date())));
this.dao.insert("HPKC006.insert", hpkc006.toMap());
}
......
package com.baosight.hpjx.hp.kc.service;
import com.baosight.hpjx.common.CompanyTypeEnum;
import com.baosight.hpjx.hp.kc.domain.HPKC008;
import com.baosight.hpjx.util.StringUtil;
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.service.impl.ServiceBase;
import com.baosight.hpjx.util.CommonMethod;
import com.baosight.hpjx.hp.kc.domain.Thpkc008;
import com.baosight.hpjx.hp.kc.domain.HPKC008;
import java.util.Map;
/**
* @author xuao
* @author zjh
* @date 2024年01月09日 10:18
*/
public class ServiceHPKC008 extends ServiceBase {
......@@ -20,10 +21,10 @@ public class ServiceHPKC008 extends ServiceBase {
* 画面初始化.
*/
public EiInfo initLoad(EiInfo inInfo) {
Thpkc008 HPKC008 = new Thpkc008();
HPKC008 HPKC008 = new HPKC008();
EiInfo outInfo = super.initLoad(inInfo, HPKC008);
outInfo.addBlock(EiConstant.resultBlock).addBlockMeta(HPKC008.eiMetadata);
outInfo.setBlock(CompanyTypeEnum.generatorEiBlock());
outInfo.addBlock(EiConstant.queryBlock).setCell(0,"datemonth",CommonMethod.getCurrentSameYearMonth());
outInfo.getBlock(EiConstant.resultBlock).getRows().clear();
return outInfo;
}
......@@ -32,9 +33,10 @@ public class ServiceHPKC008 extends ServiceBase {
*/
@Override
public EiInfo query(EiInfo inInfo) {
String datemonth = inInfo.getCellStr(EiConstant.queryBlock,0,"datemonth");
inInfo.setCell(EiConstant.queryBlock,0,"datemonth", StringUtil.removeHorizontalLine(datemonth));
/* 调用EI查询方法.*/
EiInfo outInfo = super.query(inInfo, "HPKC008.query", new Thpkc008());
return outInfo;
return super.query(inInfo, "HPKC008.query", new HPKC008());
}
......@@ -43,28 +45,13 @@ public class ServiceHPKC008 extends ServiceBase {
*/
@Override
public EiInfo insert(EiInfo inInfo) {
try {
CommonMethod.creatorInfo(inInfo,EiConstant.resultBlock);
super.insert(inInfo,"HPKC008.insert");
// Thpkc008 HPKC008 = new Thpkc008();
// EiBlock eiBlock = inInfo.getBlock(EiConstant.resultBlock);
// for (int i = 0; i < eiBlock.getRowCount(); i++) {
// Map<?, ?> map = eiBlock.getRow(i);
// HPKC008.fromMap(map);
// this.dao.insertBatch()//insert("HPKC008.insert", HPKC008.toMap());
// }
inInfo.setStatus(EiConstant.STATUS_SUCCESS);
inInfo.setMsg("新增成功!");
} catch (PlatException e) {
e.printStackTrace();
inInfo.setStatus(EiConstant.STATUS_FAILURE);
inInfo.setMsg("新增失败!原因参见详细错误描述!");
inInfo.setDetailMsg(e.getMessage());
logError("新增失败", e.getMessage());
return inInfo;
CommonMethod.creatorInfo(inInfo,EiConstant.resultBlock);
for (int i = 0; i < inInfo.getBlock(EiConstant.resultBlock).getRowCount(); i++) {
String datemonth = inInfo.getCellStr(EiConstant.resultBlock,i,"datemonth");
inInfo.setCell(EiConstant.resultBlock,i,"datemonth", StringUtil.removeHorizontalLine(datemonth));
}
return inInfo;
return super.insert(inInfo,"HPKC008.insert");
}
......@@ -73,7 +60,7 @@ public class ServiceHPKC008 extends ServiceBase {
*/
public EiInfo update(EiInfo inInfo) {
try {
Thpkc008 HPKC008 = new Thpkc008();
HPKC008 HPKC008 = new HPKC008();
EiBlock eiBlock = inInfo.getBlock(EiConstant.resultBlock);
for (int i = 0; i < eiBlock.getRowCount(); i++) {
Map<?, ?> map = eiBlock.getRow(i);
......@@ -97,7 +84,7 @@ public class ServiceHPKC008 extends ServiceBase {
* 删除操作.
*/
public EiInfo delete(EiInfo eiInfo) {
Thpkc008 HPKC008 = new Thpkc008();
HPKC008 HPKC008 = new HPKC008();
EiBlock eiBlock = eiInfo.getBlock(EiConstant.resultBlock);
try {
for (int i = 0; i < eiBlock.getRowCount(); i++) {
......
......@@ -42,7 +42,8 @@
REMARK as "remark" <!-- 备注 -->
FROM hpjx.t_hpkc006 WHERE 1=1
<isNotEmpty prepend=" AND " property="receiptTime">
RECEIPT_TIME LIKE CONCAT('%' ,CONCAT( #receiptTime#,'%'))
RECEIPT_TIME STR_TO_DATE(#receiptTime#, 'yyyy-MM-dd')
</isNotEmpty>
<isNotEmpty prepend=" AND " property="otherEnthouse">
......
......@@ -23,7 +23,8 @@
<sqlMap namespace="HPKC008">
<select id="query" parameterClass="java.util.HashMap"
resultClass="com.baosight.hpjx.hp.kc.domain.Thpkc008">
resultClass="com.baosight.hpjx.hp.kc.domain.HPKC008">
SELECT
ID as "id",
COMPANY_CODE as "companyCode", <!-- 企业编码 预留 -->
......@@ -45,10 +46,10 @@
ID = #id#
</isNotEmpty>
<isNotEmpty prepend=" AND " property="datemonth">
datemonth = #datemonth#
DATEMONTH = #datemonth#
</isNotEmpty>
<isNotEmpty prepend=" AND " property="statisticalNumber">
statisticalNumber = #statisticalNumber#
STATISTICAL_NUMBER = #statisticalNumber#
</isNotEmpty>
<dynamic prepend="ORDER BY">
<isNotEmpty property="orderBy">
......@@ -106,8 +107,6 @@
PRICE = #price#, <!-- 单价 -->
TOTAL_PRICE = #totalPrice#, <!-- 金额 -->
NOTES = #notes#, <!-- 备注 -->
CREATED_BY = #createdBy#, <!-- 创建人 -->
CREATED_TIME = #createdTime#, <!-- 创建时间 -->
UPDATED_BY = #updatedBy#, <!-- 更新人 -->
UPDATED_TIME = #updatedTime# <!-- 更新时间 -->
WHERE
......
......@@ -16,7 +16,7 @@ import com.baosight.iplat4j.core.util.StringUtils;
*/
public class THppz004 extends DaoEPBase {
private Integer id = 0;
private Long id = 0L;
private String companyCode = " "; /* 企业编码 预留*/
private String inventName = " "; /* 存货名称*/
private String inventCode = " "; /* 存货编码*/
......@@ -91,14 +91,14 @@ initMetaData();
* get the id
* @return the id
*/
public Integer getId() {
public Long getId() {
return this.id;
}
/**
* set the id
*/
public void setId(Integer id) {
public void setId(Long id) {
this.id = id;
}
/**
......@@ -246,7 +246,7 @@ initMetaData();
*/
public void fromMap(Map map) {
setId(NumberUtils.toInteger(StringUtils.toString(map.get("id")), id));
setId(NumberUtils.toLong(StringUtils.toString(map.get("id")), id));
setCompanyCode(StringUtils.defaultIfEmpty(StringUtils.toString(map.get("companyCode")), companyCode));
setInventName(StringUtils.defaultIfEmpty(StringUtils.toString(map.get("inventName")), inventName));
setInventCode(StringUtils.defaultIfEmpty(StringUtils.toString(map.get("inventCode")), inventCode));
......
/**
* Generate time : 2024-01-10 18:46:04
* Version : 1.0
*/
package com.baosight.hpjx.hp.pz.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;
/**
* THppz006
*
*/
public class THppz006 extends DaoEPBase {
private Long id = 0L;
private String companyCode = " "; /* 企业编码 预留*/
private int inventName; /* 存货名称*/
private int inventCode; /* 存货编码*/
private int inventType; /* 存货类型*/
private int status; /* 状态 0未启用 1启用*/
private String spec = " "; /* 规格*/
private String length = " "; /* 长*/
private String wide = " "; /* 宽*/
private String thick = " "; /* 厚*/
private String material = " "; /* 材质*/
private String coefficient = " "; /* 系数*/
private String unit = " "; /* 单位*/
private String createdBy = " "; /* 创建人*/
private String createdTime = " "; /* 创建时间*/
private String updatedBy = " "; /* 更新人*/
private String updatedTime = " "; /* 更新时间*/
private String depCode = " "; /* 部门编码*/
/**
* initialize the metadata
*/
public void initMetaData() {
EiColumn eiColumn;
eiColumn = new EiColumn("id");
eiColumn.setPrimaryKey(true);
eiColumn.setDescName(" ");
eiMetadata.addMeta(eiColumn);
eiColumn = new EiColumn("companyCode");
eiColumn.setDescName("企业编码 预留");
eiMetadata.addMeta(eiColumn);
eiColumn = new EiColumn("inventName");
eiColumn.setDescName("存货名称");
eiMetadata.addMeta(eiColumn);
eiColumn = new EiColumn("inventCode");
eiColumn.setDescName("存货编码");
eiMetadata.addMeta(eiColumn);
eiColumn = new EiColumn("inventType");
eiColumn.setDescName("存货类型");
eiMetadata.addMeta(eiColumn);
eiColumn = new EiColumn("status");
eiColumn.setDescName("状态 0未启用 1启用");
eiMetadata.addMeta(eiColumn);
eiColumn = new EiColumn("spec");
eiColumn.setDescName("规格");
eiMetadata.addMeta(eiColumn);
eiColumn = new EiColumn("length");
eiColumn.setDescName("长");
eiMetadata.addMeta(eiColumn);
eiColumn = new EiColumn("wide");
eiColumn.setDescName("宽");
eiMetadata.addMeta(eiColumn);
eiColumn = new EiColumn("thick");
eiColumn.setDescName("厚");
eiMetadata.addMeta(eiColumn);
eiColumn = new EiColumn("material");
eiColumn.setDescName("材质");
eiMetadata.addMeta(eiColumn);
eiColumn = new EiColumn("coefficient");
eiColumn.setDescName("系数");
eiMetadata.addMeta(eiColumn);
eiColumn = new EiColumn("unit");
eiColumn.setDescName("单位");
eiMetadata.addMeta(eiColumn);
eiColumn = new EiColumn("createdBy");
eiColumn.setDescName("创建人");
eiMetadata.addMeta(eiColumn);
eiColumn = new EiColumn("createdTime");
eiColumn.setDescName("创建时间");
eiMetadata.addMeta(eiColumn);
eiColumn = new EiColumn("updatedBy");
eiColumn.setDescName("更新人");
eiMetadata.addMeta(eiColumn);
eiColumn = new EiColumn("updatedTime");
eiColumn.setDescName("更新时间");
eiMetadata.addMeta(eiColumn);
eiColumn = new EiColumn("depCode");
eiColumn.setDescName("部门编码");
eiMetadata.addMeta(eiColumn);
}
/**
* the constructor
*/
public THppz006() {
initMetaData();
}
/**
* get the id
* @return the id
*/
public Long getId() {
return this.id;
}
/**
* set the id
*/
public void setId(Long id) {
this.id = id;
}
/**
* get the companyCode - 企业编码 预留
* @return the companyCode
*/
public String getCompanyCode() {
return this.companyCode;
}
/**
* set the companyCode - 企业编码 预留
*/
public void setCompanyCode(String companyCode) {
this.companyCode = companyCode;
}
/**
* get the inventName - 存货名称
* @return the inventName
*/
public int getInventName() {
return this.inventName;
}
/**
* set the inventName - 存货名称
*/
public void setInventName(int inventName) {
this.inventName = inventName;
}
/**
* get the inventCode - 存货编码
* @return the inventCode
*/
public int getInventCode() {
return this.inventCode;
}
/**
* set the inventCode - 存货编码
*/
public void setInventCode(int inventCode) {
this.inventCode = inventCode;
}
/**
* get the inventType - 存货类型
* @return the inventType
*/
public int getInventType() {
return this.inventType;
}
/**
* set the inventType - 存货类型
*/
public void setInventType(int inventType) {
this.inventType = inventType;
}
/**
* get the status - 状态 0未启用 1启用
* @return the status
*/
public int getStatus() {
return this.status;
}
/**
* set the status - 状态 0未启用 1启用
*/
public void setStatus(int status) {
this.status = status;
}
/**
* get the spec - 规格
* @return the spec
*/
public String getSpec() {
return this.spec;
}
/**
* set the spec - 规格
*/
public void setSpec(String spec) {
this.spec = spec;
}
/**
* get the length - 长
* @return the length
*/
public String getLength() {
return this.length;
}
/**
* set the length - 长
*/
public void setLength(String length) {
this.length = length;
}
/**
* get the wide - 宽
* @return the wide
*/
public String getWide() {
return this.wide;
}
/**
* set the wide - 宽
*/
public void setWide(String wide) {
this.wide = wide;
}
/**
* get the thick - 厚
* @return the thick
*/
public String getThick() {
return this.thick;
}
/**
* set the thick - 厚
*/
public void setThick(String thick) {
this.thick = thick;
}
/**
* get the material - 材质
* @return the material
*/
public String getMaterial() {
return this.material;
}
/**
* set the material - 材质
*/
public void setMaterial(String material) {
this.material = material;
}
/**
* get the coefficient - 系数
* @return the coefficient
*/
public String getCoefficient() {
return this.coefficient;
}
/**
* set the coefficient - 系数
*/
public void setCoefficient(String coefficient) {
this.coefficient = coefficient;
}
/**
* get the unit - 单位
* @return the unit
*/
public String getUnit() {
return this.unit;
}
/**
* set the unit - 单位
*/
public void setUnit(String unit) {
this.unit = unit;
}
/**
* get the createdBy - 创建人
* @return the createdBy
*/
public String getCreatedBy() {
return this.createdBy;
}
/**
* set the createdBy - 创建人
*/
public void setCreatedBy(String createdBy) {
this.createdBy = createdBy;
}
/**
* get the createdTime - 创建时间
* @return the createdTime
*/
public String getCreatedTime() {
return this.createdTime;
}
/**
* set the createdTime - 创建时间
*/
public void setCreatedTime(String createdTime) {
this.createdTime = createdTime;
}
/**
* get the updatedBy - 更新人
* @return the updatedBy
*/
public String getUpdatedBy() {
return this.updatedBy;
}
/**
* set the updatedBy - 更新人
*/
public void setUpdatedBy(String updatedBy) {
this.updatedBy = updatedBy;
}
/**
* get the updatedTime - 更新时间
* @return the updatedTime
*/
public String getUpdatedTime() {
return this.updatedTime;
}
/**
* set the updatedTime - 更新时间
*/
public void setUpdatedTime(String updatedTime) {
this.updatedTime = updatedTime;
}
/**
* get the depCode - 部门编码
* @return the depCode
*/
public String getDepCode() {
return this.depCode;
}
/**
* set the depCode - 部门编码
*/
public void setDepCode(String depCode) {
this.depCode = depCode;
}
/**
* get the value from Map
*/
public void fromMap(Map map) {
setId(NumberUtils.toLong(StringUtils.toString(map.get("id")), id));
setCompanyCode(StringUtils.defaultIfEmpty(StringUtils.toString(map.get("companyCode")), companyCode));
setInventName(NumberUtils.toint(StringUtils.toString(map.get("inventName")), inventName));
setInventCode(NumberUtils.toint(StringUtils.toString(map.get("inventCode")), inventCode));
setInventType(NumberUtils.toint(StringUtils.toString(map.get("inventType")), inventType));
setStatus(NumberUtils.toint(StringUtils.toString(map.get("status")), status));
setSpec(StringUtils.defaultIfEmpty(StringUtils.toString(map.get("spec")), spec));
setLength(StringUtils.defaultIfEmpty(StringUtils.toString(map.get("length")), length));
setWide(StringUtils.defaultIfEmpty(StringUtils.toString(map.get("wide")), wide));
setThick(StringUtils.defaultIfEmpty(StringUtils.toString(map.get("thick")), thick));
setMaterial(StringUtils.defaultIfEmpty(StringUtils.toString(map.get("material")), material));
setCoefficient(StringUtils.defaultIfEmpty(StringUtils.toString(map.get("coefficient")), coefficient));
setUnit(StringUtils.defaultIfEmpty(StringUtils.toString(map.get("unit")), unit));
setCreatedBy(StringUtils.defaultIfEmpty(StringUtils.toString(map.get("createdBy")), createdBy));
setCreatedTime(StringUtils.defaultIfEmpty(StringUtils.toString(map.get("createdTime")), createdTime));
setUpdatedBy(StringUtils.defaultIfEmpty(StringUtils.toString(map.get("updatedBy")), updatedBy));
setUpdatedTime(StringUtils.defaultIfEmpty(StringUtils.toString(map.get("updatedTime")), updatedTime));
setDepCode(StringUtils.defaultIfEmpty(StringUtils.toString(map.get("depCode")), depCode));
}
/**
* set the value to Map
*/
public Map toMap() {
Map map = new HashMap();
map.put("id",StringUtils.toString(id, eiMetadata.getMeta("id")));
map.put("companyCode",StringUtils.toString(companyCode, eiMetadata.getMeta("companyCode")));
map.put("inventName",StringUtils.toString(inventName, eiMetadata.getMeta("inventName")));
map.put("inventCode",StringUtils.toString(inventCode, eiMetadata.getMeta("inventCode")));
map.put("inventType",StringUtils.toString(inventType, eiMetadata.getMeta("inventType")));
map.put("status",StringUtils.toString(status, eiMetadata.getMeta("status")));
map.put("spec",StringUtils.toString(spec, eiMetadata.getMeta("spec")));
map.put("length",StringUtils.toString(length, eiMetadata.getMeta("length")));
map.put("wide",StringUtils.toString(wide, eiMetadata.getMeta("wide")));
map.put("thick",StringUtils.toString(thick, eiMetadata.getMeta("thick")));
map.put("material",StringUtils.toString(material, eiMetadata.getMeta("material")));
map.put("coefficient",StringUtils.toString(coefficient, eiMetadata.getMeta("coefficient")));
map.put("unit",StringUtils.toString(unit, eiMetadata.getMeta("unit")));
map.put("createdBy",StringUtils.toString(createdBy, eiMetadata.getMeta("createdBy")));
map.put("createdTime",StringUtils.toString(createdTime, eiMetadata.getMeta("createdTime")));
map.put("updatedBy",StringUtils.toString(updatedBy, eiMetadata.getMeta("updatedBy")));
map.put("updatedTime",StringUtils.toString(updatedTime, eiMetadata.getMeta("updatedTime")));
map.put("depCode",StringUtils.toString(depCode, eiMetadata.getMeta("depCode")));
return map;
}
}
\ No newline at end of file
package com.baosight.hpjx.hp.pz.service;
import com.baosight.hpjx.common.CompanyTypeEnum;
import com.baosight.hpjx.util.CommonMethod;
import com.baosight.iplat4j.core.ei.EiBlock;
import com.baosight.iplat4j.core.ei.EiConstant;
......@@ -22,8 +23,11 @@ public class ServiceHPPZ002 extends ServiceBase {
public EiInfo initLoad(EiInfo inInfo) {
THppz002 hppz002 = new THppz002();
EiInfo outInfo = new EiInfo();
outInfo.addBlock(EiConstant.queryBlock);
outInfo.getBlock(EiConstant.queryBlock).addBlockMeta(hppz002.eiMetadata);
outInfo.addBlock(EiConstant.resultBlock);
outInfo.getBlock(EiConstant.resultBlock).addBlockMeta(hppz002.eiMetadata);
outInfo.setBlock(CompanyTypeEnum.generatorEiBlock());
return outInfo;
}
......@@ -45,15 +49,13 @@ public class ServiceHPPZ002 extends ServiceBase {
public EiInfo insert(EiInfo inInfo) {
try {
CommonMethod.creatorInfo(inInfo,EiConstant.resultBlock);
super.insert(inInfo,"HPPZ002.insert");
// THppz002 hppz002 = new THppz002();
// EiBlock eiBlock = inInfo.getBlock(EiConstant.resultBlock);
// for (int i = 0; i < eiBlock.getRowCount(); i++) {
// Map<?, ?> map = eiBlock.getRow(i);
// hppz002.fromMap(map);
//
// this.dao.insert("HPPZ002.insert", hppz002.toMap());
// }
THppz002 hppz002 = new THppz002();
EiBlock eiBlock = inInfo.getBlock(EiConstant.resultBlock);
for (int i = 0; i < eiBlock.getRowCount(); i++) {
Map<?, ?> map = eiBlock.getRow(i);
hppz002.fromMap(map);
this.dao.insert("HPPZ002.insert", hppz002.toMap());
}
inInfo.setStatus(EiConstant.STATUS_SUCCESS);
inInfo.setMsg("新增成功!");
......@@ -74,6 +76,7 @@ public class ServiceHPPZ002 extends ServiceBase {
*/
public EiInfo update(EiInfo inInfo) {
try {
CommonMethod.creatorInfo(inInfo,EiConstant.resultBlock);
THppz002 HPPZ002 = new THppz002();
EiBlock eiBlock = inInfo.getBlock(EiConstant.resultBlock);
for (int i = 0; i < eiBlock.getRowCount(); i++) {
......
......@@ -45,15 +45,14 @@ public class ServiceHPPZ004 extends ServiceBase {
public EiInfo insert(EiInfo inInfo) {
try {
CommonMethod.creatorInfo(inInfo,EiConstant.resultBlock);
super.insert(inInfo,"HPPZ004.insert");
// THppz002 hppz002 = new THppz002();
// EiBlock eiBlock = inInfo.getBlock(EiConstant.resultBlock);
// for (int i = 0; i < eiBlock.getRowCount(); i++) {
// Map<?, ?> map = eiBlock.getRow(i);
// hppz002.fromMap(map);
//
// this.dao.insert("HPPZ002.insert", hppz002.toMap());
// }
THppz004 hppz004 = new THppz004();
EiBlock eiBlock = inInfo.getBlock(EiConstant.resultBlock);
for (int i = 0; i < eiBlock.getRowCount(); i++) {
Map<?, ?> map = eiBlock.getRow(i);
hppz004.fromMap(map);
this.dao.insert("HPPZ004.insert", hppz004.toMap());
}
inInfo.setStatus(EiConstant.STATUS_SUCCESS);
inInfo.setMsg("新增成功!");
......@@ -74,6 +73,7 @@ public class ServiceHPPZ004 extends ServiceBase {
*/
public EiInfo update(EiInfo inInfo) {
try {
CommonMethod.creatorInfo(inInfo,EiConstant.resultBlock);
THppz004 HPPZ004 = new THppz004();
EiBlock eiBlock = inInfo.getBlock(EiConstant.resultBlock);
for (int i = 0; i < eiBlock.getRowCount(); i++) {
......
package com.baosight.hpjx.hp.pz.service;
import com.baosight.hpjx.hp.pz.domain.THppz006;
import com.baosight.hpjx.util.CommonMethod;
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.service.impl.ServiceBase;
import java.util.Map;
/**
* @author xuao
* @date 2024年01月10日 15:51
*/
public class ServiceHPPZ006 extends ServiceBase {
/**
* 画面初始化.
*/
public EiInfo initLoad(EiInfo inInfo) {
THppz006 hppz006 = new THppz006();
EiInfo outInfo = new EiInfo();
outInfo.addBlock(EiConstant.resultBlock);
outInfo.getBlock(EiConstant.resultBlock).addBlockMeta(hppz006.eiMetadata);
return outInfo;
}
/**
* 查询操作.
*/
@Override
public EiInfo query(EiInfo inInfo) {
/* 调用EI查询方法.*/
EiInfo outInfo = super.query(inInfo, "HPPZ006.query", new THppz006());
return outInfo;
}
/**
* 新增操作.
*/
@Override
public EiInfo insert(EiInfo inInfo) {
try {
CommonMethod.creatorInfo(inInfo,EiConstant.resultBlock);
THppz006 hppz006 = new THppz006();
EiBlock eiBlock = inInfo.getBlock(EiConstant.resultBlock);
for (int i = 0; i < eiBlock.getRowCount(); i++) {
Map<?, ?> map = eiBlock.getRow(i);
hppz006.fromMap(map);
this.dao.insert("HPPZ006.insert", hppz006.toMap());
}
inInfo.setStatus(EiConstant.STATUS_SUCCESS);
inInfo.setMsg("新增成功!");
} catch (PlatException e) {
e.printStackTrace();
inInfo.setStatus(EiConstant.STATUS_FAILURE);
inInfo.setMsg("新增失败!原因参见详细错误描述!");
inInfo.setDetailMsg(e.getMessage());
logError("新增失败", e.getMessage());
return inInfo;
}
return inInfo;
}
/**
* 修改操作.
*/
public EiInfo update(EiInfo inInfo) {
try {
CommonMethod.creatorInfo(inInfo,EiConstant.resultBlock);
THppz006 hppz006 = new THppz006();
EiBlock eiBlock = inInfo.getBlock(EiConstant.resultBlock);
for (int i = 0; i < eiBlock.getRowCount(); i++) {
Map<?, ?> map = eiBlock.getRow(i);
hppz006.fromMap(map);
this.dao.update("HPPZ006.update", hppz006.toMap());
}
inInfo.setStatus(EiConstant.STATUS_SUCCESS);
inInfo.setMsg("修改成功!");
} catch (PlatException e) {
inInfo.setStatus(EiConstant.STATUS_FAILURE);
inInfo.setMsg("操作失败!原因参见详细错误描述!");
inInfo.setDetailMsg(e.getMessage());
logError("修改失败", e.getMessage());
return inInfo;
}
return query(inInfo);
}
/**
* 删除操作.
*/
public EiInfo delete(EiInfo eiInfo) {
THppz006 hppz006 = new THppz006();
EiBlock eiBlock = eiInfo.getBlock(EiConstant.resultBlock);
try {
for (int i = 0; i < eiBlock.getRowCount(); i++) {
Map<?, ?> map = eiBlock.getRow(i);
hppz006.fromMap(map);
this.dao.delete("HPPZ006.delete", hppz006.toMap());
}
} catch (PlatException e) {
eiInfo.setStatus(EiConstant.STATUS_FAILURE);
eiInfo.setMsg("删除失败,原因参见详细错误描述!");
eiInfo.setDetailMsg(e.getMessage());
logError("删除失败!", e.getMessage());
return eiInfo;
}
eiInfo.setStatus(EiConstant.STATUS_SUCCESS);
eiInfo.setMsg("删除成功!");
return eiInfo;
}
}
......@@ -79,6 +79,7 @@ public class ServiceHPPZ007 extends ServiceBase {
hppz007.fromMap(map);
hppz007.setUpdatedBy(UserSession.getLoginName());
hppz007.setUpdatedTime(Timestamp.valueOf(sdf.format(new Date())));
System.out.println(Timestamp.valueOf(sdf.format(new Date())));
this.dao.update("HPPZ007.update", hppz007.toMap());
}
inInfo.setStatus(EiConstant.STATUS_SUCCESS);
......
......@@ -134,4 +134,18 @@
ID = #id#
</update>
<select id="queryComboBox" parameterClass="java.util.HashMap"
resultClass="java.util.HashMap">
SELECT DISTINCT
CUST_CODE as "custCode",
CUST_CNAME as "custName"
FROM hpjx.t_hppz003 WHERE 1=1
<isNotEmpty prepend=" AND " property="companyCode">
COMPANY_CODE = #companyCode#
</isNotEmpty>
<isNotEmpty prepend=" AND " property="custType">
CUST_TYPE = #custType#
</isNotEmpty>
ORDER BY CUST_CODE
</select>
</sqlMap>
\ No newline at end of file
......@@ -123,9 +123,24 @@
INVENT_TYPE = #inventType#, <!-- 存货类型 -->
STATUS = #status#, <!-- 状态 0未启用 1启用 -->
UPDATED_BY = #updatedBy#, <!-- 更新人 -->
UPDATED_TIME = #updatedTime#, <!-- 更新时间 -->
UPDATED_TIME = #updatedTime# <!-- 更新时间 -->
WHERE
ID = #id#
</update>
<select id="queryComboBox" parameterClass="java.util.HashMap"
resultClass="java.util.HashMap">
SELECT DISTINCT
INVENT_CODE as "inventCode",
INVENT_NAME as "inventName"
FROM hpjx.t_hppz004 WHERE 1=1
<isNotEmpty prepend=" AND " property="companyCode">
COMPANY_CODE = #companyCode#
</isNotEmpty>
<isNotEmpty prepend=" AND " property="inventType">
INVENT_TYPE = #inventType#
</isNotEmpty>
ORDER BY INVENT_CODE
</select>
</sqlMap>
\ No newline at end of file
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE sqlMap PUBLIC "-//iBATIS.com//DTD SQL Map 2.0//EN" "http://www.ibatis.com/dtd/sql-map-2.dtd">
<!-- table information
Generate time : 2024-01-10 15:43:22
Version : 1.0
tableName :hpjx.t_hppz006
ID BIGINT NOT NULL primarykey,
COMPANY_CODE VARCHAR NOT NULL,
INVENT_NAME VARCHAR NOT NULL,
INVENT_CODE VARCHAR NOT NULL,
INVENT_TYPE TINYINT NOT NULL,
STATUS TINYINT NOT NULL,
SPEC VARCHAR NOT NULL,
LENGTH VARCHAR NOT NULL,
WIDE VARCHAR NOT NULL,
THICK VARCHAR NOT NULL,
MATERIAL VARCHAR NOT NULL,
COEFFICIENT VARCHAR NOT NULL,
UNIT VARCHAR NOT NULL,
CREATED_BY VARCHAR,
CREATED_TIME VARCHAR,
UPDATED_BY VARCHAR,
UPDATED_TIME VARCHAR,
DEP_CODE VARCHAR
-->
<sqlMap namespace="HPPZ006">
<select id="query" parameterClass="java.util.HashMap"
resultClass="com.baosight.hpjx.hp.pz.domain.THppz006">
SELECT
ID as "id",
COMPANY_CODE as "companyCode", <!-- 企业编码 预留 -->
INVENT_NAME as "inventName", <!-- 存货名称 -->
INVENT_CODE as "inventCode", <!-- 存货编码 -->
INVENT_TYPE as "inventType", <!-- 存货类型 -->
STATUS as "status", <!-- 状态 0未启用 1启用 -->
SPEC as "spec", <!-- 规格 -->
LENGTH as "length", <!-- 长 -->
WIDE as "wide", <!-- 宽 -->
THICK as "thick", <!-- 厚 -->
MATERIAL as "material", <!-- 材质 -->
COEFFICIENT as "coefficient", <!-- 系数 -->
UNIT as "unit", <!-- 单位 -->
CREATED_BY as "createdBy", <!-- 创建人 -->
CREATED_TIME as "createdTime", <!-- 创建时间 -->
UPDATED_BY as "updatedBy", <!-- 更新人 -->
UPDATED_TIME as "updatedTime", <!-- 更新时间 -->
DEP_CODE as "depCode" <!-- 部门编码 -->
FROM hpjx.t_hppz006 WHERE 1=1
<isNotEmpty prepend=" AND " property="id">
ID = #id#
</isNotEmpty>
<isNotEmpty prepend=" AND " property="inventType">
INVENT_TYPE = #inventType#
</isNotEmpty>
<isNotEmpty prepend=" AND " property="inventName">
INVENT_NAME = #inventName#
</isNotEmpty>
<isNotEmpty prepend=" AND " property="status">
STATUS = #status#
</isNotEmpty>
<dynamic prepend="ORDER BY">
<isNotEmpty property="orderBy">
$orderBy$
</isNotEmpty>
<isEmpty property="orderBy">
ID asc
</isEmpty>
</dynamic>
</select>
<select id="count" resultClass="int">
SELECT COUNT(*) FROM hpjx.t_hppz006 WHERE 1=1
<isNotEmpty prepend=" AND " property="id">
ID = #id#
</isNotEmpty>
</select>
<!--
<isNotEmpty prepend=" AND " property="id">
ID = #id#
</isNotEmpty>
<isNotEmpty prepend=" AND " property="companyCode">
COMPANY_CODE = #companyCode#
</isNotEmpty>
<isNotEmpty prepend=" AND " property="inventName">
INVENT_NAME = #inventName#
</isNotEmpty>
<isNotEmpty prepend=" AND " property="inventCode">
INVENT_CODE = #inventCode#
</isNotEmpty>
<isNotEmpty prepend=" AND " property="inventType">
INVENT_TYPE = #inventType#
</isNotEmpty>
<isNotEmpty prepend=" AND " property="status">
STATUS = #status#
</isNotEmpty>
<isNotEmpty prepend=" AND " property="spec">
SPEC = #spec#
</isNotEmpty>
<isNotEmpty prepend=" AND " property="length">
LENGTH = #length#
</isNotEmpty>
<isNotEmpty prepend=" AND " property="wide">
WIDE = #wide#
</isNotEmpty>
<isNotEmpty prepend=" AND " property="thick">
THICK = #thick#
</isNotEmpty>
<isNotEmpty prepend=" AND " property="material">
MATERIAL = #material#
</isNotEmpty>
<isNotEmpty prepend=" AND " property="coefficient">
COEFFICIENT = #coefficient#
</isNotEmpty>
<isNotEmpty prepend=" AND " property="unit">
UNIT = #unit#
</isNotEmpty>
<isNotEmpty prepend=" AND " property="createdBy">
CREATED_BY = #createdBy#
</isNotEmpty>
<isNotEmpty prepend=" AND " property="createdTime">
CREATED_TIME = #createdTime#
</isNotEmpty>
<isNotEmpty prepend=" AND " property="updatedBy">
UPDATED_BY = #updatedBy#
</isNotEmpty>
<isNotEmpty prepend=" AND " property="updatedTime">
UPDATED_TIME = #updatedTime#
</isNotEmpty>
<isNotEmpty prepend=" AND " property="depCode">
DEP_CODE = #depCode#
</isNotEmpty>
-->
<insert id="insert">
INSERT INTO hpjx.t_hppz006 (
COMPANY_CODE, <!-- 企业编码 预留 -->
INVENT_NAME, <!-- 存货名称 -->
INVENT_CODE, <!-- 存货编码 -->
INVENT_TYPE, <!-- 存货类型 -->
STATUS, <!-- 状态 0未启用 1启用 -->
SPEC, <!-- 规格 -->
LENGTH, <!-- 长 -->
WIDE, <!-- 宽 -->
THICK, <!-- 厚 -->
MATERIAL, <!-- 材质 -->
COEFFICIENT, <!-- 系数 -->
UNIT, <!-- 单位 -->
CREATED_BY, <!-- 创建人 -->
CREATED_TIME, <!-- 创建时间 -->
DEP_CODE <!-- 部门编码 -->
)
VALUES ( #companyCode#, #inventName#, #inventCode#, #inventType#, #status#, #spec#, #length#, #wide#, #thick#, #material#, #coefficient#, #unit#, #createdBy#, #createdTime#, #depCode#)
</insert>
<delete id="delete">
DELETE FROM hpjx.t_hppz006 WHERE
ID = #id#
</delete>
<update id="update">
UPDATE hpjx.t_hppz006
SET
INVENT_NAME = #inventName#, <!-- 存货名称 -->
INVENT_CODE = #inventCode#, <!-- 存货编码 -->
INVENT_TYPE = #inventType#, <!-- 存货类型 -->
STATUS = #status#, <!-- 状态 0未启用 1启用 -->
SPEC = #spec#, <!-- 规格 -->
LENGTH = #length#, <!-- 长 -->
WIDE = #wide#, <!-- 宽 -->
THICK = #thick#, <!-- 厚 -->
MATERIAL = #material#, <!-- 材质 -->
COEFFICIENT = #coefficient#, <!-- 系数 -->
UNIT = #unit#, <!-- 单位 -->
UPDATED_BY = #updatedBy#, <!-- 更新人 -->
UPDATED_TIME = #updatedTime# <!-- 更新时间 -->
WHERE
ID = #id#
</update>
</sqlMap>
\ No newline at end of file
......@@ -132,4 +132,18 @@
ID = #id#
</update>
<select id="queryComboBox" parameterClass="java.util.HashMap"
resultClass="java.util.HashMap">
SELECT DISTINCT
WH_CODE = #whCode#,
WH_NAME = #whName#
FROM hpjx.t_hppz004 WHERE 1=1
<isNotEmpty prepend=" AND " property="companyCode">
COMPANY_CODE = #companyCode#
</isNotEmpty>
<isNotEmpty prepend=" AND " property="whType">
WH_TYPE = #whType#
</isNotEmpty>
ORDER BY WH_CODE
</select>
</sqlMap>
\ No newline at end of file
/**
* Generate time : 2024-01-10 16:44:48
* Version : 1.0
*/
package com.baosight.hpjx.hp.sc.domain;
import com.baosight.iplat4j.core.util.NumberUtils;
import java.math.BigDecimal;
import com.baosight.iplat4j.core.util.DateUtils;
import java.sql.Timestamp;
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;
/**
* THpsc002
*
*/
public class THPSC002 extends DaoEPBase {
private Long id = 0L;
private String companyCode = " "; /* 企业编码 预留*/
private String deptCode = " "; /* 部门编码 预留*/
private String projCode = " "; /* 项目编码*/
private String projName = " "; /* 项目名称*/
private String parentPrdtCode = " "; /* 父节点-产品编码*/
private String parentPrdtName = " "; /* 父节点-产品名称*/
private String type = " "; /* 类别*/
private String leaf = "1"; /* 是否有叶子节点*/
private String sort = " "; /* 排序字段*/
private String icon = " "; /* 图片地址*/
private String prdtCode = " "; /* 产品编码*/
private String prdtName = " "; /* 产品名称*/
private Integer num = Integer.valueOf(0); /* 数量*/
private BigDecimal unitWt = new BigDecimal(0.000); /* 单重*/
private BigDecimal totalWt = new BigDecimal(0.000); /* 总重*/
private String filePath1 = " "; /* 文件地址1*/
private String filePath2 = " "; /* 文件地址2*/
private String filePath3 = " "; /* 文件地址3*/
private String filePath4 = " "; /* 文件地址4*/
private String filePath5 = " "; /* 文件地址5*/
private Integer status = 0; /* 状态 0-未审核,1-已审核*/
private Integer delStatus = 0; /* 状态 1未删除,0已删除*/
private String createdBy = " "; /* 创建人*/
private String createdTime; /* 创建时间*/
private String updatedBy = " "; /* 更新人*/
private String updatedTime; /* 更新时间*/
private String remark = " "; /* 备注*/
/**
* initialize the metadata
*/
public void initMetaData() {
EiColumn eiColumn;
eiColumn = new EiColumn("id");
eiColumn.setPrimaryKey(true);
eiColumn.setDescName(" ");
eiMetadata.addMeta(eiColumn);
eiColumn = new EiColumn("companyCode");
eiColumn.setDescName("企业编码 预留");
eiMetadata.addMeta(eiColumn);
eiColumn = new EiColumn("deptCode");
eiColumn.setDescName("部门编码 预留");
eiMetadata.addMeta(eiColumn);
eiColumn = new EiColumn("projCode");
eiColumn.setDescName("项目编码");
eiMetadata.addMeta(eiColumn);
eiColumn = new EiColumn("projName");
eiColumn.setDescName("项目名称");
eiMetadata.addMeta(eiColumn);
eiColumn = new EiColumn("parentPrdtCode");
eiColumn.setDescName("父节点-产品编码");
eiMetadata.addMeta(eiColumn);
eiColumn = new EiColumn("parentPrdtName");
eiColumn.setDescName("父节点-产品名称");
eiMetadata.addMeta(eiColumn);
eiColumn = new EiColumn("type");
eiColumn.setDescName("类别");
eiMetadata.addMeta(eiColumn);
eiColumn = new EiColumn("leaf");
eiColumn.setDescName("是否有叶子节点");
eiMetadata.addMeta(eiColumn);
eiColumn = new EiColumn("sort");
eiColumn.setDescName("排序字段");
eiMetadata.addMeta(eiColumn);
eiColumn = new EiColumn("icon");
eiColumn.setDescName("图片地址");
eiMetadata.addMeta(eiColumn);
eiColumn = new EiColumn("prdtCode");
eiColumn.setDescName("产品编码");
eiMetadata.addMeta(eiColumn);
eiColumn = new EiColumn("prdtName");
eiColumn.setDescName("产品名称");
eiMetadata.addMeta(eiColumn);
eiColumn = new EiColumn("num");
eiColumn.setDescName("数量");
eiMetadata.addMeta(eiColumn);
eiColumn = new EiColumn("unitWt");
eiColumn.setType("N");
eiColumn.setScaleLength(3);
eiColumn.setFieldLength(15);
eiColumn.setDescName("单重");
eiMetadata.addMeta(eiColumn);
eiColumn = new EiColumn("totalWt");
eiColumn.setType("N");
eiColumn.setScaleLength(3);
eiColumn.setFieldLength(15);
eiColumn.setDescName("总重");
eiMetadata.addMeta(eiColumn);
eiColumn = new EiColumn("filePath1");
eiColumn.setDescName("文件地址1");
eiMetadata.addMeta(eiColumn);
eiColumn = new EiColumn("filePath2");
eiColumn.setDescName("文件地址2");
eiMetadata.addMeta(eiColumn);
eiColumn = new EiColumn("filePath3");
eiColumn.setDescName("文件地址3");
eiMetadata.addMeta(eiColumn);
eiColumn = new EiColumn("filePath4");
eiColumn.setDescName("文件地址4");
eiMetadata.addMeta(eiColumn);
eiColumn = new EiColumn("filePath5");
eiColumn.setDescName("文件地址5");
eiMetadata.addMeta(eiColumn);
eiColumn = new EiColumn("status");
eiColumn.setDescName("状态 0-未审核,1-已审核");
eiMetadata.addMeta(eiColumn);
eiColumn = new EiColumn("delStatus");
eiColumn.setDescName("状态 1未删除,0已删除");
eiMetadata.addMeta(eiColumn);
eiColumn = new EiColumn("createdBy");
eiColumn.setDescName("创建人");
eiMetadata.addMeta(eiColumn);
eiColumn = new EiColumn("createdTime");
eiColumn.setDescName("创建时间");
eiMetadata.addMeta(eiColumn);
eiColumn = new EiColumn("updatedBy");
eiColumn.setDescName("更新人");
eiMetadata.addMeta(eiColumn);
eiColumn = new EiColumn("updatedTime");
eiColumn.setDescName("更新时间");
eiMetadata.addMeta(eiColumn);
eiColumn = new EiColumn("remark");
eiColumn.setDescName("备注");
eiMetadata.addMeta(eiColumn);
}
/**
* the constructor
*/
public THPSC002() {
initMetaData();
}
/**
* get the id
* @return the id
*/
public Long getId() {
return this.id;
}
/**
* set the id
*/
public void setId(Long id) {
this.id = id;
}
/**
* get the companyCode - 企业编码 预留
* @return the companyCode
*/
public String getCompanyCode() {
return this.companyCode;
}
/**
* set the companyCode - 企业编码 预留
*/
public void setCompanyCode(String companyCode) {
this.companyCode = companyCode;
}
/**
* get the deptCode - 部门编码 预留
* @return the deptCode
*/
public String getDeptCode() {
return this.deptCode;
}
/**
* set the deptCode - 部门编码 预留
*/
public void setDeptCode(String deptCode) {
this.deptCode = deptCode;
}
/**
* get the projCode - 项目编码
* @return the projCode
*/
public String getProjCode() {
return this.projCode;
}
/**
* set the projCode - 项目编码
*/
public void setProjCode(String projCode) {
this.projCode = projCode;
}
/**
* get the projName - 项目名称
* @return the projName
*/
public String getProjName() {
return this.projName;
}
/**
* set the projName - 项目名称
*/
public void setProjName(String projName) {
this.projName = projName;
}
/**
* get the parentPrdtCode - 父节点-产品编码
* @return the parentPrdtCode
*/
public String getParentPrdtCode() {
return this.parentPrdtCode;
}
/**
* set the parentPrdtCode - 父节点-产品编码
*/
public void setParentPrdtCode(String parentPrdtCode) {
this.parentPrdtCode = parentPrdtCode;
}
/**
* get the parentPrdtName - 父节点-产品名称
* @return the parentPrdtName
*/
public String getParentPrdtName() {
return this.parentPrdtName;
}
/**
* set the parentPrdtName - 父节点-产品名称
*/
public void setParentPrdtName(String parentPrdtName) {
this.parentPrdtName = parentPrdtName;
}
/**
* get the type - 类别
* @return the type
*/
public String getType() {
return this.type;
}
/**
* set the type - 类别
*/
public void setType(String type) {
this.type = type;
}
/**
* get the leaf - 是否有叶子节点
* @return the leaf
*/
public String getLeaf() {
return this.leaf;
}
/**
* set the leaf - 是否有叶子节点
*/
public void setLeaf(String leaf) {
this.leaf = leaf;
}
/**
* get the sort - 排序字段
* @return the sort
*/
public String getSort() {
return this.sort;
}
/**
* set the sort - 排序字段
*/
public void setSort(String sort) {
this.sort = sort;
}
/**
* get the icon - 图片地址
* @return the icon
*/
public String getIcon() {
return this.icon;
}
/**
* set the icon - 图片地址
*/
public void setIcon(String icon) {
this.icon = icon;
}
/**
* get the prdtCode - 产品编码
* @return the prdtCode
*/
public String getPrdtCode() {
return this.prdtCode;
}
/**
* set the prdtCode - 产品编码
*/
public void setPrdtCode(String prdtCode) {
this.prdtCode = prdtCode;
}
/**
* get the prdtName - 产品名称
* @return the prdtName
*/
public String getPrdtName() {
return this.prdtName;
}
/**
* set the prdtName - 产品名称
*/
public void setPrdtName(String prdtName) {
this.prdtName = prdtName;
}
/**
* get the num - 数量
* @return the num
*/
public Integer getNum() {
return this.num;
}
/**
* set the num - 数量
*/
public void setNum(Integer num) {
this.num = num;
}
/**
* get the unitWt - 单重
* @return the unitWt
*/
public BigDecimal getUnitWt() {
return this.unitWt;
}
/**
* set the unitWt - 单重
*/
public void setUnitWt(BigDecimal unitWt) {
this.unitWt = unitWt;
}
/**
* get the totalWt - 总重
* @return the totalWt
*/
public BigDecimal getTotalWt() {
return this.totalWt;
}
/**
* set the totalWt - 总重
*/
public void setTotalWt(BigDecimal totalWt) {
this.totalWt = totalWt;
}
/**
* get the filePath1 - 文件地址1
* @return the filePath1
*/
public String getFilePath1() {
return this.filePath1;
}
/**
* set the filePath1 - 文件地址1
*/
public void setFilePath1(String filePath1) {
this.filePath1 = filePath1;
}
/**
* get the filePath2 - 文件地址2
* @return the filePath2
*/
public String getFilePath2() {
return this.filePath2;
}
/**
* set the filePath2 - 文件地址2
*/
public void setFilePath2(String filePath2) {
this.filePath2 = filePath2;
}
/**
* get the filePath3 - 文件地址3
* @return the filePath3
*/
public String getFilePath3() {
return this.filePath3;
}
/**
* set the filePath3 - 文件地址3
*/
public void setFilePath3(String filePath3) {
this.filePath3 = filePath3;
}
/**
* get the filePath4 - 文件地址4
* @return the filePath4
*/
public String getFilePath4() {
return this.filePath4;
}
/**
* set the filePath4 - 文件地址4
*/
public void setFilePath4(String filePath4) {
this.filePath4 = filePath4;
}
/**
* get the filePath5 - 文件地址5
* @return the filePath5
*/
public String getFilePath5() {
return this.filePath5;
}
/**
* set the filePath5 - 文件地址5
*/
public void setFilePath5(String filePath5) {
this.filePath5 = filePath5;
}
/**
* get the status - 状态 0-未审核,1-已审核
* @return the status
*/
public Integer getStatus() {
return this.status;
}
/**
* set the status - 状态 0-未审核,1-已审核
*/
public void setStatus(Integer status) {
this.status = status;
}
/**
* get the delStatus - 状态 1未删除,0已删除
* @return the delStatus
*/
public Integer getDelStatus() {
return this.delStatus;
}
/**
* set the delStatus - 状态 1未删除,0已删除
*/
public void setDelStatus(Integer delStatus) {
this.delStatus = delStatus;
}
/**
* get the createdBy - 创建人
* @return the createdBy
*/
public String getCreatedBy() {
return this.createdBy;
}
/**
* set the createdBy - 创建人
*/
public void setCreatedBy(String createdBy) {
this.createdBy = createdBy;
}
/**
* get the createdTime - 创建时间
* @return the createdTime
*/
public String getCreatedTime() {
return this.createdTime;
}
/**
* set the createdTime - 创建时间
*/
public void setCreatedTime(String createdTime) {
this.createdTime = createdTime;
}
/**
* get the updatedBy - 更新人
* @return the updatedBy
*/
public String getUpdatedBy() {
return this.updatedBy;
}
/**
* set the updatedBy - 更新人
*/
public void setUpdatedBy(String updatedBy) {
this.updatedBy = updatedBy;
}
/**
* get the updatedTime - 更新时间
* @return the updatedTime
*/
public String getUpdatedTime() {
return this.updatedTime;
}
/**
* set the updatedTime - 更新时间
*/
public void setUpdatedTime(String updatedTime) {
this.updatedTime = updatedTime;
}
/**
* get the remark - 备注
* @return the remark
*/
public String getRemark() {
return this.remark;
}
/**
* set the remark - 备注
*/
public void setRemark(String remark) {
this.remark = remark;
}
/**
* get the value from Map
*/
public void fromMap(Map map) {
setId(NumberUtils.toLong(StringUtils.toString(map.get("id")), id));
setCompanyCode(StringUtils.defaultIfEmpty(StringUtils.toString(map.get("companyCode")), companyCode));
setDeptCode(StringUtils.defaultIfEmpty(StringUtils.toString(map.get("deptCode")), deptCode));
setProjCode(StringUtils.defaultIfEmpty(StringUtils.toString(map.get("projCode")), projCode));
setProjName(StringUtils.defaultIfEmpty(StringUtils.toString(map.get("projName")), projName));
setParentPrdtCode(StringUtils.defaultIfEmpty(StringUtils.toString(map.get("parentPrdtCode")), parentPrdtCode));
setParentPrdtName(StringUtils.defaultIfEmpty(StringUtils.toString(map.get("parentPrdtName")), parentPrdtName));
setType(StringUtils.defaultIfEmpty(StringUtils.toString(map.get("type")), type));
setLeaf(StringUtils.defaultIfEmpty(StringUtils.toString(map.get("leaf")), leaf));
setSort(StringUtils.defaultIfEmpty(StringUtils.toString(map.get("sort")), sort));
setIcon(StringUtils.defaultIfEmpty(StringUtils.toString(map.get("icon")), icon));
setPrdtCode(StringUtils.defaultIfEmpty(StringUtils.toString(map.get("prdtCode")), prdtCode));
setPrdtName(StringUtils.defaultIfEmpty(StringUtils.toString(map.get("prdtName")), prdtName));
setNum(NumberUtils.toInteger(StringUtils.toString(map.get("num")), num));
setUnitWt(NumberUtils.toBigDecimal(StringUtils.toString(map.get("unitWt")), unitWt));
setTotalWt(NumberUtils.toBigDecimal(StringUtils.toString(map.get("totalWt")), totalWt));
setFilePath1(StringUtils.defaultIfEmpty(StringUtils.toString(map.get("filePath1")), filePath1));
setFilePath2(StringUtils.defaultIfEmpty(StringUtils.toString(map.get("filePath2")), filePath2));
setFilePath3(StringUtils.defaultIfEmpty(StringUtils.toString(map.get("filePath3")), filePath3));
setFilePath4(StringUtils.defaultIfEmpty(StringUtils.toString(map.get("filePath4")), filePath4));
setFilePath5(StringUtils.defaultIfEmpty(StringUtils.toString(map.get("filePath5")), filePath5));
setStatus(NumberUtils.toInteger(StringUtils.toString(map.get("status")), status));
setDelStatus(NumberUtils.toInteger(StringUtils.toString(map.get("delStatus")), delStatus));
setCreatedBy(StringUtils.defaultIfEmpty(StringUtils.toString(map.get("createdBy")), createdBy));
setCreatedTime(StringUtils.defaultIfEmpty(StringUtils.toString(map.get("createdTime")),createdTime));
setUpdatedBy(StringUtils.defaultIfEmpty(StringUtils.toString(map.get("updatedBy")), updatedBy));
setUpdatedTime(StringUtils.defaultIfEmpty(StringUtils.toString(map.get("updatedTime")),updatedTime));
setRemark(StringUtils.defaultIfEmpty(StringUtils.toString(map.get("remark")), remark));
}
/**
* set the value to Map
*/
public Map toMap() {
Map map = new HashMap();
map.put("id", StringUtils.toString(id, eiMetadata.getMeta("id")));
map.put("companyCode", StringUtils.toString(companyCode, eiMetadata.getMeta("companyCode")));
map.put("deptCode", StringUtils.toString(deptCode, eiMetadata.getMeta("deptCode")));
map.put("projCode", StringUtils.toString(projCode, eiMetadata.getMeta("projCode")));
map.put("projName", StringUtils.toString(projName, eiMetadata.getMeta("projName")));
map.put("parentPrdtCode", StringUtils.toString(parentPrdtCode, eiMetadata.getMeta("parentPrdtCode")));
map.put("parentPrdtName", StringUtils.toString(parentPrdtName, eiMetadata.getMeta("parentPrdtName")));
map.put("type", StringUtils.toString(type, eiMetadata.getMeta("type")));
map.put("leaf", StringUtils.toString(leaf, eiMetadata.getMeta("leaf")));
map.put("sort", StringUtils.toString(sort, eiMetadata.getMeta("sort")));
map.put("icon", StringUtils.toString(icon, eiMetadata.getMeta("icon")));
map.put("prdtCode", StringUtils.toString(prdtCode, eiMetadata.getMeta("prdtCode")));
map.put("prdtName", StringUtils.toString(prdtName, eiMetadata.getMeta("prdtName")));
map.put("num", StringUtils.toString(num, eiMetadata.getMeta("num")));
map.put("unitWt", StringUtils.toString(unitWt, eiMetadata.getMeta("unitWt")));
map.put("totalWt", StringUtils.toString(totalWt, eiMetadata.getMeta("totalWt")));
map.put("filePath1", StringUtils.toString(filePath1, eiMetadata.getMeta("filePath1")));
map.put("filePath2", StringUtils.toString(filePath2, eiMetadata.getMeta("filePath2")));
map.put("filePath3", StringUtils.toString(filePath3, eiMetadata.getMeta("filePath3")));
map.put("filePath4", StringUtils.toString(filePath4, eiMetadata.getMeta("filePath4")));
map.put("filePath5", StringUtils.toString(filePath5, eiMetadata.getMeta("filePath5")));
map.put("status", StringUtils.toString(status, eiMetadata.getMeta("status")));
map.put("delStatus", StringUtils.toString(delStatus, eiMetadata.getMeta("delStatus")));
map.put("createdBy", StringUtils.toString(createdBy, eiMetadata.getMeta("createdBy")));
map.put("createdTime", StringUtils.toString(createdTime, eiMetadata.getMeta("createdTime")));
map.put("updatedBy", StringUtils.toString(updatedBy, eiMetadata.getMeta("updatedBy")));
map.put("updatedTime", StringUtils.toString(updatedTime, eiMetadata.getMeta("updatedTime")));
map.put("remark", StringUtils.toString(remark, eiMetadata.getMeta("remark")));
return map;
}
}
\ No newline at end of file
package com.baosight.hpjx.hp.sc.service;
import com.baosight.hpjx.hp.sc.domain.THPSC002;
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.service.impl.ServiceBase;
import com.baosight.iplat4j.core.web.threadlocal.UserSession;
import java.math.BigDecimal;
import java.text.DecimalFormat;
import java.text.SimpleDateFormat;
import java.util.*;
/**
*
*/
public class ServiceHPSC002 extends ServiceBase {
/**
* 画面初始化.
*/
public EiInfo initLoad(EiInfo inInfo) {
THPSC002 hppz002 = new THPSC002();
EiInfo outInfo = super.initLoad(inInfo, hppz002);
outInfo.addBlock(EiConstant.resultBlock).addBlockMeta(hppz002.eiMetadata);
return inInfo;
}
/**
* 查询操作.
*/
@Override
public EiInfo query(EiInfo inInfo) {
/* 调用EI查询方法.*/
EiInfo outInfo = super.query(inInfo, "HPSC002.query", new THPSC002());
return outInfo;
}
/**
* 新增操作.
*/
@Override
public EiInfo insert(EiInfo inInfo) {
SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss");
try {
THPSC002 hppz002 = new THPSC002();
EiBlock eiBlock = inInfo.getBlock(EiConstant.resultBlock);
for (int i = 0; i < eiBlock.getRowCount(); i++) {
Map<?, ?> map = eiBlock.getRow(i);
hppz002.fromMap(map);
hppz002.setLeaf("1");
// 计算总重
BigDecimal num = new BigDecimal(hppz002.getNum());
BigDecimal unitWt = hppz002.getUnitWt();
DecimalFormat decimalFormat = new DecimalFormat("#.000");
BigDecimal totalWt = new BigDecimal(decimalFormat.format(Math.round(num.multiply(unitWt).floatValue())));
hppz002.setTotalWt(totalWt);
hppz002.setCreatedBy(UserSession.getUserId());
hppz002.setCreatedTime(sdf.format(new Date()));
hppz002.setUpdatedBy(null);
hppz002.setUpdatedTime(null);
this.dao.insert("HPSC002.insert", hppz002.toMap());
if(!hppz002.getParentPrdtCode().equals("root")){
this.checkTreeNodeLeaf(new Long(hppz002.getParentPrdtCode()));
}
}
inInfo.setStatus(EiConstant.STATUS_SUCCESS);
inInfo.setMsg("新增成功!");
} catch (PlatException e) {
e.printStackTrace();
inInfo.setStatus(EiConstant.STATUS_FAILURE);
inInfo.setMsg("新增失败!原因参见详细错误描述!");
inInfo.setDetailMsg(e.getMessage());
logError("新增失败", e.getMessage());
return inInfo;
}
return query(inInfo);
}
/**
* 修改操作.
*/
public EiInfo update(EiInfo inInfo) {
SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss");
try {
THPSC002 hppz002 = new THPSC002();
EiBlock eiBlock = inInfo.getBlock(EiConstant.resultBlock);
for (int i = 0; i < eiBlock.getRowCount(); i++) {
Map<?, ?> map = eiBlock.getRow(i);
hppz002.fromMap(map);
hppz002.setUpdatedBy(UserSession.getUserId());
hppz002.setUpdatedTime(sdf.format(new Date()));
this.dao.update("HPSC001.update", hppz002.toMap());
}
inInfo.setStatus(EiConstant.STATUS_SUCCESS);
inInfo.setMsg("修改成功!");
} catch (PlatException e) {
inInfo.setStatus(EiConstant.STATUS_FAILURE);
inInfo.setMsg("操作失败!原因参见详细错误描述!");
inInfo.setDetailMsg(e.getMessage());
logError("修改失败", e.getMessage());
return inInfo;
}
return query(inInfo);
}
/**
* 删除操作.
*/
public EiInfo delete(EiInfo eiInfo) {
THPSC002 hppz002 = new THPSC002();
EiBlock eiBlock = eiInfo.getBlock(EiConstant.resultBlock);
try {
for (int i = 0; i < eiBlock.getRowCount(); i++) {
Map<?, ?> map = eiBlock.getRow(i);
hppz002.fromMap(map);
this.dao.delete("HPSC002.delete", hppz002.toMap());
}
} catch (PlatException e) {
eiInfo.setStatus(EiConstant.STATUS_FAILURE);
eiInfo.setMsg("删除失败,原因参见详细错误描述!");
eiInfo.setDetailMsg(e.getMessage());
logError("删除失败!", e.getMessage());
return eiInfo;
}
eiInfo.setStatus(EiConstant.STATUS_SUCCESS);
eiInfo.setMsg("删除成功!");
return eiInfo;
}
//树查询服务
public EiInfo queryTreeNode(EiInfo inInfo) {
//1 获取参数
String pEname = inInfo.getCellStr(EiConstant.queryBlock, 0, "node");
Map queryMap = new HashMap();
queryMap.put("pEname",pEname);
//2 查询节点
List rows = dao.query("HPSC002.queryTree", queryMap);
//3 增加节点block块
EiInfo outInfo = new EiInfo();
EiBlock outBlock = outInfo.addBlock(pEname);
outBlock.addRows(rows);
return outInfo;
}
/**
* 修改父级节点的LEAF状态为1
* @param id
*/
public void checkTreeNodeLeaf(Long id) {
//1 获取参数
Map queryMap = new HashMap();
queryMap.put("id", id);
queryMap.put("leaf", "0");
//2 查询节点
this.dao.update("HPSC002.updateTreeNodeLeaf", queryMap);
}
}
......@@ -149,4 +149,19 @@
ID = #id#
</update>
<select id="queryComboBox" parameterClass="java.util.HashMap"
resultClass="java.util.HashMap">
SELECT DISTINCT
PROJ_CODE = #projCode#,
PROJ_NAME = #projName#
FROM hpjx.t_hpsc001 WHERE 1=1
<isNotEmpty prepend=" AND " property="companyCode">
COMPANY_CODE = #companyCode#
</isNotEmpty>
<isNotEmpty prepend=" AND " property="projType">
PROJ_TYPE = #projType#
</isNotEmpty>
ORDER BY PROJ_CODE
</select>
</sqlMap>
\ No newline at end of file
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE sqlMap PUBLIC "-//iBATIS.com//DTD SQL Map 2.0//EN" "http://www.ibatis.com/dtd/sql-map-2.dtd">
<!-- table information
Generate time : 2024-01-11 11:34:26
Version : 1.0
tableName :hpjx.t_hpsc002
ID BIGINT NOT NULL primarykey,
COMPANY_CODE VARCHAR NOT NULL,
DEPT_CODE VARCHAR NOT NULL,
PROJ_CODE VARCHAR,
PROJ_NAME VARCHAR,
PARENT_PRDT_CODE VARCHAR,
PARENT_PRDT_NAME VARCHAR,
TYPE VARCHAR NOT NULL,
LEAF VARCHAR NOT NULL,
SORT VARCHAR NOT NULL,
ICON VARCHAR NOT NULL,
PRDT_CODE VARCHAR,
PRDT_NAME VARCHAR,
NUM INTEGER NOT NULL,
UNIT_WT DECIMAL NOT NULL,
TOTAL_WT DECIMAL NOT NULL,
FILE_PATH1 VARCHAR,
FILE_PATH2 VARCHAR,
FILE_PATH3 VARCHAR,
FILE_PATH4 VARCHAR,
FILE_PATH5 VARCHAR,
STATUS TINYINT,
DEL_STATUS TINYINT,
CREATED_BY VARCHAR,
CREATED_TIME DATETIME,
UPDATED_BY VARCHAR,
UPDATED_TIME DATETIME,
REMARK VARCHAR
-->
<sqlMap namespace="HPSC002">
<select id="query" parameterClass="java.util.HashMap"
resultClass="com.baosight.hpjx.hp.sc.domain.THPSC002">
SELECT
ID as "id",
COMPANY_CODE as "companyCode", <!-- 企业编码 预留 -->
DEPT_CODE as "deptCode", <!-- 部门编码 预留 -->
PROJ_CODE as "projCode", <!-- 项目编码 -->
PROJ_NAME as "projName", <!-- 项目名称 -->
PARENT_PRDT_CODE as "parentPrdtCode", <!-- 父节点-产品编码 -->
PARENT_PRDT_NAME as "parentPrdtName", <!-- 父节点-产品名称 -->
TYPE as "type", <!-- 类别 -->
LEAF as "leaf", <!-- 是否有叶子节点 -->
SORT as "sort", <!-- 排序字段 -->
ICON as "icon", <!-- 图片地址 -->
PRDT_CODE as "prdtCode", <!-- 产品编码 -->
PRDT_NAME as "prdtName", <!-- 产品名称 -->
NUM as "num", <!-- 数量 -->
UNIT_WT as "unitWt", <!-- 单重 -->
TOTAL_WT as "totalWt", <!-- 总重 -->
FILE_PATH1 as "filePath1", <!-- 文件地址1 -->
FILE_PATH2 as "filePath2", <!-- 文件地址2 -->
FILE_PATH3 as "filePath3", <!-- 文件地址3 -->
FILE_PATH4 as "filePath4", <!-- 文件地址4 -->
FILE_PATH5 as "filePath5", <!-- 文件地址5 -->
STATUS as "status", <!-- 状态 0-未审核,1-已审核 -->
DEL_STATUS as "delStatus", <!-- 状态 1未删除,0已删除 -->
CREATED_BY as "createdBy", <!-- 创建人 -->
CREATED_TIME as "createdTime", <!-- 创建时间 -->
UPDATED_BY as "updatedBy", <!-- 更新人 -->
UPDATED_TIME as "updatedTime", <!-- 更新时间 -->
REMARK as "remark" <!-- 备注 -->
FROM hpjx.t_hpsc002 WHERE 1=1
AND PARENT_PRDT_CODE NOT IN ('root')
<isNotEmpty prepend=" AND " property="id">
ID = #id#
</isNotEmpty>
<dynamic prepend="ORDER BY">
<isEmpty property="orderBy">
CREATED_TIME DESC
</isEmpty>
</dynamic>
</select>
<select id="count" resultClass="int">
SELECT COUNT(*) FROM hpjx.t_hpsc002 WHERE 1=1
<isNotEmpty prepend=" AND " property="id">
ID = #id#
</isNotEmpty>
</select>
<!--
<isNotEmpty prepend=" AND " property="id">
ID = #id#
</isNotEmpty>
<isNotEmpty prepend=" AND " property="companyCode">
COMPANY_CODE = #companyCode#
</isNotEmpty>
<isNotEmpty prepend=" AND " property="deptCode">
DEPT_CODE = #deptCode#
</isNotEmpty>
<isNotEmpty prepend=" AND " property="projCode">
PROJ_CODE = #projCode#
</isNotEmpty>
<isNotEmpty prepend=" AND " property="projName">
PROJ_NAME = #projName#
</isNotEmpty>
<isNotEmpty prepend=" AND " property="parentPrdtCode">
PARENT_PRDT_CODE = #parentPrdtCode#
</isNotEmpty>
<isNotEmpty prepend=" AND " property="parentPrdtName">
PARENT_PRDT_NAME = #parentPrdtName#
</isNotEmpty>
<isNotEmpty prepend=" AND " property="type">
TYPE = #type#
</isNotEmpty>
<isNotEmpty prepend=" AND " property="leaf">
LEAF = #leaf#
</isNotEmpty>
<isNotEmpty prepend=" AND " property="sort">
SORT = #sort#
</isNotEmpty>
<isNotEmpty prepend=" AND " property="icon">
ICON = #icon#
</isNotEmpty>
<isNotEmpty prepend=" AND " property="prdtCode">
PRDT_CODE = #prdtCode#
</isNotEmpty>
<isNotEmpty prepend=" AND " property="prdtName">
PRDT_NAME = #prdtName#
</isNotEmpty>
<isNotEmpty prepend=" AND " property="num">
NUM = #num#
</isNotEmpty>
<isNotEmpty prepend=" AND " property="unitWt">
UNIT_WT = #unitWt#
</isNotEmpty>
<isNotEmpty prepend=" AND " property="totalWt">
TOTAL_WT = #totalWt#
</isNotEmpty>
<isNotEmpty prepend=" AND " property="filePath1">
FILE_PATH1 = #filePath1#
</isNotEmpty>
<isNotEmpty prepend=" AND " property="filePath2">
FILE_PATH2 = #filePath2#
</isNotEmpty>
<isNotEmpty prepend=" AND " property="filePath3">
FILE_PATH3 = #filePath3#
</isNotEmpty>
<isNotEmpty prepend=" AND " property="filePath4">
FILE_PATH4 = #filePath4#
</isNotEmpty>
<isNotEmpty prepend=" AND " property="filePath5">
FILE_PATH5 = #filePath5#
</isNotEmpty>
<isNotEmpty prepend=" AND " property="status">
STATUS = #status#
</isNotEmpty>
<isNotEmpty prepend=" AND " property="delStatus">
DEL_STATUS = #delStatus#
</isNotEmpty>
<isNotEmpty prepend=" AND " property="createdBy">
CREATED_BY = #createdBy#
</isNotEmpty>
<isNotEmpty prepend=" AND " property="createdTime">
CREATED_TIME = #createdTime#
</isNotEmpty>
<isNotEmpty prepend=" AND " property="updatedBy">
UPDATED_BY = #updatedBy#
</isNotEmpty>
<isNotEmpty prepend=" AND " property="updatedTime">
UPDATED_TIME = #updatedTime#
</isNotEmpty>
<isNotEmpty prepend=" AND " property="remark">
REMARK = #remark#
</isNotEmpty>
-->
<insert id="insert">
INSERT INTO hpjx.t_hpsc002 (ID,
COMPANY_CODE, <!-- 企业编码 预留 -->
DEPT_CODE, <!-- 部门编码 预留 -->
PROJ_CODE, <!-- 项目编码 -->
PROJ_NAME, <!-- 项目名称 -->
PARENT_PRDT_CODE, <!-- 父节点-产品编码 -->
PARENT_PRDT_NAME, <!-- 父节点-产品名称 -->
TYPE, <!-- 类别 -->
LEAF, <!-- 是否有叶子节点 -->
SORT, <!-- 排序字段 -->
ICON, <!-- 图片地址 -->
PRDT_CODE, <!-- 产品编码 -->
PRDT_NAME, <!-- 产品名称 -->
NUM, <!-- 数量 -->
UNIT_WT, <!-- 单重 -->
TOTAL_WT, <!-- 总重 -->
FILE_PATH1, <!-- 文件地址1 -->
FILE_PATH2, <!-- 文件地址2 -->
FILE_PATH3, <!-- 文件地址3 -->
FILE_PATH4, <!-- 文件地址4 -->
FILE_PATH5, <!-- 文件地址5 -->
STATUS, <!-- 状态 0-未审核,1-已审核 -->
DEL_STATUS, <!-- 状态 1未删除,0已删除 -->
CREATED_BY, <!-- 创建人 -->
CREATED_TIME, <!-- 创建时间 -->
UPDATED_BY, <!-- 更新人 -->
UPDATED_TIME, <!-- 更新时间 -->
REMARK <!-- 备注 -->
)
VALUES (#id#, #companyCode#, #deptCode#, #projCode#, #projName#, #parentPrdtCode#, #parentPrdtName#, #type#, #leaf#, #sort#, #icon#, #prdtCode#, #prdtName#, #num#, #unitWt#, #totalWt#, #filePath1#, #filePath2#, #filePath3#, #filePath4#, #filePath5#, #status#, #delStatus#, #createdBy#, #createdTime#, #updatedBy#, #updatedTime#, #remark#)
</insert>
<delete id="delete">
DELETE FROM hpjx.t_hpsc002 WHERE
ID = #id#
</delete>
<update id="update">
UPDATE hpjx.t_hpsc002
SET
COMPANY_CODE = #companyCode#, <!-- 企业编码 预留 -->
DEPT_CODE = #deptCode#, <!-- 部门编码 预留 -->
PROJ_CODE = #projCode#, <!-- 项目编码 -->
PROJ_NAME = #projName#, <!-- 项目名称 -->
PARENT_PRDT_CODE = #parentPrdtCode#, <!-- 父节点-产品编码 -->
PARENT_PRDT_NAME = #parentPrdtName#, <!-- 父节点-产品名称 -->
TYPE = #type#, <!-- 类别 -->
LEAF = #leaf#, <!-- 是否有叶子节点 -->
SORT = #sort#, <!-- 排序字段 -->
ICON = #icon#, <!-- 图片地址 -->
PRDT_CODE = #prdtCode#, <!-- 产品编码 -->
PRDT_NAME = #prdtName#, <!-- 产品名称 -->
NUM = #num#, <!-- 数量 -->
UNIT_WT = #unitWt#, <!-- 单重 -->
TOTAL_WT = #totalWt#, <!-- 总重 -->
FILE_PATH1 = #filePath1#, <!-- 文件地址1 -->
FILE_PATH2 = #filePath2#, <!-- 文件地址2 -->
FILE_PATH3 = #filePath3#, <!-- 文件地址3 -->
FILE_PATH4 = #filePath4#, <!-- 文件地址4 -->
FILE_PATH5 = #filePath5#, <!-- 文件地址5 -->
STATUS = #status#, <!-- 状态 0-未审核,1-已审核 -->
DEL_STATUS = #delStatus#, <!-- 状态 1未删除,0已删除 -->
CREATED_BY = #createdBy#, <!-- 创建人 -->
CREATED_TIME = #createdTime#, <!-- 创建时间 -->
UPDATED_BY = #updatedBy#, <!-- 更新人 -->
UPDATED_TIME = #updatedTime#, <!-- 更新时间 -->
REMARK = #remark# <!-- 备注 -->
WHERE
ID = #id#
</update>
<select id="queryTree" resultClass="java.util.HashMap">
SELECT
ID as "nodeId",
PROJ_CODE as "projCode", <!-- 项目编码 -->
PROJ_NAME as projName,<!-- 项目名称 -->
ID as "label", <!-- 名产品编码-->
PRDT_NAME as "text", <!-- 产品名称 -->
PARENT_PRDT_CODE as "pId", <!-- 父节点编码 -->
TYPE as "type", <!-- 类别 -->
LEAF as "leaf", <!-- 是否有叶子节点 -->
SORT as "sort", <!-- 排序字段 -->
ICON as "icon" <!-- 图片地址 -->
FROM
hpjx.t_hpsc002
WHERE
1=1
<isNotEmpty prepend=" AND " property="pEname">
PARENT_PRDT_CODE = #pEname#
</isNotEmpty>
ORDER BY CREATED_TIME DESC
</select>
<update id="updateTreeNodeLeaf">
UPDATE hpjx.t_hpsc002 SET LEAF = #leaf# WHERE ID = #id#
</update>
</sqlMap>
\ No newline at end of file
/**
* Generate time : 2024-01-10 14:47:08
* Version : 1.0
*/
package com.baosight.hpjx.hp.zl.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;
/**
* THpzl001
*
*/
public class HPZL001 extends DaoEPBase {
private Long id = 0L;
private String companyCode = " "; /* 企业编码 预留*/
private String receiptDate = " "; /* 单据日期*/
private String chkBillno = " "; /* 检查单号*/
private String itemCode = " "; /* 项目号*/
private String itemName = " "; /* 项目名称*/
private String unit = " "; /* 生产组*/
private String notes = " "; /* 质量问题描述*/
private String princ = " "; /* 检查人*/
private int status; /* 单据状态 0待审核 1已审核*/
private String affix = " "; /* 附件*/
private String createdBy = " "; /* 创建人*/
private String createdTime = " "; /* 创建时间*/
private String updatedBy = " "; /* 更新人*/
private String updatedTime = " "; /* 更新时间*/
private String depCode = " "; /* 部门编码*/
/**
* initialize the metadata
*/
public void initMetaData() {
EiColumn eiColumn;
eiColumn = new EiColumn("id");
eiColumn.setPrimaryKey(true);
eiColumn.setDescName(" ");
eiMetadata.addMeta(eiColumn);
eiColumn = new EiColumn("companyCode");
eiColumn.setDescName("企业编码 预留");
eiMetadata.addMeta(eiColumn);
eiColumn = new EiColumn("receiptDate");
eiColumn.setDescName("单据日期");
eiMetadata.addMeta(eiColumn);
eiColumn = new EiColumn("chkBillno");
eiColumn.setDescName("检查单号");
eiMetadata.addMeta(eiColumn);
eiColumn = new EiColumn("itemCode");
eiColumn.setDescName("项目号");
eiMetadata.addMeta(eiColumn);
eiColumn = new EiColumn("itemName");
eiColumn.setDescName("项目名称");
eiMetadata.addMeta(eiColumn);
eiColumn = new EiColumn("unit");
eiColumn.setDescName("生产组");
eiMetadata.addMeta(eiColumn);
eiColumn = new EiColumn("notes");
eiColumn.setDescName("质量问题描述");
eiMetadata.addMeta(eiColumn);
eiColumn = new EiColumn("princ");
eiColumn.setDescName("检查人");
eiMetadata.addMeta(eiColumn);
eiColumn = new EiColumn("status");
eiColumn.setDescName("单据状态 0待审核 1已审核");
eiMetadata.addMeta(eiColumn);
eiColumn = new EiColumn("affix");
eiColumn.setDescName("附件");
eiMetadata.addMeta(eiColumn);
eiColumn = new EiColumn("createdBy");
eiColumn.setDescName("创建人");
eiMetadata.addMeta(eiColumn);
eiColumn = new EiColumn("createdTime");
eiColumn.setDescName("创建时间");
eiMetadata.addMeta(eiColumn);
eiColumn = new EiColumn("updatedBy");
eiColumn.setDescName("更新人");
eiMetadata.addMeta(eiColumn);
eiColumn = new EiColumn("updatedTime");
eiColumn.setDescName("更新时间");
eiMetadata.addMeta(eiColumn);
eiColumn = new EiColumn("depCode");
eiColumn.setDescName("部门编码");
eiMetadata.addMeta(eiColumn);
}
/**
* the constructor
*/
public HPZL001() {
initMetaData();
}
/**
* get the id
* @return the id
*/
public Long getId() {
return this.id;
}
/**
* set the id
*/
public void setId(Long id) {
this.id = id;
}
/**
* get the companyCode - 企业编码 预留
* @return the companyCode
*/
public String getCompanyCode() {
return this.companyCode;
}
/**
* set the companyCode - 企业编码 预留
*/
public void setCompanyCode(String companyCode) {
this.companyCode = companyCode;
}
/**
* get the receiptDate - 单据日期
* @return the receiptDate
*/
public String getReceiptDate() {
return this.receiptDate;
}
/**
* set the receiptDate - 单据日期
*/
public void setReceiptDate(String receiptDate) {
this.receiptDate = receiptDate;
}
/**
* get the chkBillno - 检查单号
* @return the chkBillno
*/
public String getChkBillno() {
return this.chkBillno;
}
/**
* set the chkBillno - 检查单号
*/
public void setChkBillno(String chkBillno) {
this.chkBillno = chkBillno;
}
/**
* get the itemCode - 项目号
* @return the itemCode
*/
public String getItemCode() {
return this.itemCode;
}
/**
* set the itemCode - 项目号
*/
public void setItemCode(String itemCode) {
this.itemCode = itemCode;
}
/**
* get the itemName - 项目名称
* @return the itemName
*/
public String getItemName() {
return this.itemName;
}
/**
* set the itemName - 项目名称
*/
public void setItemName(String itemName) {
this.itemName = itemName;
}
/**
* get the unit - 生产组
* @return the unit
*/
public String getUnit() {
return this.unit;
}
/**
* set the unit - 生产组
*/
public void setUnit(String unit) {
this.unit = unit;
}
/**
* get the notes - 质量问题描述
* @return the notes
*/
public String getnotes() {
return this.notes;
}
/**
* set the notes - 质量问题描述
*/
public void setnotes(String notes) {
this.notes = notes;
}
/**
* get the princ - 检查人
* @return the princ
*/
public String getPrinc() {
return this.princ;
}
/**
* set the princ - 检查人
*/
public void setPrinc(String princ) {
this.princ = princ;
}
/**
* get the status - 单据状态 0待审核 1已审核
* @return the status
*/
public int getStatus() {
return this.status;
}
/**
* set the status - 单据状态 0待审核 1已审核
*/
public void setStatus(int status) {
this.status = status;
}
/**
* get the affix - 附件
* @return the affix
*/
public String getAffix() {
return this.affix;
}
/**
* set the affix - 附件
*/
public void setAffix(String affix) {
this.affix = affix;
}
/**
* get the createdBy - 创建人
* @return the createdBy
*/
public String getCreatedBy() {
return this.createdBy;
}
/**
* set the createdBy - 创建人
*/
public void setCreatedBy(String createdBy) {
this.createdBy = createdBy;
}
/**
* get the createdTime - 创建时间
* @return the createdTime
*/
public String getCreatedTime() {
return this.createdTime;
}
/**
* set the createdTime - 创建时间
*/
public void setCreatedTime(String createdTime) {
this.createdTime = createdTime;
}
/**
* get the updatedBy - 更新人
* @return the updatedBy
*/
public String getUpdatedBy() {
return this.updatedBy;
}
/**
* set the updatedBy - 更新人
*/
public void setUpdatedBy(String updatedBy) {
this.updatedBy = updatedBy;
}
/**
* get the updatedTime - 更新时间
* @return the updatedTime
*/
public String getUpdatedTime() {
return this.updatedTime;
}
/**
* set the updatedTime - 更新时间
*/
public void setUpdatedTime(String updatedTime) {
this.updatedTime = updatedTime;
}
/**
* get the depCode - 部门编码
* @return the depCode
*/
public String getDepCode() {
return this.depCode;
}
/**
* set the depCode - 部门编码
*/
public void setDepCode(String depCode) {
this.depCode = depCode;
}
/**
* get the value from Map
*/
public void fromMap(Map map) {
setId(NumberUtils.toLong(StringUtils.toString(map.get("id")), id));
setCompanyCode(StringUtils.defaultIfEmpty(StringUtils.toString(map.get("companyCode")), companyCode));
setReceiptDate(StringUtils.defaultIfEmpty(StringUtils.toString(map.get("receiptDate")), receiptDate));
setChkBillno(StringUtils.defaultIfEmpty(StringUtils.toString(map.get("chkBillno")), chkBillno));
setItemCode(StringUtils.defaultIfEmpty(StringUtils.toString(map.get("itemCode")), itemCode));
setItemName(StringUtils.defaultIfEmpty(StringUtils.toString(map.get("itemName")), itemName));
setUnit(StringUtils.defaultIfEmpty(StringUtils.toString(map.get("unit")), unit));
setnotes(StringUtils.defaultIfEmpty(StringUtils.toString(map.get("notes")), notes));
setPrinc(StringUtils.defaultIfEmpty(StringUtils.toString(map.get("princ")), princ));
setStatus(NumberUtils.toint(StringUtils.toString(map.get("status")), status));
setAffix(StringUtils.defaultIfEmpty(StringUtils.toString(map.get("affix")), affix));
setCreatedBy(StringUtils.defaultIfEmpty(StringUtils.toString(map.get("createdBy")), createdBy));
setCreatedTime(StringUtils.defaultIfEmpty(StringUtils.toString(map.get("createdTime")), createdTime));
setUpdatedBy(StringUtils.defaultIfEmpty(StringUtils.toString(map.get("updatedBy")), updatedBy));
setUpdatedTime(StringUtils.defaultIfEmpty(StringUtils.toString(map.get("updatedTime")), updatedTime));
setDepCode(StringUtils.defaultIfEmpty(StringUtils.toString(map.get("depCode")), depCode));
}
/**
* set the value to Map
*/
public Map toMap() {
Map map = new HashMap();
map.put("id",StringUtils.toString(id, eiMetadata.getMeta("id")));
map.put("companyCode",StringUtils.toString(companyCode, eiMetadata.getMeta("companyCode")));
map.put("receiptDate",StringUtils.toString(receiptDate, eiMetadata.getMeta("receiptDate")));
map.put("chkBillno",StringUtils.toString(chkBillno, eiMetadata.getMeta("chkBillno")));
map.put("itemCode",StringUtils.toString(itemCode, eiMetadata.getMeta("itemCode")));
map.put("itemName",StringUtils.toString(itemName, eiMetadata.getMeta("itemName")));
map.put("unit",StringUtils.toString(unit, eiMetadata.getMeta("unit")));
map.put("notes",StringUtils.toString(notes, eiMetadata.getMeta("notes")));
map.put("princ",StringUtils.toString(princ, eiMetadata.getMeta("princ")));
map.put("status",StringUtils.toString(status, eiMetadata.getMeta("status")));
map.put("affix",StringUtils.toString(affix, eiMetadata.getMeta("affix")));
map.put("createdBy",StringUtils.toString(createdBy, eiMetadata.getMeta("createdBy")));
map.put("createdTime",StringUtils.toString(createdTime, eiMetadata.getMeta("createdTime")));
map.put("updatedBy",StringUtils.toString(updatedBy, eiMetadata.getMeta("updatedBy")));
map.put("updatedTime",StringUtils.toString(updatedTime, eiMetadata.getMeta("updatedTime")));
map.put("depCode",StringUtils.toString(depCode, eiMetadata.getMeta("depCode")));
return map;
}
}
\ No newline at end of file
package com.baosight.hpjx.hp.zl.domain;
\ No newline at end of file
package com.baosight.hpjx.hp.zl.service;
import com.baosight.hpjx.hp.zl.domain.HPZL001;
import com.baosight.hpjx.util.CommonMethod;
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.service.impl.ServiceBase;
import java.util.Map;
/**
* @author ZJH
* @date 2024年01月09日 10:18
*/
public class ServiceHPZL001 extends ServiceBase {
/**
* 画面初始化.
*/
public EiInfo initLoad(EiInfo inInfo) {
HPZL001 HPZL001 = new HPZL001();
EiInfo outInfo = new EiInfo();
outInfo.addBlock(EiConstant.resultBlock);
outInfo.getBlock(EiConstant.resultBlock).addBlockMeta(HPZL001.eiMetadata);
return outInfo;
}
/**
* 查询操作.
*/
@Override
public EiInfo query(EiInfo inInfo) {
/* 调用EI查询方法.*/
EiInfo outInfo = super.query(inInfo, "HPZL001.query", new HPZL001());
return outInfo;
}
/**
* 新增操作.
*/
@Override
public EiInfo insert(EiInfo inInfo) {
try {
CommonMethod.creatorInfo(inInfo,EiConstant.resultBlock);
super.insert(inInfo,"HPZL001.insert");
// HPZL001 HPZL001 = new HPZL001();
// EiBlock eiBlock = inInfo.getBlock(EiConstant.resultBlock);
// for (int i = 0; i < eiBlock.getRowCount(); i++) {
// Map<?, ?> map = eiBlock.getRow(i);
// HPZL001.fromMap(map);
//
// this.dao.insert("HPZL001.insert", HPZL001.toMap());
// }
inInfo.setStatus(EiConstant.STATUS_SUCCESS);
inInfo.setMsg("新增成功!");
} catch (PlatException e) {
e.printStackTrace();
inInfo.setStatus(EiConstant.STATUS_FAILURE);
inInfo.setMsg("新增失败!原因参见详细错误描述!");
inInfo.setDetailMsg(e.getMessage());
logError("新增失败", e.getMessage());
return inInfo;
}
return inInfo;
}
/**
* 修改操作.
*/
public EiInfo update(EiInfo inInfo) {
try {
HPZL001 HPZL001 = new HPZL001();
EiBlock eiBlock = inInfo.getBlock(EiConstant.resultBlock);
for (int i = 0; i < eiBlock.getRowCount(); i++) {
Map<?, ?> map = eiBlock.getRow(i);
HPZL001.fromMap(map);
this.dao.update("HPZL001.update", HPZL001.toMap());
}
inInfo.setStatus(EiConstant.STATUS_SUCCESS);
inInfo.setMsg("修改成功!");
} catch (PlatException e) {
inInfo.setStatus(EiConstant.STATUS_FAILURE);
inInfo.setMsg("操作失败!原因参见详细错误描述!");
inInfo.setDetailMsg(e.getMessage());
logError("修改失败", e.getMessage());
return inInfo;
}
return query(inInfo);
}
/**
* 删除操作.
*/
public EiInfo delete(EiInfo eiInfo) {
HPZL001 HPZL001 = new HPZL001();
EiBlock eiBlock = eiInfo.getBlock(EiConstant.resultBlock);
try {
for (int i = 0; i < eiBlock.getRowCount(); i++) {
Map<?, ?> map = eiBlock.getRow(i);
HPZL001.fromMap(map);
this.dao.delete("HPZL001.delete", HPZL001.toMap());
}
} catch (PlatException e) {
eiInfo.setStatus(EiConstant.STATUS_FAILURE);
eiInfo.setMsg("删除失败,原因参见详细错误描述!");
eiInfo.setDetailMsg(e.getMessage());
logError("删除失败!", e.getMessage());
return eiInfo;
}
eiInfo.setStatus(EiConstant.STATUS_SUCCESS);
eiInfo.setMsg("删除成功!");
return eiInfo;
}
}
package com.baosight.hpjx.hp.zl.service;
\ No newline at end of file
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE sqlMap PUBLIC "-//iBATIS.com//DTD SQL Map 2.0//EN" "http://www.ibatis.com/dtd/sql-map-2.dtd">
<!-- table information
Generate time : 2024-01-10 14:47:08
Version : 1.0
tableName :hpjx.t_hpzl001
ID BIGINT NOT NULL primarykey,
COMPANY_CODE VARCHAR NOT NULL,
RECEIPT_DATE VARCHAR NOT NULL,
CHK_BILLNO VARCHAR NOT NULL,
ITEM_CODE VARCHAR NOT NULL,
ITEM_NAME VARCHAR NOT NULL,
UNIT VARCHAR,
DESC VARCHAR,
PRINC VARCHAR NOT NULL,
STATUS TINYINT NOT NULL,
AFFIX VARCHAR,
CREATED_BY VARCHAR,
CREATED_TIME VARCHAR,
UPDATED_BY VARCHAR,
UPDATED_TIME VARCHAR,
DEP_CODE VARCHAR
-->
<sqlMap namespace="HPZL001">
<select id="query" parameterClass="java.util.HashMap"
resultClass="com.baosight.hpjx.hp.zl.domain.HPZL001">
SELECT
ID as "id",
COMPANY_CODE as "companyCode", <!-- 企业编码 预留 -->
RECEIPT_DATE as "receiptDate", <!-- 单据日期 -->
CHK_BILLNO as "chkBillno", <!-- 检查单号 -->
ITEM_CODE as "itemCode", <!-- 项目号 -->
ITEM_NAME as "itemName", <!-- 项目名称 -->
UNIT as "unit", <!-- 生产组 -->
NOTES as "notes", <!-- 质量问题描述 -->
PRINC as "princ", <!-- 检查人 -->
STATUS as "status", <!-- 单据状态 0待审核 1已审核 -->
AFFIX as "affix", <!-- 附件 -->
CREATED_BY as "createdBy", <!-- 创建人 -->
CREATED_TIME as "createdTime", <!-- 创建时间 -->
UPDATED_BY as "updatedBy", <!-- 更新人 -->
UPDATED_TIME as "updatedTime", <!-- 更新时间 -->
DEP_CODE as "depCode" <!-- 部门编码 -->
FROM hpjx.t_hpzl001 WHERE 1=1
<isNotEmpty prepend=" AND " property="id">
ID = #id#
</isNotEmpty>
<dynamic prepend="ORDER BY">
<isNotEmpty property="orderBy">
$orderBy$
</isNotEmpty>
<isEmpty property="orderBy">
ID asc
</isEmpty>
</dynamic>
</select>
<select id="count" resultClass="int">
SELECT COUNT(*) FROM hpjx.t_hpzl001 WHERE 1=1
<isNotEmpty prepend=" AND " property="id">
ID = #id#
</isNotEmpty>
</select>
<!--
<isNotEmpty prepend=" AND " property="id">
ID = #id#
</isNotEmpty>
<isNotEmpty prepend=" AND " property="companyCode">
COMPANY_CODE = #companyCode#
</isNotEmpty>
<isNotEmpty prepend=" AND " property="receiptDate">
RECEIPT_DATE = #receiptDate#
</isNotEmpty>
<isNotEmpty prepend=" AND " property="chkBillno">
CHK_BILLNO = #chkBillno#
</isNotEmpty>
<isNotEmpty prepend=" AND " property="itemCode">
ITEM_CODE = #itemCode#
</isNotEmpty>
<isNotEmpty prepend=" AND " property="itemName">
ITEM_NAME = #itemName#
</isNotEmpty>
<isNotEmpty prepend=" AND " property="unit">
UNIT = #unit#
</isNotEmpty>
<isNotEmpty prepend=" AND " property="desc">
NOTES = #notes#
</isNotEmpty>
<isNotEmpty prepend=" AND " property="princ">
PRINC = #princ#
</isNotEmpty>
<isNotEmpty prepend=" AND " property="status">
STATUS = #status#
</isNotEmpty>
<isNotEmpty prepend=" AND " property="affix">
AFFIX = #affix#
</isNotEmpty>
<isNotEmpty prepend=" AND " property="createdBy">
CREATED_BY = #createdBy#
</isNotEmpty>
<isNotEmpty prepend=" AND " property="createdTime">
CREATED_TIME = #createdTime#
</isNotEmpty>
<isNotEmpty prepend=" AND " property="updatedBy">
UPDATED_BY = #updatedBy#
</isNotEmpty>
<isNotEmpty prepend=" AND " property="updatedTime">
UPDATED_TIME = #updatedTime#
</isNotEmpty>
<isNotEmpty prepend=" AND " property="depCode">
DEP_CODE = #depCode#
</isNotEmpty>
-->
<insert id="insert">
INSERT INTO hpjx.t_hpzl001 (
COMPANY_CODE, <!-- 企业编码 预留 -->
RECEIPT_DATE, <!-- 单据日期 -->
CHK_BILLNO, <!-- 检查单号 -->
ITEM_CODE, <!-- 项目号 -->
ITEM_NAME, <!-- 项目名称 -->
UNIT, <!-- 生产组 -->
NOTES, <!-- 质量问题描述 -->
PRINC, <!-- 检查人 -->
STATUS, <!-- 单据状态 0待审核 1已审核 -->
AFFIX, <!-- 附件 -->
CREATED_BY, <!-- 创建人 -->
CREATED_TIME <!-- 创建时间 -->
)
VALUES (#companyCode#, #receiptDate#, #chkBillno#, #itemCode#, #itemName#, #unit#, #notes#, #princ#, #status#, #affix#, #createdBy#, #createdTime#)
</insert>
<delete id="delete">
DELETE FROM hpjx.t_hpzl001 WHERE
ID = #id#
</delete>
<update id="update">
UPDATE hpjx.t_hpzl001
SET
RECEIPT_DATE = #receiptDate#, <!-- 单据日期 -->
CHK_BILLNO = #chkBillno#, <!-- 检查单号 -->
ITEM_CODE = #itemCode#, <!-- 项目号 -->
ITEM_NAME = #itemName#, <!-- 项目名称 -->
UNIT = #unit#, <!-- 生产组 -->
NOTES = #notes#, <!-- 质量问题描述 -->
PRINC = #princ#, <!-- 检查人 -->
STATUS = #status#, <!-- 单据状态 0待审核 1已审核 -->
AFFIX = #affix#, <!-- 附件 -->
UPDATED_BY = #updatedBy#, <!-- 更新人 -->
UPDATED_TIME = #updatedTime# <!-- 更新时间 -->
WHERE
ID = #id#
</update>
</sqlMap>
\ No newline at end of file
package com.baosight.hpjx.hp.zl.sql;
\ No newline at end of file
......@@ -11,6 +11,7 @@ import com.baosight.iplat4j.core.ioc.spring.PlatApplicationContext;
import com.baosight.iplat4j.core.util.DateUtils;
import com.baosight.iplat4j.core.web.threadlocal.UserSession;
import java.util.Calendar;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
......@@ -95,4 +96,40 @@ public class CommonMethod {
}
}
/**
* 得到当前年月的上一月字符串
* DN 21/09/04
*/
/*public static String getCurrentYearMonth() {
int year = Calendar.getInstance().get(Calendar.YEAR);
int month = Calendar.getInstance().get(Calendar.MONTH);
String yearMonth;
if (month==0){
yearMonth=year-1+"12";
}
else if (month<10 && month>0){
yearMonth=year+"0"+month;
}
else {
yearMonth=year+""+month;
}
return yearMonth;
}*/
public static String getCurrentSameYearMonth() {
int year = Calendar.getInstance().get(Calendar.YEAR);
int month = Calendar.getInstance().get(Calendar.MONTH)+1;
String yearMonth;
if (month==0){
yearMonth=year-1+"-12";
}
else if (month<10 && month>0){
yearMonth=year+"-0"+month;
}
else {
yearMonth=year+"-"+month;
}
return yearMonth;
}
}
package com.baosight.hpjx.util;
import org.springframework.util.ObjectUtils;
import java.util.ArrayList;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
import java.util.regex.Pattern;
public class StringUtil {
/**
* 默认的待去除字符, 用于{@link }静态方法.
*/
private static final Character DEFAULT_CHARACTER_TO_BE_REMOVED = '-';
/**
* 数值字符串正则匹配规则.
*/
private static final String NUMBER_STRING_RULES = "[0-9]*";
/**
* 数值字符串匹配校验器.
*/
private static final Pattern NUMBER_STRING_MATCH_CHECKER = Pattern.compile(StringUtil.NUMBER_STRING_RULES);
public StringUtil() {
}
public static String removeHorizontalLine(String date) {
if (ObjectUtils.isEmpty(date)) {
throw new RuntimeException("传入的字符串是个Null或空, 系统错误信息:" + date);
}
return removeSpecifiedCharacter(date, DEFAULT_CHARACTER_TO_BE_REMOVED);
}
public static String removeSpecifiedCharacter(String str, Character characterToBeRemoved) {
StringBuilder newDateString = new StringBuilder(ObjectUtils.isEmpty(str) ? "" : str);
for (int index = newDateString.length() - 1; index >= 0; index--) {
if (newDateString.charAt(index) == characterToBeRemoved) {
newDateString.deleteCharAt(index);
}
}
return newDateString.toString();
}
public static String getNewNumberString(String sourceStr) {
final StringBuilder newStr = new StringBuilder(sourceStr.length());
for (int i = 0, length = sourceStr.length(); i < length; i++) {
char isNumberChar = sourceStr.charAt(i);
switch (isNumberChar) {
case '0':
case '1':
case '2':
case '3':
case '4':
case '5':
case '6':
case '7':
case '8':
case '9':
newStr.append(isNumberChar);
break;
default:
break;
}
}
return newStr.toString();
}
}
......@@ -9,7 +9,7 @@ $(function () {
IPLATUI.EFGrid.result = {
pageable: {
pageSize: 20,
pageSizes: [10, 20, 50, 70, 100],
pageSizes: [10, 20, 30, 50, 100, 200],
},
}
});
\ No newline at end of file
......@@ -7,18 +7,26 @@
<head>
<%-- <link rel="stylesheet" href="${ctx}/css/simulatedOperation.css"/>--%>
</head>
<EF:EFPage title="仓库档案">
<EF:EFRegion id="inqu" title="查询条件"><%-- type="query" efRegionShowClear="true" efRegionSave="true"--%>
<EF:EFPage title="其他入库单">
<EF:EFRegion id="inqu" title="查询条件" align-item="center"><%-- type="query" efRegionShowClear="true" efRegionSave="true"--%>
<style>
.row {
display: flex;
justify-content: space-between;
align-items: center;
}
</style>
<div class="row"> <%-- blockId="inqu_status" row="0" --%>
<EF:EFInput blockId="inqu_status" ename="receiptTime" cname="单据日期" row="0"/>
<EF:EFInput blockId="inqu_status" ename="otherEnthouse" cname="其他出库单号" row="0"/>
<EF:EFDatePicker blockId="inqu_status" ename = "receiptTime" cname="单据日期"
format="yyyy-MM-dd" />
<EF:EFInput blockId="inqu_status" ename="otherEnthouse" cname="其他入库单号" row="0"/>
<EF:EFInput blockId="inqu_status" ename="whName" cname="仓库名称" row="0"/>
<EF:EFSelect cname="单据状态" optionLabel="全部" blockId="inqu_status" ename="status" row="0">
<EF:EFOption label="启用" value="1"/>
<EF:EFOption label="停用" value="0"/>
<EF:EFOption label="审核" value="1"/>
<EF:EFOption label="反审" value="0"/>
</EF:EFSelect>
</div>
......@@ -38,9 +46,9 @@
<EF:EFColumn ename="spec" cname="规格"/>
<EF:EFColumn ename="amount" cname="数量"/>
<EF:EFColumn ename="weight" cname="重量"/>
<EF:EFComboColumn align="center" ename="status" cname="状态">
<EF:EFOption label="启用" value="1"/>
<EF:EFOption label="停用" value="0"/>
<EF:EFComboColumn align="center" ename="status" cname="操作">
<EF:EFOption label="审核" value="1"/>
<EF:EFOption label="反审" value="0"/>
</EF:EFComboColumn>
<EF:EFColumn ename="remark" cname="备注"/>
......
......@@ -9,7 +9,7 @@ $(function () {
IPLATUI.EFGrid.result = {
pageable: {
pageSize: 20,
pageSizes: [10, 20, 50, 70, 100],
pageSizes: [10, 20, 30, 50, 100, 200],
},
}
});
\ No newline at end of file
......@@ -10,15 +10,22 @@
<EF:EFPage title="仓库档案">
<EF:EFRegion id="inqu" title="查询条件"><%-- type="query" efRegionShowClear="true" efRegionSave="true"--%>
<style>
.row {
display: flex;
justify-content: space-between;
align-items: center;
}
</style>
<div class="row"> <%-- blockId="inqu_status" row="0" --%>
<EF:EFInput blockId="inqu_status" ename="receiptTime" cname="单据日期" row="0"/>
<EF:EFDatePicker ename="receiptDate" cname="单据日期"
format="yyyy-MM-dd" depth="year" />
<EF:EFInput blockId="inqu_status" ename="otherEnthouse" cname="其他出库单号" row="0"/>
<EF:EFInput blockId="inqu_status" ename="whName" cname="仓库名称" row="0"/>
<EF:EFSelect cname="单据状态" optionLabel="全部" blockId="inqu_status" ename="status" row="0">
<EF:EFOption label="启用" value="1"/>
<EF:EFOption label="停用" value="0"/>
<EF:EFOption label="审核" value="1"/>
<EF:EFOption label="反审" value="0"/>
</EF:EFSelect>
</div>
......@@ -37,9 +44,9 @@
<EF:EFColumn ename="matName" cname="物料名称"/>
<EF:EFColumn ename="amount" cname="数量"/>
<EF:EFColumn ename="weight" cname="重量"/>
<EF:EFComboColumn align="center" ename="status" cname="单据状态">
<EF:EFOption label="启用" value="1"/>
<EF:EFOption label="停用" value="0"/>
<EF:EFComboColumn align="center" ename="status" cname="操作">
<EF:EFOption label="审核" value="1"/>
<EF:EFOption label="反审" value="0"/>
</EF:EFComboColumn>
<EF:EFColumn ename="remark" cname="备注"/>
......
$(function() {
$("#inqu_status-0-datemonth").val(__eiInfo.blocks.inqu_status.rows[0]);
// 查询
$("#QUERY").on("click", function () {
resultGrid.dataSource.page(1); // 点击查询按钮,从第1页开始查询
});
IPLATUI.EFGrid = {
"result": {
loadComplete: function (grid) {
......@@ -39,7 +42,7 @@ $(function() {
});
// 修改
$("#UPDATE").on("click", function () {
$("#BTN_UPDATE").on("click", function () {
var rowCount = resultGrid.getCheckedRows();
// 检验是否选中数据
if (rowCount == null || rowCount == "") {
......
......@@ -21,14 +21,8 @@
<EF:EFGrid blockId="result" autoDraw="false" isFloat="true" autoFit="true">
<EF:EFColumn ename="id" cname="内码" hidden="true"/>
<%-- <EF:EFComboColumn ename="datemonth" cname="月份" align="center"
blockName="company_type_block_id"
columnTemplate="#=textField#-#=valueField#" optionLabel=" "
itemTemplate="#=textField#-#=valueField#" textField="textField"
valueField="valueField" width="100">
</EF:EFComboColumn>--%>
<EF:EFColumn ename="datemonth" cname="月份" width="100" readonly="false" />
<EF:EFColumn ename="datemonth" cname="月份" editType="date" dateFormat="yyyy-MM" parseFormats="['yyyyMM']" start="year" depth="year" width="100" readonly="false" />
<EF:EFColumn ename="statisticalNumber" cname="统计单单号" width="100" readonly="false" />
<EF:EFColumn ename="materialCode" cname="物料编码" width="100" readonly="false"/>
<EF:EFColumn ename="materialName" cname="物料名称" width="100" readonly="false"/>
......
......@@ -10,10 +10,10 @@
<EF:EFRegion id="inqu" title="查询条件">
<div class="row">
<EF:EFInput ename="inqu_status-0-custName" cname="供应商名称" colWidth="4" readonly="false"/>
<EF:EFSelect ename="inqu_status-0-custType" cname="供应商类型" colWidth="4">
<EF:EFOption label="--请选择--" value=""/>
<EF:EFOption label="国企" value="1"></EF:EFOption>
<EF:EFOption label="民营" value="2"></EF:EFOption>
<EF:EFSelect ename="inqu_status-0-custType" cname="供应商类型" colWidth="4"
template="#=valueField#-#=textField#" valueTemplate="#=valueField#-#=textField#" enable="true">
<EF:EFOption label="全部" value=""/>
<EF:EFOptions blockId="company_type_block_id" textField="valueField" valueField="textField"/>
</EF:EFSelect>
<EF:EFSelect ename="inqu_status-0-status" cname="状态" colWidth="4">
<EF:EFOption label="--请选择--" value=""/>
......@@ -28,26 +28,26 @@
<EF:EFColumn ename="id" cname="内码" hidden="true"/>
<EF:EFComboColumn ename="custType" cname="供应商类型" align="center"
blockName="company_type_block_id"
columnTemplate="#=textField#-#=valueField#" optionLabel=" "
itemTemplate="#=textField#-#=valueField#" textField="textField"
valueField="valueField" width="100" required="true">
<EF:EFOption label="--请选择--" value=""></EF:EFOption>
<EF:EFOption label="国企" value="1"></EF:EFOption>
<EF:EFOption label="民营" value="2"></EF:EFOption>
itemTemplate="#=textField#-#=valueField#" textField="valueField"
valueField="textField" width="100" required="true">
</EF:EFComboColumn>
<EF:EFColumn ename="custCode" cname="供应商编码" width="100" readonly="false" required="true"/>
<EF:EFColumn ename="custName" cname="供应商名称" width="100" readonly="false" required="true"/>
<EF:EFColumn ename="address" cname="地址" width="100" readonly="false" required="true"/>
<EF:EFComboColumn ename="status" cname="状态" align="center" columnTemplate="#=textField#-#=valueField#" optionLabel=" "
itemTemplate="#=textField#-#=valueField#" textField="textField"
<EF:EFComboColumn ename="status" cname="状态" align="center" columnTemplate="#=valueField#-#=textField#" optionLabel=" "
itemTemplate="#=valueField#-#=textField#" textField="textField"
valueField="valueField" width="100" required="true">
<EF:EFOption label="--请选择--" value=""></EF:EFOption>
<EF:EFOption label="启用" value="1"></EF:EFOption>
<EF:EFOption label="禁用" value="0"></EF:EFOption>
</EF:EFComboColumn>
<EF:EFColumn ename="createdTime" cname="创建时间" width="100" readonly="true" disabled="true"/>
<EF:EFColumn ename="createdTime" cname="创建时间" readonly="true" width="100" align="center" enable="false"
parseFormats="['yyyyMMddHHmmss']" editType="datetime" dateFormat="yyyy-MM-dd HH:mm:ss" />
<EF:EFColumn ename="createdBy" cname="创建人" width="100" readonly="true" disabled="true"/>
<EF:EFColumn ename="updatedTime" cname="更新时间" width="100" readonly="true" disabled="true"/>
<EF:EFColumn ename="updatedTime" cname="更新时间" readonly="true" width="100" align="center" enable="false"
parseFormats="['yyyyMMddHHmmss']" editType="datetime" dateFormat="yyyy-MM-dd HH:mm:ss" />
<EF:EFColumn ename="updatedBy" cname="更新人" width="100" readonly="true" disabled="true"/>
</EF:EFGrid>
</EF:EFRegion>
......
......@@ -40,7 +40,7 @@ $(function() {
});
// 修改
$("#UPDATE").on("click", function () {
$("#BTN_UPDATE").on("click", function () {
var rowCount = resultGrid.getCheckedRows();
// 检验是否选中数据
if (rowCount == null || rowCount == "") {
......
......@@ -9,7 +9,10 @@
<EF:EFRegion id="inqu" title="查询条件">
<div class="row">
<EF:EFInput ename="inqu_status-0-inventName" cname="存货类型" colWidth="4" readonly="false"/>
<EF:EFSelect ename="inqu_status-0-inventType" cname="存货类型" colWidth="4">
<EF:EFOption label="--请选择--" value=""/>
<EF:EFOption label="待定" value="1"></EF:EFOption>
</EF:EFSelect>
<EF:EFSelect ename="inqu_status-0-status" cname="状态" colWidth="4">
<EF:EFOption label="--请选择--" value=""/>
<EF:EFOption label="启用" value="1"></EF:EFOption>
......@@ -24,17 +27,24 @@
<EF:EFColumn ename="id" cname="内码" hidden="true"/>
<EF:EFColumn ename="inventCode" cname="类型编码" width="100" readonly="false" required="true"/>
<EF:EFColumn ename="inventName" cname="存货名称" width="100" readonly="false" required="true"/>
<EF:EFColumn ename="inventType" cname="存货类型" width="100" readonly="false" required="true"/>
<EF:EFComboColumn ename="status" cname="状态" align="center" columnTemplate="#=textField#-#=valueField#" optionLabel=" "
itemTemplate="#=textField#-#=valueField#" textField="textField"
<EF:EFComboColumn ename="inventType" cname="存货类型" align="center" columnTemplate="#=valueField#-#=textField#" optionLabel=" "
itemTemplate="#=valueField#-#=textField#" textField="textField"
valueField="valueField" width="100" required="true">
<EF:EFOption label="--请选择--" value=""></EF:EFOption>
<EF:EFOption label="待定" value="1"></EF:EFOption>
</EF:EFComboColumn>
<EF:EFComboColumn ename="status" cname="状态" align="center" columnTemplate="#=valueField#-#=textField#" optionLabel=" "
itemTemplate="#=valueField#-#=textField#" textField="textField"
valueField="valueField" width="100" required="true">
<EF:EFOption label="--请选择--" value=""></EF:EFOption>
<EF:EFOption label="启用" value="1"></EF:EFOption>
<EF:EFOption label="禁用" value="0"></EF:EFOption>
</EF:EFComboColumn>
<EF:EFColumn ename="createdTime" cname="创建时间" width="100" readonly="true" disabled="true"/>
<EF:EFColumn ename="createdTime" cname="创建时间" readonly="true" width="100" align="center" enable="false"
parseFormats="['yyyyMMddHHmmss']" editType="datetime" dateFormat="yyyy-MM-dd HH:mm:ss" />
<EF:EFColumn ename="createdBy" cname="创建人" width="100" readonly="true" disabled="true"/>
<EF:EFColumn ename="updatedTime" cname="更新时间" width="100" readonly="true" disabled="true"/>
<EF:EFColumn ename="updatedTime" cname="更新时间" readonly="true" width="100" align="center" enable="false"
parseFormats="['yyyyMMddHHmmss']" editType="datetime" dateFormat="yyyy-MM-dd HH:mm:ss" />
<EF:EFColumn ename="updatedBy" cname="更新人" width="100" readonly="true" disabled="true"/>
</EF:EFGrid>
</EF:EFRegion>
......
$(function() {
// 查询
$("#QUERY").on("click", function () {
resultGrid.dataSource.page(1); // 点击查询按钮,从第1页开始查询
});
IPLATUI.EFGrid = {
"result": {
loadComplete: function (grid) {
// 新增
$("#BTN_INSERT").on("click", function () {
var btnNode = $(this);
//禁用按钮
btnNode.attr("disabled", true);
IPLAT.submitNode($("#HPPZ006"), "HPPZ006", "insert", {
onSuccess: function (ei) {
if (ei["status"] == -1) {
NotificationUtil(ei, "error");
} else {
// 绑定grid
resultGrid.setEiInfo(ei);
NotificationUtil({
msg: '新增成功'
});
}
//释放禁用按钮
btnNode.attr("disabled", false);
resultGrid.dataSource.page(1);
},
onFail: function (ei) { // onFail 表示失败回调函数
// 发生异常
console.log(ei);
//释放禁用按钮
btnNode.attr("disabled", false);
}
});
});
// 修改
$("#BTN_UPDATE").on("click", function () {
var rowCount = resultGrid.getCheckedRows();
// 检验是否选中数据
if (rowCount == null || rowCount == "") {
NotificationUtil({
msg : '请选择一条或多条数据'
}, "warning");
return false;
}
var btnNode = $(this);
//禁用按钮
btnNode.attr("disabled", true);
IPLAT.submitNode($("#HPPZ006"), "HPPZ006", "update", {
onSuccess: function (ei) {
if (ei["status"] == -1) {
NotificationUtil(ei, "error");
} else {
NotificationUtil({
msg: '修改成功'
});
// 绑定grid
resultGrid.setEiInfo(ei);
}
//释放禁用按钮
btnNode.attr("disabled", false);
},
onFail: function (ei) { // onFail 表示失败回调函数
// 发生异常
console.log(ei);
//释放禁用按钮
btnNode.attr("disabled", false);
}
});
});
//删除
$("#DELETE").on("click", function () {
var btnNode = $(this);
//禁用按钮
btnNode.attr("disabled", true);
var dataItems = resultGrid.getCheckedRows();
if (dataItems == null || dataItems == "") {
NotificationUtil({
msg: '选择要删除的数据'
}, "warning");
//释放禁用按钮
btnNode.attr("disabled", false);
return false;
}
IPLAT.submitNode($("#HPPZ006"), "HPPZ006", "delete", {
onSuccess: function (ei) {
if (ei["status"] == -1) {
NotificationUtil(ei, "error");
} else {
NotificationUtil({
msg: '删除成功'
});
// 绑定grid
resultGrid.setEiInfo(ei);
}
//释放禁用按钮
btnNode.attr("disabled", false);
},
onFail: function (ei) {// onFail
// 表示失败回调函数
// 发生异常
console.log(ei);
//释放禁用按钮
btnNode.attr("disabled", false);
}
});
});
}
},
};
});
<!DOCTYPE html>
<%@ page contentType="text/html; charset=UTF-8" %>
<%@ taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c" %>
<%@ taglib prefix="EF" tagdir="/WEB-INF/tags/EF" %>
<c:set var="ctx" value="${pageContext.request.contextPath}"/>
<EF:EFPage title="存货档案">
<EF:EFRegion id="inqu" title="查询条件">
<div class="row">
<EF:EFSelect ename="inqu_status-0-inventName" cname="存货名称" colWidth="4">
<EF:EFOption label="--请选择--" value=""/>
<EF:EFOption label="待定" value="1"></EF:EFOption>
</EF:EFSelect>
<EF:EFSelect ename="inqu_status-0-inventType" cname="存货类型" colWidth="4">
<EF:EFOption label="--请选择--" value=""/>
<EF:EFOption label="待定" value="1"></EF:EFOption>
</EF:EFSelect>
<EF:EFSelect ename="inqu_status-0-status" cname="状态" colWidth="4">
<EF:EFOption label="--请选择--" value=""/>
<EF:EFOption label="启用" value="1"></EF:EFOption>
<EF:EFOption label="未启用" value="0"></EF:EFOption>
</EF:EFSelect>
</div>
</EF:EFRegion>
<EF:EFRegion id="result" title="明细信息">
<EF:EFGrid blockId="result" autoDraw="false" isFloat="true" autoFit="true">
<EF:EFColumn ename="id" cname="内码" hidden="true"/>
<EF:EFComboColumn ename="inventCode" cname="存货编码" align="center" columnTemplate="#=valueField#-#=textField#" optionLabel=" "
itemTemplate="#=valueField#-#=textField#" textField="textField"
valueField="valueField" width="100" required="true">
<EF:EFOption label="--请选择--" value=""></EF:EFOption>
<EF:EFOption label="待定" value="1"></EF:EFOption>
</EF:EFComboColumn>
<EF:EFComboColumn ename="inventName" cname="存货名称" align="center" columnTemplate="#=valueField#-#=textField#" optionLabel=" "
itemTemplate="#=valueField#-#=textField#" textField="textField"
valueField="valueField" width="100" required="true">
<EF:EFOption label="--请选择--" value=""></EF:EFOption>
<EF:EFOption label="待定" value="1"></EF:EFOption>
</EF:EFComboColumn>
<EF:EFComboColumn ename="inventType" cname="存货类型" align="center" columnTemplate="#=valueField#-#=textField#" optionLabel=" "
itemTemplate="#=valueField#-#=textField#" textField="textField"
valueField="valueField" width="100" required="true">
<EF:EFOption label="--请选择--" value=""></EF:EFOption>
<EF:EFOption label="待定" value="1"></EF:EFOption>
</EF:EFComboColumn>
<EF:EFColumn ename="spec" cname="规格" width="100" readonly="false" required="true"/>
<EF:EFColumn ename="length" cname="长" width="100" readonly="false" required="true"/>
<EF:EFColumn ename="wide" cname="宽" width="100" readonly="false" required="true"/>
<EF:EFColumn ename="thick" cname="厚" width="100" readonly="false" required="true"/>
<EF:EFColumn ename="material" cname="材质" width="100" readonly="false" required="true"/>
<EF:EFColumn ename="coefficient" cname="系数" width="100" readonly="false" required="true"/>
<EF:EFColumn ename="unit" cname="单位" width="100" readonly="false" required="true"/>
<EF:EFComboColumn ename="status" cname="状态" align="center" columnTemplate="#=valueField#-#=textField#" optionLabel=" "
itemTemplate="#=valueField#-#=textField#" textField="textField"
valueField="valueField" width="100" required="true">
<EF:EFOption label="--请选择--" value=""></EF:EFOption>
<EF:EFOption label="启用" value="1"></EF:EFOption>
<EF:EFOption label="禁用" value="0"></EF:EFOption>
</EF:EFComboColumn>
<EF:EFColumn ename="createdTime" cname="创建时间" readonly="true" width="100" align="center" enable="false"
parseFormats="['yyyyMMddHHmmss']" editType="datetime" dateFormat="yyyy-MM-dd HH:mm:ss" />
<EF:EFColumn ename="createdBy" cname="创建人" width="100" readonly="true" disabled="true"/>
<EF:EFColumn ename="updatedTime" cname="更新时间" readonly="true" width="100" align="center" enable="false"
parseFormats="['yyyyMMddHHmmss']" editType="datetime" dateFormat="yyyy-MM-dd HH:mm:ss" />
<EF:EFColumn ename="updatedBy" cname="更新人" width="100" readonly="true" disabled="true"/>
</EF:EFGrid>
</EF:EFRegion>
</EF:EFPage>
......@@ -9,7 +9,7 @@ $(function () {
IPLATUI.EFGrid.result = {
pageable: {
pageSize: 20,
pageSizes: [10, 20, 50, 70, 100],
pageSizes: [10, 20, 30, 50, 100, 200],
},
}
});
\ No newline at end of file
$(function () {
IPLATUI.EFTree = {
"materialTree": {
ROOT: "root:项目列表",
/**
* 选中树结点时触发的事件,注意点击树 折叠/展开 的图标不会触发此事件
*
* @param e
* e.sender kendoTree对象, tree01Tree(EFTree的id + "Tree")
* e.node 点击的节点DOM元素
*/
select: function (e) {
var nodeData = this.dataItem(e.node);
IPLATUI.EFTree.materialTree.selectTreeNode.nodeId = nodeData.nodeId;
IPLATUI.EFTree.materialTree.selectTreeNode.projCode = nodeData.projCode;
IPLATUI.EFTree.materialTree.selectTreeNode.projName = nodeData.projName;
// 重新查询EFGrid
resultGrid.dataSource.page(1);
},
selectTreeNode:{}
}
};
$("#QUERY").on("click", function () {
resultGrid.dataSource.page(1);
});
IPLATUI.EFGrid = {
result: {
pageable: {
pageSize: 10,
pageSizes: [10, 20, 50, 70, 100],
},
/**
* EFGrid新增行之前触发的事件,可以根据业务逻辑控制是否进行新增
* @param e 事件对象
* e.sender Grid对象
* e.preventDefault 阻止事件发生
*/
beforeAdd: function (e) {
var logic = Object.keys(IPLATUI.EFTree.materialTree.selectTreeNode).length === 0;
if (logic) { // 通过业务逻辑判断, 控制是否进行新增
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['parentPrdtCode'] = selectTreeNode.nodeId;
item['parentPrdtName'] = selectTreeNode.projName;
});
},
/**
* 点击Grid保存按钮时触发的事件
* @param e 事件对象
* e.sender Grid对象
*/
onSave: function (e) {
// 不向后台保存
var tree = $("#materialTree").data("kendoTreeView");
var inInfo = new EiInfo();
EiCommunicator.send("HPSC002", "queryTreeNode", inInfo, {//传入参数
onSuccess: function (inInfo) {
tree.reload("root");//更新树
}
});
},
/**
* 点击Grid删除按钮时触发的事件
* @param e 事件对象
* e.sender Grid对象
*/
onDelete: function (e) {
// 不向后台保存
var tree = $("#materialTree").data("kendoTreeView");
var inInfo = new EiInfo();
EiCommunicator.send("HPSC002", "queryTreeNode", inInfo, {//传入参数
onSuccess: function (inInfo) {
tree.reload("root");//更新树
}
});
},
toolbarConfig: {
hidden: false, // true时,不显示功能按钮,但保留setting导出按钮
// add: false, // 不显示新增按钮
// cancel: false, // 不显示取消按钮
// save: false, // 不显示保存按钮
delete: true, // 显示删除按钮
buttons: [ // 不允许覆盖默认的4个按钮,可以设置自定义的按钮
{
name: "test",
text: "测试",
front: "left",
layout: "1",
click: function () {
// 此处编写自定义功能
WindowUtil({
title: "定制",
content: "<div class='kendo-del-message'>测试</div>"
});
}
},
]
},
columns: [{
field: "filePath1",
headerTemplate: "设计图纸",
template: "<span style='display: flex;justify-content: center'><a class='i-btn-sm test' href=''>下载</a></span>",
}],
}
}
});
\ No newline at end of file
<!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}"/>
<head>
<%-- <link rel="stylesheet" href="${ctx}/css/simulatedOperation.css"/>--%>
</head>
<EF:EFPage title="物料清单">
<EF:EFRegion id="inqu" title="查询条件">
<div class="row">
<EF:EFInput ename="custType" cname="客商类型:" row="0"/>
<EF:EFSelect cname="分类:" optionLabel="全部" blockId="inqu_status" ename="custClassify" row="0">
<EF:EFOption label="供应商" value="1"/>
<EF:EFOption label="客户" value="2"/>
</EF:EFSelect>
<EF:EFSelect cname="状态:" optionLabel="全部" blockId="inqu_status" ename="status" row="0">
<EF:EFOption label="启用" value="1"/>
<EF:EFOption label="停用" value="0"/>
</EF:EFSelect>
</div>
<EF:EFButton ename="QUERY" cname="查询" row="1" class="btn-align-right"></EF:EFButton>
</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="projTree" title="BOM结构图" fitHeight="true">
<EF:EFTree id="materialTree" valueField="label" textField="text" hasChildren="leaf"
serviceName="HPSC002" 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" >
<EF:EFColumn ename="id" cname="主键" hidden="true"/>
<EF:EFColumn enable="false" ename="projCode" cname="项目编码"/>
<EF:EFColumn enable="false" ename="projName" cname="项目名称"/>
<EF:EFColumn ename="prdtCode" required="true" cname="产品编码"/>
<EF:EFColumn ename="prdtName" required="true" cname="产品名称"/>
<EF:EFColumn enable="false" ename="parentPrdtCode" hidden="true" cname="上级产品名称"/>
<EF:EFColumn enable="false" ename="parentPrdtName" cname="上级产品名称"/>
<EF:EFColumn ename="num" required="true" cname="数量"/>
<EF:EFColumn ename="unitWt" required="true" format="{0:N3}" cname="单重"/>
<EF:EFColumn enable="false" format="{0:N3}" ename="totalWt" cname="总重"/>
</EF:EFGrid>
</EF:EFRegion>
</div>
</div>
</EF:EFPage>
<script>
var ctx = "${ctx}";
</script>
<script src="${ctx}/HP/SC/HPSC002.js"></script>
\ No newline at end of file
$(function() {
// 查询
$("#QUERY").on("click", function () {
resultGrid.dataSource.page(1); // 点击查询按钮,从第1页开始查询
});
IPLATUI.EFGrid = {
"result": {
loadComplete: function (grid) {
// 新增
$("#BTN_INSERT").on("click", function () {
var btnNode = $(this);
//禁用按钮
btnNode.attr("disabled", true);
IPLAT.submitNode($("#HPZL001"), "HPZL001", "insert", {
onSuccess: function (ei) {
if (ei["status"] == -1) {
NotificationUtil(ei, "error");
} else {
// 绑定grid
resultGrid.setEiInfo(ei);
NotificationUtil({
msg: '新增成功'
});
}
//释放禁用按钮
btnNode.attr("disabled", false);
resultGrid.dataSource.page(1);
},
onFail: function (ei) { // onFail 表示失败回调函数
// 发生异常
console.log(ei);
//释放禁用按钮
btnNode.attr("disabled", false);
}
});
});
// 修改
$("#BTN_UPDATE").on("click", function () {
var rowCount = resultGrid.getCheckedRows();
// 检验是否选中数据
if (rowCount == null || rowCount == "") {
NotificationUtil({
msg : '请选择一条或多条数据'
}, "warning");
return false;
}
var btnNode = $(this);
//禁用按钮
btnNode.attr("disabled", true);
IPLAT.submitNode($("#HPZL001"), "HPZL001", "update", {
onSuccess: function (ei) {
if (ei["status"] == -1) {
NotificationUtil(ei, "error");
} else {
NotificationUtil({
msg: '修改成功'
});
// 绑定grid
resultGrid.setEiInfo(ei);
}
//释放禁用按钮
btnNode.attr("disabled", false);
},
onFail: function (ei) { // onFail 表示失败回调函数
// 发生异常
console.log(ei);
//释放禁用按钮
btnNode.attr("disabled", false);
}
});
});
//删除
$("#DELETE").on("click", function () {
var btnNode = $(this);
//禁用按钮
btnNode.attr("disabled", true);
var dataItems = resultGrid.getCheckedRows();
if (dataItems == null || dataItems == "") {
NotificationUtil({
msg: '选择要删除的数据'
}, "warning");
//释放禁用按钮
btnNode.attr("disabled", false);
return false;
}
IPLAT.submitNode($("#HPZL001"), "HPZL001", "delete", {
onSuccess: function (ei) {
if (ei["status"] == -1) {
NotificationUtil(ei, "error");
} else {
NotificationUtil({
msg: '删除成功'
});
// 绑定grid
resultGrid.setEiInfo(ei);
}
//释放禁用按钮
btnNode.attr("disabled", false);
},
onFail: function (ei) {// onFail
// 表示失败回调函数
// 发生异常
console.log(ei);
//释放禁用按钮
btnNode.attr("disabled", false);
}
});
});
}
},
};
});
<!DOCTYPE html>
<%@ page contentType="text/html; charset=UTF-8" %>
<%@ taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c" %>
<%@ taglib prefix="EF" tagdir="/WEB-INF/tags/EF" %>
<c:set var="ctx" value="${pageContext.request.contextPath}"/>
<EF:EFPage title="质量巡检单">
<EF:EFRegion id="inqu" title="查询条件">
<div class="row">
<EF:EFDatePicker ename="inqu_status-0-receiptDate" cname="单据日期"
format="yyyy/MM/dd" depth="year" required="true"/>
<EF:EFInput ename="inqu_status-0-itemName" cname="项目名称" colWidth="4" readonly="false"/>
<EF:EFInput ename="inqu_status-0-princ" cname="检查人" colWidth="4" readonly="false"/>
<EF:EFSelect ename="inqu_status-0-status" cname="处理状态" colWidth="4">
<EF:EFOption label="--请选择--" value=""/>
<EF:EFOption label="审核" value="1"></EF:EFOption>
<EF:EFOption label="待审核" value="0"></EF:EFOption>
</EF:EFSelect>
</div>
</EF:EFRegion>
<EF:EFRegion id="result" title="明细信息">
<EF:EFGrid blockId="result" autoDraw="false" isFloat="true" autoFit="true">
<EF:EFColumn ename="id" cname="内码" hidden="true"/>
<EF:EFColumn ename="receiptDate" cname="单据日期" width="100" readonly="false" />
<EF:EFColumn ename="chkBillno" cname="检查单号" width="100" readonly="false" />
<EF:EFColumn ename="itemCode" cname="项目号" width="100" readonly="false"/>
<EF:EFColumn ename="itemName" cname="项目名称" width="100" readonly="false"/>
<EF:EFColumn ename="unit" cname="生产组" width="100" readonly="false"/>
<EF:EFColumn ename="notes" cname="质量问题描述" width="100" readonly="false"/>
<EF:EFColumn ename="princ" cname="检查人" width="100" readonly="false"/>
<EF:EFColumn ename="status" cname="单据状态" width="100" readonly="false"/>
<%--<EF:EFColumn ename="valuestatus" cname="审核按钮" width="100" readonly="false"/>--%>
<EF:EFColumn ename="affix" cname="附件" width="100" readonly="false"/>
<EF:EFColumn ename="createdTime" cname="创建时间" readonly="true" width="150" align="center" enable="false"
parseFormats="['yyyyMMddHHmmss']" editType="datetime" dateFormat="yyyy-MM-dd HH:mm:ss" hidden ="true" />
<EF:EFColumn ename="createdBy" cname="创建人" readonly="true" width="150" align="center" enable="false" hidden ="true"/>
<EF:EFColumn ename="updatedTime" cname="更新时间" readonly="true" width="150" align="center" enable="false"
parseFormats="['yyyyMMddHHmmss']" editType="datetime" dateFormat="yyyy-MM-dd HH:mm:ss" hidden ="true"/>
<EF:EFColumn ename="updatedBy" cname="更新人" readonly="true" width="150" align="center" enable="false" hidden ="true"/>
</EF:EFGrid>
</EF:EFRegion>
</EF:EFPage>
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment