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));
......
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
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
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