Commit 77d284d6 by wuwenlong

实时库存管理;

parent e8da80e2
......@@ -51,6 +51,13 @@ public enum DdynamicEnum {
INVENT_SPEC_BLOCK_ID("invent_spec_block_id", "id", "spec", "HPPZ006.queryComboBoxSpec"),
/**
* 模块:存货档案(ALL)
* 用途:存货档案下拉框
* 编写:wwl
*/
INVENT_ALL_BLOCK_ID("invent_all_block_id", "id", "inventType", "inventName", "spec", "material", "unit", "HPPZ006.queryComboBoxAll"),
/**
* 模块:存货档案(规格)
* 用途:存货档案下拉框
* 编写:wwl
......@@ -64,8 +71,6 @@ public enum DdynamicEnum {
*/
WH_RECORD_BLOCK_ID("wh_record_block_id","whCode","whName","HPPZ007.queryComboBox"),
WH_RECORD_QUERY_BLOCK_ID("whName_block_id","whCode","whName","HPPZ007.queryComboBox"),
/**
* 模块:物料类型
* 用途:物料类型下拉框
......@@ -95,10 +100,68 @@ public enum DdynamicEnum {
private final String value;
/** 字段描述 */
private final String text;
private String param1;
private String param2;
private String param3;
private String param4;
private String param5;
/** 数据源 */
private final String dbSource;
DdynamicEnum(String blockId, String value, String text, String param1, String dbSource) {
this.blockId = blockId;
this.value = value;
this.text = text;
this.param1 = param1;
this.dbSource = dbSource;
}
DdynamicEnum(String blockId, String value, String text, String param1, String param2, String dbSource) {
this.blockId = blockId;
this.value = value;
this.text = text;
this.param1 = param1;
this.param2 = param2;
this.dbSource = dbSource;
}
DdynamicEnum(String blockId, String value, String text, String param1, String param2, String param3, String dbSource) {
this.blockId = blockId;
this.value = value;
this.text = text;
this.param1 = param1;
this.param2 = param2;
this.param3 = param3;
this.dbSource = dbSource;
}
DdynamicEnum(String blockId, String value, String text, String param1, String param2, String param3, String param4, String dbSource) {
this.blockId = blockId;
this.value = value;
this.text = text;
this.param1 = param1;
this.param2 = param2;
this.param3 = param3;
this.param4 = param4;
this.dbSource = dbSource;
}
DdynamicEnum(String blockId, String value, String text, String param1, String param2, String param3, String param4, String param5, String dbSource) {
this.blockId = blockId;
this.value = value;
this.text = text;
this.param1 = param1;
this.param2 = param2;
this.param3 = param3;
this.param4 = param4;
this.param5 = param5;
this.dbSource = dbSource;
}
DdynamicEnum(String blockId, String value, String text, String dbSource){
this.blockId = blockId;
......@@ -125,4 +188,43 @@ public enum DdynamicEnum {
return text;
}
public String getParam1() {
return param1;
}
public void setParam1(String param1) {
this.param1 = param1;
}
public String getParam2() {
return param2;
}
public void setParam2(String param2) {
this.param2 = param2;
}
public String getParam3() {
return param3;
}
public void setParam3(String param3) {
this.param3 = param3;
}
public String getParam4() {
return param4;
}
public void setParam4(String param4) {
this.param4 = param4;
}
public String getParam5() {
return param5;
}
public void setParam5(String param5) {
this.param5 = param5;
}
}
......@@ -37,6 +37,21 @@ public class HPConstants {
public static final String TEXT_FIELD = "textField";
/** 前后台交互下拉框字段 字段名 dzg */
public static final String PARAM1_FIELD = "param1Field";
/** 前后台交互下拉框字段 字段名 dzg */
public static final String PARAM2_FIELD = "param2Field";
/** 前后台交互下拉框字段 字段名 dzg */
public static final String PARAM3_FIELD = "param3Field";
/** 前后台交互下拉框字段 字段名 dzg */
public static final String PARAM4_FIELD = "param4Field";
/** 前后台交互下拉框字段 字段名 dzg */
public static final String PARAM5_FIELD = "param5Field";
/** 前后台交互下拉框字段 字段名 dzg */
public static final String VALUE_FIELD = "valueField";
}
......
package com.baosight.hpjx.hp.kc.domain;
import com.baosight.iplat4j.core.data.DaoEPBase;
import com.baosight.iplat4j.core.ei.EiColumn;
import com.baosight.iplat4j.core.util.NumberUtils;
import com.baosight.iplat4j.core.util.StringUtils;
import java.math.BigDecimal;
import java.util.HashMap;
import java.util.Map;
/**
* Project: <br>
* Title:THPK010.java <br>
* Description: <br>
*
* Copyrigth:Baosight Software LTD.co Copyright (c) 2019. <br>
*
* @version 1.0
* @history 2024-01-11 15:32:44 create
*/
public class HPKC010 extends DaoEPBase {
private static final long serialVersionUID = 1L;
public static final String FIELD_ID = "id";
public static final String FIELD_COMPANY_CODE = "companyCode"; /* 企业编码 预留*/
public static final String FIELD_WH_CODE = "whCode"; /* 仓库编码*/
// public static final String FIELD_WH_NAME = "whName"; /* 仓库名称*/
// public static final String FIELD_INVENT_TYPE = "inventType"; /* 物料类型*/
// public static final String FIELD_INVENT_CODE = "inventCode"; /* 物料编码*/
// public static final String FIELD_INVENT_NAME = "inventName"; /* 物料名称*/
public static final String FIELD_INVENT_RECORD_ID = "inventRecordId"; /* 存货档案ID*/
public static final String FIELD_AMOUNT = "amount"; /* 账面数量*/
public static final String FIELD_WEIGHT = "weight"; /* 账面重量*/
public static final String FIELD_CREATED_BY = "createdBy"; /* 创建人*/
public static final String FIELD_CREATED_NAME = "createdName"; /* 创建人名称*/
public static final String FIELD_CREATED_TIME = "createdTime"; /* 创建时间*/
public static final String FIELD_UPDATED_BY = "updatedBy"; /* 更新人*/
public static final String FIELD_UPDATED_NAME = "updatedName"; /* 更新人名称*/
public static final String FIELD_UPDATED_TIME = "updatedTime"; /* 更新时间*/
public static final String FIELD_VERSION = "version"; /* 版本号*/
public static final String COL_ID = "ID";
public static final String COL_COMPANY_CODE = "COMPANY_CODE"; /* 企业编码 预留*/
public static final String COL_WH_CODE = "WH_CODE"; /* 仓库编码*/
// public static final String COL_WH_NAME = "WH_NAME"; /* 仓库名称*/
// public static final String COL_INVENT_TYPE = "INVENT_TYPE"; /* 物料类型*/
// public static final String COL_INVENT_CODE = "INVENT_CODE"; /* 物料编码*/
// public static final String COL_INVENT_NAME = "INVENT_NAME"; /* 物料名称*/
public static final String COL_INVENT_RECORD_ID = "inventRecordId"; /* 存货档案ID*/
public static final String COL_AMOUNT = "amount"; /* 数量*/
public static final String COL_WEIGHT = "weight"; /* 重量*/
public static final String COL_CREATED_BY = "CREATED_BY"; /* 创建人*/
public static final String COL_CREATED_NAME = "CREATED_NAME"; /* 创建人名称*/
public static final String COL_CREATED_TIME = "CREATED_TIME"; /* 创建时间*/
public static final String COL_UPDATED_BY = "UPDATED_BY"; /* 更新人*/
public static final String COL_UPDATED_NAME = "UPDATED_NAME"; /* 更新人名称*/
public static final String COL_UPDATED_TIME = "UPDATED_TIME"; /* 更新时间*/
public static final String COL_VERSION = "VERSION"; /* 部门编码*/
public static final String QUERY = "HPKC010.query";
public static final String COUNT = "HPKC010.count";
public static final String INSERT = "HPKC010.insert";
public static final String UPDATE = "HPKC010.update";
public static final String DELETE = "HPKC010.delete";
private Long id = new Long(0);
private String companyCode = " "; /* 企业编码 预留*/
private String whCode = " "; /* 仓库编码*/
// private String whName = " "; /* 仓库名称*/
// private String inventType = " "; /* 物料类型*/
// private String inventCode = " "; /* 物料编码*/
// private String inventName = " "; /* 物料名称*/
private Long inventRecordId = new Long(0); /* 存货档案ID*/
private BigDecimal amount = new BigDecimal(0.00); /* 数量*/
private BigDecimal weight = new BigDecimal(0.00); /* 重量*/
private String createdBy = " "; /* 创建人*/
private String createdName = " "; /* 创建人名称*/
private String createdTime = " "; /* 创建时间*/
private String updatedBy = " "; /* 更新人*/
private String updatedName = " "; /* 更新人名称*/
private String updatedTime = " "; /* 更新时间*/
private Long version = new Long(0); /* 版本号*/
/**
* initialize the metadata.
*/
public void initMetaData() {
EiColumn eiColumn;
eiColumn = new EiColumn(FIELD_ID);
eiColumn.setPrimaryKey(true);
eiColumn.setDescName(" ");
eiMetadata.addMeta(eiColumn);
eiColumn = new EiColumn(FIELD_COMPANY_CODE);
eiColumn.setDescName("企业编码 预留");
eiMetadata.addMeta(eiColumn);
eiColumn = new EiColumn(FIELD_WH_CODE);
eiColumn.setDescName("仓库编码");
eiMetadata.addMeta(eiColumn);
// eiColumn = new EiColumn(FIELD_WH_NAME);
// eiColumn.setDescName("仓库名称");
// eiMetadata.addMeta(eiColumn);
//
// eiColumn = new EiColumn(FIELD_INVENT_TYPE);
// eiColumn.setDescName("存货类型");
// eiMetadata.addMeta(eiColumn);
//
// eiColumn = new EiColumn(FIELD_INVENT_CODE);
// eiColumn.setDescName("存货编码");
// eiMetadata.addMeta(eiColumn);
//
// eiColumn = new EiColumn(FIELD_INVENT_NAME);
// eiColumn.setDescName("存货名称");
// eiMetadata.addMeta(eiColumn);
eiColumn = new EiColumn(FIELD_INVENT_RECORD_ID);
eiColumn.setDescName("存货档案ID");
eiMetadata.addMeta(eiColumn);
eiColumn = new EiColumn(FIELD_AMOUNT);
eiColumn.setType("N");
eiColumn.setScaleLength(2);
eiColumn.setFieldLength(10);
eiColumn.setDescName("数量");
eiMetadata.addMeta(eiColumn);
eiColumn = new EiColumn(FIELD_WEIGHT);
eiColumn.setType("N");
eiColumn.setScaleLength(2);
eiColumn.setFieldLength(10);
eiColumn.setDescName("重量");
eiMetadata.addMeta(eiColumn);
eiColumn = new EiColumn(FIELD_CREATED_BY);
eiColumn.setDescName("创建人");
eiMetadata.addMeta(eiColumn);
eiColumn = new EiColumn(FIELD_CREATED_NAME);
eiColumn.setDescName("创建人名称");
eiMetadata.addMeta(eiColumn);
eiColumn = new EiColumn(FIELD_CREATED_TIME);
eiColumn.setDescName("创建时间");
eiMetadata.addMeta(eiColumn);
eiColumn = new EiColumn(FIELD_UPDATED_BY);
eiColumn.setDescName("更新人");
eiMetadata.addMeta(eiColumn);
eiColumn = new EiColumn(FIELD_UPDATED_NAME);
eiColumn.setDescName("更新人名称");
eiMetadata.addMeta(eiColumn);
eiColumn = new EiColumn(FIELD_UPDATED_TIME);
eiColumn.setDescName("更新时间");
eiMetadata.addMeta(eiColumn);
eiColumn = new EiColumn(FIELD_VERSION);
eiColumn.setDescName("版本号");
eiMetadata.addMeta(eiColumn);
}
/**
* the constructor.
*/
public HPKC010() {
initMetaData();
}
/**
* get the id .
* @return the id
*/
public Long getId() {
return this.id;
}
/**
* set the id .
*
* @param id
*/
public void setId(Long id) {
this.id = id;
}
/**
* get the companyCode - 企业编码 预留.
* @return the companyCode
*/
public String getCompanyCode() {
return this.companyCode;
}
/**
* set the companyCode - 企业编码 预留.
*
* @param companyCode - 企业编码 预留
*/
public void setCompanyCode(String companyCode) {
this.companyCode = companyCode;
}
/**
* get the whCode - 仓库编码.
* @return the whCode
*/
public String getWhCode() {
return this.whCode;
}
/**
* set the whCode - 仓库编码.
*
* @param whCode - 仓库编码
*/
public void setWhCode(String whCode) {
this.whCode = whCode;
}
// /**
// * get the whName - 仓库名称.
// * @return the whName
// */
// public String getWhName() {
// return this.whName;
// }
//
// /**
// * set the whName - 仓库名称.
// *
// * @param whName - 仓库名称
// */
// public void setWhName(String whName) {
// this.whName = whName;
// }
// /**
// * get the matType - 物料类型.
// * @return the matType
// */
// public String getInventType() {
// return this.inventType;
// }
//
// /**
// * set the matType - 物料类型.
// *
// * @param inventType - 物料类型
// */
// public void setInventType(String inventType) {
// this.inventType = inventType;
// }
// /**
// * get the matCode - 物料编码.
// * @return the matCode
// */
// public String getInventCode() {
// return this.inventCode;
// }
//
// /**
// * set the matCode - 物料编码.
// *
// * @param inventCode - 物料编码
// */
// public void setInventCode(String inventCode) {
// this.inventCode = inventCode;
// }
// /**
// * get the matName - 物料名称.
// * @return the matName
// */
// public String getInventName() {
// return this.inventName;
// }
//
// /**
// * set the matName - 物料名称.
// *
// * @param inventName - 物料名称
// */
// public void setInventName(String inventName) {
// this.inventName = inventName;
// }
public Long getInventRecordId() {
return inventRecordId;
}
public void setInventRecordId(Long inventRecordId) {
this.inventRecordId = inventRecordId;
}
public BigDecimal getAmount() {
return amount;
}
public void setAmount(BigDecimal amount) {
this.amount = amount;
}
public BigDecimal getWeight() {
return weight;
}
public void setWeight(BigDecimal weight) {
this.weight = weight;
}
/**
* set the createdBy - 创建人.
*
* @param createdBy - 创建人
*/
public void setCreatedBy(String createdBy) {
this.createdBy = createdBy;
}
/**
* get the createdName - 创建名称.
* @return the createdName
*/
public String getCreatedName() {
return this.createdName;
}
/**
* set the createdName - 创建名称.
*
* @param createdName - 创建名称
*/
public void setCreatedName(String createdName) {
this.createdName = createdName;
}
/**
* get the createdTime - 创建时间.
* @return the createdTime
*/
public String getCreatedTime() {
return this.createdTime;
}
/**
* set the createdTime - 创建时间.
*
* @param createdTime - 创建时间
*/
public void setCreatedTime(String createdTime) {
this.createdTime = createdTime;
}
/**
* get the updatedBy - 更新人.
* @return the updatedBy
*/
public String getUpdatedBy() {
return this.updatedBy;
}
/**
* set the updatedBy - 更新人.
*
* @param updatedBy - 更新人
*/
public void setUpdatedBy(String updatedBy) {
this.updatedBy = updatedBy;
}
/**
* get the updatedName - 更新人名称.
* @return the updatedName
*/
public String getUpdatedName() {
return this.updatedName;
}
/**
* set the updatedName - 更新人名称.
*
* @param updatedName - 更新人名称
*/
public void setUpdatedName(String updatedName) {
this.updatedName = updatedName;
}
/**
* get the updatedTime - 更新时间.
* @return the updatedTime
*/
public String getUpdatedTime() {
return this.updatedTime;
}
/**
* set the updatedTime - 更新时间.
*
* @param updatedTime - 更新时间
*/
public void setUpdatedTime(String updatedTime) {
this.updatedTime = updatedTime;
}
public Long getVersion() {
return version;
}
public void setVersion(Long version) {
this.version = version;
}
/**
* get the value from Map.
*
* @param map - source data map
*/
@Override
public void fromMap(Map map) {
setId(NumberUtils.toLong(StringUtils.toString(map.get(FIELD_ID)), id));
setCompanyCode(StringUtils.defaultIfEmpty(StringUtils.toString(map.get(FIELD_COMPANY_CODE)), companyCode));
setWhCode(StringUtils.defaultIfEmpty(StringUtils.toString(map.get(FIELD_WH_CODE)), whCode));
// setWhName(StringUtils.defaultIfEmpty(StringUtils.toString(map.get(FIELD_WH_NAME)), whName));
// setInventType(StringUtils.defaultIfEmpty(StringUtils.toString(map.get(FIELD_INVENT_TYPE)), inventType));
// setInventCode(StringUtils.defaultIfEmpty(StringUtils.toString(map.get(FIELD_INVENT_CODE)), inventCode));
// setInventName(StringUtils.defaultIfEmpty(StringUtils.toString(map.get(FIELD_INVENT_NAME)), inventName));
setInventRecordId(NumberUtils.toLong(StringUtils.toString(map.get(FIELD_INVENT_RECORD_ID)), id));
setAmount(NumberUtils.toBigDecimal(StringUtils.toString(map.get(FIELD_AMOUNT)), amount));
setWeight(NumberUtils.toBigDecimal(StringUtils.toString(map.get(FIELD_WEIGHT)), weight));
setCreatedBy(StringUtils.defaultIfEmpty(StringUtils.toString(map.get(FIELD_CREATED_BY)), createdBy));
setCreatedName(StringUtils.defaultIfEmpty(StringUtils.toString(map.get(FIELD_CREATED_NAME)), createdName));
setCreatedTime(StringUtils.defaultIfEmpty(StringUtils.toString(map.get(FIELD_CREATED_TIME)), createdTime));
setUpdatedBy(StringUtils.defaultIfEmpty(StringUtils.toString(map.get(FIELD_UPDATED_BY)), updatedBy));
setUpdatedName(StringUtils.defaultIfEmpty(StringUtils.toString(map.get(FIELD_UPDATED_NAME)), updatedName));
setUpdatedTime(StringUtils.defaultIfEmpty(StringUtils.toString(map.get(FIELD_UPDATED_TIME)), updatedTime));
setVersion(NumberUtils.toLong(StringUtils.toString(map.get(FIELD_VERSION)), version));
}
/**
* set the value to Map.
*/
@Override
public Map toMap() {
Map map = new HashMap();
map.put(FIELD_ID, StringUtils.toString(id, eiMetadata.getMeta(FIELD_ID)));
map.put(FIELD_COMPANY_CODE, StringUtils.toString(companyCode, eiMetadata.getMeta(FIELD_COMPANY_CODE)));
map.put(FIELD_WH_CODE, StringUtils.toString(whCode, eiMetadata.getMeta(FIELD_WH_CODE)));
// map.put(FIELD_WH_NAME, StringUtils.toString(whName, eiMetadata.getMeta(FIELD_WH_NAME)));
// map.put(FIELD_INVENT_TYPE, StringUtils.toString(inventType, eiMetadata.getMeta(FIELD_INVENT_TYPE)));
// map.put(FIELD_INVENT_CODE, StringUtils.toString(inventCode, eiMetadata.getMeta(FIELD_INVENT_CODE)));
// map.put(FIELD_INVENT_NAME, StringUtils.toString(inventName, eiMetadata.getMeta(FIELD_INVENT_NAME)));
map.put(FIELD_INVENT_RECORD_ID, StringUtils.toString(inventRecordId, eiMetadata.getMeta(FIELD_INVENT_RECORD_ID)));
map.put(FIELD_AMOUNT, StringUtils.toString(amount, eiMetadata.getMeta(FIELD_AMOUNT)));
map.put(FIELD_WEIGHT, StringUtils.toString(weight, eiMetadata.getMeta(FIELD_WEIGHT)));
map.put(FIELD_CREATED_BY, StringUtils.toString(createdBy, eiMetadata.getMeta(FIELD_CREATED_BY)));
map.put(FIELD_CREATED_NAME, StringUtils.toString(createdName, eiMetadata.getMeta(FIELD_CREATED_NAME)));
map.put(FIELD_CREATED_TIME, StringUtils.toString(createdTime, eiMetadata.getMeta(FIELD_CREATED_TIME)));
map.put(FIELD_UPDATED_BY, StringUtils.toString(updatedBy, eiMetadata.getMeta(FIELD_UPDATED_BY)));
map.put(FIELD_UPDATED_NAME, StringUtils.toString(updatedName, eiMetadata.getMeta(FIELD_UPDATED_NAME)));
map.put(FIELD_UPDATED_TIME, StringUtils.toString(updatedTime, eiMetadata.getMeta(FIELD_UPDATED_TIME)));
map.put(FIELD_VERSION, StringUtils.toString(version, eiMetadata.getMeta(FIELD_VERSION)));
return map;
}
}
......@@ -33,7 +33,7 @@ public class ServiceHPKC001 extends ServiceBase {
public EiInfo initLoad(EiInfo inInfo) {
try {
CommonMethod.initBlock(inInfo, Arrays.asList(DdynamicEnum.WH_RECORD_BLOCK_ID), null);
CommonMethod.initBlock(inInfo, Arrays.asList(DdynamicEnum.WH_RECORD_QUERY_BLOCK_ID), null);
CommonMethod.initBlock(inInfo, Arrays.asList(DdynamicEnum.WH_RECORD_BLOCK_ID), null);
CommonMethod.initBlock(inInfo, Arrays.asList(DdynamicEnum.INVENT_NAME_BLOCK_ID), null);
CommonMethod.initBlock(inInfo, Arrays.asList(DdynamicEnum.INVENT_SPEC_BLOCK_ID), null);
inInfo.addBlock(EiConstant.resultBlock).addBlockMeta(new HPKC001().eiMetadata);
......
......@@ -32,7 +32,7 @@ public class ServiceHPKC002 extends ServiceBase {
public EiInfo initLoad(EiInfo inInfo) {
try {
CommonMethod.initBlock(inInfo, Arrays.asList(DdynamicEnum.WH_RECORD_BLOCK_ID), null);
CommonMethod.initBlock(inInfo, Arrays.asList(DdynamicEnum.WH_RECORD_QUERY_BLOCK_ID), null);
CommonMethod.initBlock(inInfo, Arrays.asList(DdynamicEnum.WH_RECORD_BLOCK_ID), null);
CommonMethod.initBlock(inInfo, Arrays.asList(DdynamicEnum.INVENT_NAME_BLOCK_ID), null);
CommonMethod.initBlock(inInfo, Arrays.asList(DdynamicEnum.INVENT_SPEC_BLOCK_ID), null);
inInfo.addBlock(EiConstant.resultBlock).addBlockMeta(new HPKC002().eiMetadata);
......
......@@ -36,7 +36,7 @@ public class ServiceHPKC003 extends ServiceBase {
*/
public EiInfo initLoad(EiInfo inInfo) {
try {
CommonMethod.initBlock(inInfo, Arrays.asList(DdynamicEnum.WH_RECORD_QUERY_BLOCK_ID), null);
CommonMethod.initBlock(inInfo, Arrays.asList(DdynamicEnum.WH_RECORD_BLOCK_ID), null);
CommonMethod.initBlock(inInfo, Arrays.asList(DdynamicEnum.INVENT_NAME_BLOCK_ID), null);
inInfo.addBlock(EiConstant.resultBlock).addBlockMeta(new HPKC003().eiMetadata);
} catch (Exception e) {
......
......@@ -34,7 +34,7 @@ public class ServiceHPKC004 extends ServiceBase {
*/
public EiInfo initLoad(EiInfo inInfo) {
try {
CommonMethod.initBlock(inInfo, Arrays.asList(DdynamicEnum.WH_RECORD_QUERY_BLOCK_ID), null);
CommonMethod.initBlock(inInfo, Arrays.asList(DdynamicEnum.WH_RECORD_BLOCK_ID), null);
CommonMethod.initBlock(inInfo, Arrays.asList(DdynamicEnum.INVENT_NAME_BLOCK_ID), null);
inInfo.addBlock(EiConstant.resultBlock).addBlockMeta(new HPKC004().eiMetadata);
} catch (Exception e) {
......
......@@ -41,7 +41,7 @@ public class ServiceHPKC005 extends ServiceBase {
outInfo.addBlock(EiConstant.queryBlock).setCell(0, "receiptDate", CommonMethod.getCurrentSameYearMonth());
outInfo.getBlock(EiConstant.resultBlock).getRows().clear();
CommonMethod.initBlock(outInfo, Arrays.asList(DdynamicEnum.WH_RECORD_BLOCK_ID), null);
CommonMethod.initBlock(outInfo, Arrays.asList(DdynamicEnum.WH_RECORD_QUERY_BLOCK_ID), null);
CommonMethod.initBlock(outInfo, Arrays.asList(DdynamicEnum.WH_RECORD_BLOCK_ID), null);
CommonMethod.initBlock(outInfo, Arrays.asList(DdynamicEnum.MATERIAL_RECORD_BLOCK_ID), null);
CommonMethod.initBlock(outInfo, Arrays.asList(DdynamicEnum.INVENT_SPEC_BLOCK_ID), null);
CommonMethod.initBlock(outInfo, Arrays.asList(DdynamicEnum.SPEC_NAME_BLOCK_ID), null, false);
......
......@@ -55,7 +55,7 @@ public class ServiceHPKC009 extends ServiceBase {
*/
public EiInfo initLoad(EiInfo inInfo) {
try {
CommonMethod.initBlock(inInfo, Arrays.asList(DdynamicEnum.WH_RECORD_QUERY_BLOCK_ID), null);
CommonMethod.initBlock(inInfo, Arrays.asList(DdynamicEnum.WH_RECORD_BLOCK_ID), null);
CommonMethod.initBlock(inInfo, Arrays.asList(DdynamicEnum.INVENT_NAME_BLOCK_ID), null);
inInfo.addBlock(EiConstant.resultBlock).addBlockMeta(new HPKC009().eiMetadata);
} catch (PlatException e) {
......
package com.baosight.hpjx.hp.kc.service;
import com.baosight.hpjx.common.DdynamicEnum;
import com.baosight.hpjx.core.dao.DaoUtils;
import com.baosight.hpjx.hp.kc.domain.HPKC010;
import com.baosight.hpjx.hp.pz.tools.HPPZTools;
import com.baosight.hpjx.util.*;
import com.baosight.iplat4j.core.ei.EiBlock;
import com.baosight.iplat4j.core.ei.EiConstant;
import com.baosight.iplat4j.core.ei.EiInfo;
import com.baosight.iplat4j.core.exception.PlatException;
import com.baosight.iplat4j.core.service.impl.ServiceBase;
import com.baosight.iplat4j.core.util.DateUtils;
import com.baosight.iplat4j.core.web.threadlocal.UserSession;
import org.apache.commons.collections.CollectionUtils;
import org.apache.commons.collections.MapUtils;
import org.apache.commons.lang.StringUtils;
import java.math.BigDecimal;
import java.util.*;
/**
*
* @author:wwl
* @date:2024/1/23,10:51
*/
public class ServiceHPKC010 extends ServiceBase {
/**
* 画面初始化
*
* @param inInfo
* @return
*/
public EiInfo initLoad(EiInfo inInfo) {
HPKC010 HPKC010 = new HPKC010();
EiInfo outInfo = super.initLoad(inInfo, HPKC010);
outInfo.getBlock(EiConstant.resultBlock).getRows().clear();
CommonMethod.initBlock(outInfo, Arrays.asList(DdynamicEnum.WH_RECORD_BLOCK_ID), null);
CommonMethod.initBlock(outInfo, Arrays.asList(DdynamicEnum.INVENT_ALL_BLOCK_ID), null,false);
return outInfo;
}
/**
* 查询操作.
*/
@Override
public EiInfo query(EiInfo inInfo) {
try {
inInfo = super.query(inInfo, "HPKC010.query", new HPKC010());
} catch (Exception e) {
LogUtils.setDetailMsg(inInfo, e, "查询失败");
}
return inInfo;
}
/**
* 保存操作.
*
* @param inInfo
* @return
*/
public EiInfo save(EiInfo inInfo) {
try {
List<Map> resultRows = inInfo.getBlock(EiConstant.resultBlock).getRows();
// 数据校验
this.checkSaveData(resultRows);
// 写入数据
for (int i = 0; i < resultRows.size(); i++) {
HPKC010 fKc010 = new HPKC010();
fKc010.fromMap(resultRows.get(i));
// 设置基础信息
if (fKc010.getId() == null || fKc010.getId() == 0) {
this.add(fKc010);
} else {
this.modify(fKc010);
}
}
inInfo = this.query(inInfo);
inInfo.setStatus(EiConstant.STATUS_DEFAULT);
inInfo.setMsg("操作成功!本次对[" + resultRows.size() + "]条数据保存成功!");
} catch (Exception e) {
LogUtils.setDetailMsg(inInfo, e, "保存失败");
}
return inInfo;
}
/**
* 校验保存的数据
*
* @param resultRows
*/
private void checkSaveData(List<Map> resultRows) {
for (int i = 0; i < resultRows.size(); i++) {
HPKC010 fKc010 = new HPKC010();
fKc010.fromMap(resultRows.get(i));
AssertUtils.isEmpty(fKc010.getWhCode(), "仓库名称不能为空");
AssertUtils.isNull(fKc010.getInventRecordId(), "存货名称不能为空");
}
}
/**
* 新增
*
* @param fKc010
*/
private void add(HPKC010 fKc010) {
DaoUtils.insert("HPKC010.insert", fKc010);
}
/**
* 修改数据
*
* @param fKc010
*/
private void modify(HPKC010 fKc010) {
DaoUtils.update("HPKC010.update", fKc010);
}
/**
* 新增操作.
*/
@Override
public EiInfo insert(EiInfo inInfo) {
try {
CommonMethod.creatorInfo(inInfo, EiConstant.resultBlock);
List<Map> resultRows = inInfo.getBlock(EiConstant.resultBlock).getRows();
for (int i = 0; i < resultRows.size(); i++) {
HPKC010 fKc010 = new HPKC010();
fKc010.fromMap(resultRows.get(i));
// 设置基础信息
DaoUtils.insert(HPKC010.INSERT, fKc010);
}
inInfo.setMsg("操作成功!本次对[" + resultRows.size() + "]条数据新增成功!");
} catch (Exception e) {
LogUtils.setDetailMsg(inInfo, e, "新增失败");
}
return inInfo;
}
/**
* 修改操作
*
* @param inInfo
* @return
*/
public EiInfo update(EiInfo inInfo) {
try {
EiBlock eiBlock = inInfo.getBlock(EiConstant.resultBlock);
for (int i = 0; i < eiBlock.getRowCount(); i++) {
HPKC010 fKc010 = new HPKC010();
fKc010.fromMap(eiBlock.getRow(i));
DaoUtils.update(HPKC010.UPDATE, fKc010);
}
inInfo = this.query(inInfo);
inInfo.setStatus(EiConstant.STATUS_SUCCESS);
inInfo.setMsg("修改成功!");
} catch (PlatException e) {
LogUtils.setDetailMsg(inInfo, e, "修改失败");
}
return inInfo;
}
/**
* 更新库存
* @param companyCode 企业编码
* @param whCode 仓库编码
* @param inventRecordId 存货档案ID
* @param amout 数量
* @param weight 重量
* @return
*/
public EiInfo updateStock(String companyCode, String whCode, Long inventRecordId
, BigDecimal amout, BigDecimal weight){
EiInfo inInfo = new EiInfo();
try {
checkUpdateStockParam(companyCode,whCode,inventRecordId,amout,weight);
HPKC010 newObj = generatorBaseInfo(companyCode,whCode,inventRecordId,amout,weight);
List<Map> list = dao.query("queryByCondition",new HashMap<String,Object>(){{
put("companyCode",companyCode);
put("whCode",whCode);
put("inventRecordId",inventRecordId);
}});
if(CollectionUtils.isEmpty(list)){
//新增
if(Objects.isNull(amout)||amout.compareTo(BigDecimal.ZERO)<=0
||Objects.isNull(amout)||weight.compareTo(BigDecimal.ZERO)<=0){
throw new PlatException("当前库存为空,库存变更数量与重量不能小于等于0!");
}
DaoUtils.insert("insert",newObj);
}else{
//修改
HPKC010 oldObj = new HPKC010();
oldObj.fromMap(list.get(0));
BigDecimal afterAmout = oldObj.getAmount().add(amout);
BigDecimal afterWeight = oldObj.getWeight().add(weight);
if(afterAmout.compareTo(BigDecimal.ZERO)<=0||afterWeight.compareTo(BigDecimal.ZERO)<=0){
throw new PlatException("库存更新失败,出库数量与重量不能大于当前库存!");
}
oldObj.setAmount(afterAmout);
oldObj.setWeight(afterWeight);
oldObj.setUpdatedBy(newObj.getUpdatedBy());
oldObj.setUpdatedName(newObj.getUpdatedName());
oldObj.setUpdatedTime(newObj.getUpdatedTime());
int result = DaoUtils.update("updateStock",oldObj);
if(result!=1){
throw new PlatException("库存更新失败,库存已发生变更或系统异常,请重试!");
}
}
inInfo.setStatus(EiConstant.STATUS_SUCCESS);
inInfo.setMsg("库存更新成功!");
} catch (PlatException e) {
LogUtils.setDetailMsg(inInfo, e, "库存更新失败!");
}
return inInfo;
}
/**
* 生成库存对象
* @param companyCode
* @param whCode
* @param inventRecordId
* @param amout
* @param weight
* @reutrn HPKC010
*/
private HPKC010 generatorBaseInfo(String companyCode, String whCode, Long inventRecordId, BigDecimal amout, BigDecimal weight) {
HPKC010 hpkc010 = new HPKC010();
hpkc010.setCompanyCode(companyCode);
hpkc010.setWhCode(whCode);
hpkc010.setInventRecordId(inventRecordId);
hpkc010.setAmount(amout);
hpkc010.setWeight(weight);
String userId = UserSession.getLoginName();
String userName = UserSession.getLoginCName();
String time = DateUtils.curDateTimeStr14();
hpkc010.setCreatedBy(userId);
hpkc010.setCreatedName(userName);
hpkc010.setCreatedTime(time);
hpkc010.setUpdatedBy(userId);
hpkc010.setUpdatedName(userName);
hpkc010.setUpdatedTime(time);
return hpkc010;
}
/**
* 校验库存变更请求参数
* @param companyCode
* @param whCode
* @param inventRecordId
* @param amout
* @param weight
*/
private void checkUpdateStockParam(String companyCode, String whCode, Long inventRecordId
, BigDecimal amout, BigDecimal weight){
if(StringUtils.isBlank(companyCode)){
throw new PlatException("企业编码不能为空!");
}
if(StringUtils.isBlank(whCode)){
throw new PlatException("仓库编码不能为空!");
}
if(Objects.isNull(inventRecordId)||inventRecordId==0){
throw new PlatException("存货档案ID不能为空!");
}
if(Objects.isNull(amout)||amout.compareTo(BigDecimal.ZERO)==0){
throw new PlatException("库存变更数量不能为空!");
}
if(Objects.isNull(amout)||weight.compareTo(BigDecimal.ZERO)==0){
throw new PlatException("库存变更重量不能为空!");
}
}
/**
* 删除操作
*
* @param inInfo
* @return
*/
public EiInfo delete(EiInfo inInfo) {
try {
List<Map> resultRows = inInfo.getBlock(EiConstant.resultBlock).getRows();
for (int i = 0; i < resultRows.size(); i++) {
DaoUtils.update(HPKC010.DELETE, resultRows.get(i));
}
inInfo = this.query(inInfo);
inInfo.setStatus(EiConstant.STATUS_DEFAULT);
inInfo.setMsg("操作成功!本次对[" + resultRows.size() + "]条数据删除成功!");
} catch (Exception e) {
LogUtils.setDetailMsg(inInfo, e, "删除失败");
}
return inInfo;
}
}
<?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">
<sqlMap namespace="HPKC010">
<sql id="column">
ID as "id",
COMPANY_CODE as "companyCode", <!-- 企业编码 预留 -->
WH_CODE as "whCode", <!-- 仓库编码 -->
<!-- WH_NAME as "whName", &lt;!&ndash; 仓库名称 &ndash;&gt;-->
<!-- INVENT_TYPE as "inventType", &lt;!&ndash; 物料类型 &ndash;&gt;-->
<!-- INVENT_CODE as "inventCode", &lt;!&ndash; 物料编码 &ndash;&gt;-->
<!-- INVENT_NAME as "inventName", &lt;!&ndash; 物料名称 &ndash;&gt;-->
INVENT_RECORD_ID as "inventRecordId", <!-- 存货档案ID -->
AMOUNT as "amount", <!-- 数量 -->
WEIGHT as "weight", <!-- 重量 -->
CREATED_BY as "createdBy", <!-- 创建人 -->
CREATED_TIME as "createdTime", <!-- 创建时间 -->
UPDATED_BY as "updatedBy", <!-- 更新人 -->
UPDATED_TIME as "updatedTime", <!-- 更新时间 -->
VERSION as "version"
</sql>
<sql id="condition">
<isNotEmpty prepend=" AND " property="id">
ID = #id#
</isNotEmpty>
<isNotEmpty prepend=" AND " property="inventRecordId">
INVENT_RECORD_ID = #inventRecordId#
</isNotEmpty>
<isNotEmpty prepend=" AND " property="companyCode">
COMPANY_CODE = #companyCode#
</isNotEmpty>
<isNotEmpty prepend=" AND " property="whCode">
WH_CODE = #whCode#
</isNotEmpty>
<isNotEmpty prepend=" AND " property="whName">
WH_NAME LIKE '%' || #whName# || '%'
</isNotEmpty>
<isNotEmpty prepend=" AND " property="inventType">
INVENT_TYPE = #inventType#
</isNotEmpty>
<isNotEmpty prepend=" AND " property="inventCode">
INVENT_CODE = #inventCode#
</isNotEmpty>
<isNotEmpty prepend=" AND " property="inventName">
INVENT_NAME = #inventName#
</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="version">
VERSION = #version#
</isNotEmpty>
</sql>
<select id="query" resultClass="com.baosight.hpjx.hp.kc.domain.HPKC010">
SELECT <include refid="column"/>
FROM hpjx.T_HPKC010
WHERE 1=1
<include refid="condition"/>
<dynamic prepend="ORDER BY">
<isNotEmpty property="orderBy">
$orderBy$
</isNotEmpty>
<isEmpty property="orderBy">
ID DESC
</isEmpty>
</dynamic>
</select>
<select id="queryByCondition" resultClass="java.util.HashMap">
SELECT <include refid="column"/>
FROM hpjx.T_HPKC010
WHERE 1=1
<include refid="condition"/>
</select>
<select id="count" resultClass="int">
SELECT COUNT(*) FROM hpjx.T_HPKC010
WHERE 1=1
<include refid="condition"/>
</select>
<!-- 查询统计 -->
<select id="querySum" resultClass="com.baosight.hpjx.hp.kc.domain.HPKC010">
SELECT
COALESCE(SUM(AMOUNT), 0) AS "amount", <!-- 数量 -->
COALESCE(SUM(WEIGHT), 0) AS "weight" <!-- 重量 -->
FROM ${hpjxSchema}.T_HPKC010
WHERE 1=1
<include refid="condition"/>
</select>
<insert id="insert">
INSERT INTO hpjx.T_HPKC010 (
COMPANY_CODE, <!-- 企业编码 预留 -->
WH_CODE, <!-- 仓库编码 -->
WH_NAME, <!-- 仓库名称 -->
INVENT_TYPE, <!-- 物料类型 -->
INVENT_CODE, <!-- 物料编码 -->
INVENT_NAME, <!-- 物料名称 -->
INVENT_RECORD_ID, <!-- 存货档案ID -->
AMOUNT, <!-- 数量 -->
WEIGHT, <!-- 重量 -->
CREATED_BY, <!-- 创建人 -->
CREATED_TIME, <!-- 创建时间 -->
UPDATED_BY, <!-- 更新人 -->
UPDATED_TIME, <!-- 更新时间 -->
VERSION
) VALUES (
#companyCode#, #whCode#, #whName#, #inventType#,
#inventCode#, #inventName#, #inventRecordId#, #amount#, #weight#,
#createdBy#, #createdTime#, #updatedBy#,
#updatedTime#, #version#
)
</insert>
<delete id="delete">
DELETE FROM hpjx.T_HPKC010 WHERE ID = #id#
</delete>
<update id="update">
UPDATE hpjx.T_HPKC010
SET
WH_CODE = #whCode#, <!-- 仓库编码 -->
WH_NAME = #whName#, <!-- 仓库名称 -->
INVENT_TYPE = #inventType#, <!-- 物料类型 -->
INVENT_CODE = #inventCode#, <!-- 物料编码 -->
INVENT_NAME = #inventName#, <!-- 物料名称 -->
INVENT_RECORD_ID = #inventRecordId#, <!-- 存货档案ID -->
AMOUNT = #amount#, <!-- 数量 -->
WEIGHT = #weight#, <!-- 重量 -->
UPDATED_BY = #updatedBy#, <!-- 更新人 -->
UPDATED_TIME = #updatedTime#, <!-- 更新时间 -->
VERSION = #version#
WHERE ID = #id#
</update>
<update id="updateStock">
UPDATE hpjx.T_HPKC010
SET
AMOUNT = #amount#, <!-- 数量 -->
WEIGHT = #weight#, <!-- 重量 -->
UPDATED_BY = #updatedBy#, <!-- 更新人 -->
UPDATED_NAME = #updatedName#, <!-- 更新人 -->
UPDATED_TIME = #updatedTime#, <!-- 更新时间 -->
VERSION = CURRENT_TIMESTAMP(3)
WHERE ID = #id#
AND VERSION = #version#
</update>
</sqlMap>
......@@ -178,4 +178,20 @@ public class ServiceHPPZ006 extends ServiceBase {
return eiInfo;
}
/**
* 下拉框
*
* @param inInfo
* @return
*/
public EiInfo queryComboBoxAll(EiInfo inInfo) {
try {
List<DdynamicEnum> list = new ArrayList<>();
list.add(DdynamicEnum.INVENT_ALL_BLOCK_ID);
CommonMethod.initBlock(inInfo, list, EiInfoUtils.getFirstRow(inInfo), false);
} catch (Exception e) {
LogUtils.setDetailMsg(inInfo, e, "查询规格失败");
}
return inInfo;
}
}
......@@ -196,4 +196,26 @@
ORDER BY SPEC DESC
</select>
<!-- 缺省下拉框 -->
<select id="queryComboBoxAll" parameterClass="java.util.HashMap" resultClass="java.util.HashMap">
SELECT DISTINCT
ID AS "id",
INVENT_TYPE AS "inventType",
CONCAT(INVENT_CODE,'-',INVENT_NAME) AS "inventName",
(CASE WHEN SPEC = '' THEN '无规格' ELSE SPEC END) AS "spec",
MATERIAL AS "material" , <!-- 材质 -->
UNIT AS "unit" <!-- 单位 -->
FROM hpjx.t_hppz006 WHERE STATUS=1
<isNotEmpty prepend=" AND " property="companyCode">
COMPANY_CODE = #companyCode#
</isNotEmpty>
<isNotEmpty prepend=" AND " property="inventCode">
INVENT_CODE = #inventCode#
</isNotEmpty>
<isNotEmpty prepend=" AND " property="inventType">
INVENT_TYPE = #inventType#
</isNotEmpty>
ORDER BY ID
</select>
</sqlMap>
package com.baosight.hpjx.hp.sc.domain;
\ No newline at end of file
package com.baosight.hpjx.hp.sc.service;
\ No newline at end of file
package com.baosight.hpjx.hp.sc.sql;
\ No newline at end of file
......@@ -71,8 +71,19 @@ public class CommonMethod {
row.put(HPConstants.VALUE_FIELD, String.valueOf(tryValue.get(tableParam.getValue())));
if(isSplicingSymbol) {
row.put(HPConstants.TEXT_FIELD, (tryValue.get(tableParam.getValue()) + HPConstants.SPLICING_SYMBOL + tryValue.get(tableParam.getText())));
row.put(HPConstants.PARAM1_FIELD, (tryValue.get(tableParam.getValue()) + HPConstants.SPLICING_SYMBOL + tryValue.get(tableParam.getParam1())));
row.put(HPConstants.PARAM2_FIELD, (tryValue.get(tableParam.getValue()) + HPConstants.SPLICING_SYMBOL + tryValue.get(tableParam.getParam2())));
row.put(HPConstants.PARAM3_FIELD, (tryValue.get(tableParam.getValue()) + HPConstants.SPLICING_SYMBOL + tryValue.get(tableParam.getParam3())));
row.put(HPConstants.PARAM4_FIELD, (tryValue.get(tableParam.getValue()) + HPConstants.SPLICING_SYMBOL + tryValue.get(tableParam.getParam4())));
row.put(HPConstants.PARAM5_FIELD, (tryValue.get(tableParam.getValue()) + HPConstants.SPLICING_SYMBOL + tryValue.get(tableParam.getParam5())));
}else{
row.put(HPConstants.TEXT_FIELD, String.valueOf(tryValue.get(tableParam.getText())));
row.put(HPConstants.PARAM1_FIELD, String.valueOf(tryValue.get(tableParam.getParam1())));
row.put(HPConstants.PARAM2_FIELD, String.valueOf(tryValue.get(tableParam.getParam2())));
row.put(HPConstants.PARAM3_FIELD, String.valueOf(tryValue.get(tableParam.getParam3())));
row.put(HPConstants.PARAM4_FIELD, String.valueOf(tryValue.get(tableParam.getParam4())));
row.put(HPConstants.PARAM5_FIELD, String.valueOf(tryValue.get(tableParam.getParam5())));
}
eiBlock.addRow(row);
}
......
......@@ -38,7 +38,7 @@ public class ACConstants {
*/
public static final String WH_CODE_BLOCK_ID = "wh_record_block_id";
public static final String WH_CODE_QUERY_BLOCK_ID = "whName_block_id";
public static final String WH_CODE_QUERY_BLOCK_ID = "wh_record_block_id";
......
package com.baosight.iplat4j.hp.kc.domain;
\ No newline at end of file
......@@ -20,7 +20,7 @@
required="false" defultValue="ALL"
template="#=textField#">
<EF:EFOption label="请选择" value=""></EF:EFOption>
<EF:EFOptions blockId="whName_block_id" textField="textField" valueField="valueField"/>
<EF:EFOptions blockId="wh_record_block_id" textField="textField" valueField="valueField"/>
</EF:EFSelect>
<EF:EFSelect ename="inqu_status-0-materialCode" cname="物料名称"
valueTemplate="#=textField#" filter="contains"
......
......@@ -20,7 +20,7 @@
required="false" defultValue="ALL"
template="#=textField#">
<EF:EFOption label="请选择" value=""></EF:EFOption>
<EF:EFOptions blockId="whName_block_id" textField="textField" valueField="valueField"/>
<EF:EFOptions blockId="wh_record_block_id" textField="textField" valueField="valueField"/>
</EF:EFSelect>
<EF:EFSelect ename="inqu_status-0-materialCode" cname="物料名称"
valueTemplate="#=textField#" filter="contains"
......
......@@ -13,7 +13,7 @@
<EF:EFInput ename="inqu_status-0-prodNo" cname="生产入库单号" colWidth="3"/>
<EF:EFSelect ename="inqu_status-0-whCode" cname="仓库名称" colWidth="3" filter="contains" defultValue="">
<EF:EFOption label="请选择" value=""/>
<EF:EFOptions blockId="whName_block_id" textField="textField" valueField="valueField"/>
<EF:EFOptions blockId="wh_record_block_id" textField="textField" valueField="valueField"/>
</EF:EFSelect>
<EF:EFSelect ename="inqu_status-0-inventCode" cname="存货名称" colWidth="3" filter="contains" defultValue="">
<EF:EFOption label="请选择" value=""/>
......@@ -29,7 +29,7 @@
<EF:EFColumn ename="documentDate" cname="单据日期" width="100" align="center" editType="date"
dateFormat="yyyy-MM-dd" parseFormats="['yyyyMMdd']" required="true"/>
<EF:EFComboColumn cname="仓库名称" ename="whCode" columnTemplate="#=textField#"
itemTemplate="#=textField#" blockName="whName_block_id"
itemTemplate="#=textField#" blockName="wh_record_block_id"
textField="textField" valueField="valueField"
align="center" filter="contains" width="100">
</EF:EFComboColumn>
......
......@@ -13,7 +13,7 @@
<EF:EFInput ename="inqu_status-0-saleNo" cname="生产销售单号" colWidth="3"/>
<EF:EFSelect ename="inqu_status-0-whCode" cname="仓库名称" colWidth="3" filter="contains" defultValue="">
<EF:EFOption label="请选择" value=""/>
<EF:EFOptions blockId="whName_block_id" textField="textField" valueField="valueField"/>
<EF:EFOptions blockId="wh_record_block_id" textField="textField" valueField="valueField"/>
</EF:EFSelect>
<EF:EFSelect ename="inqu_status-0-inventCode" cname="存货名称" colWidth="3" filter="contains" defultValue="">
<EF:EFOption label="请选择" value=""/>
......@@ -29,7 +29,7 @@
<EF:EFColumn ename="receiptDate" cname="单据日期" width="100" align="center" editType="date"
dateFormat="yyyy-MM-dd" parseFormats="['yyyyMMdd']" required="true"/>
<EF:EFComboColumn cname="仓库名称" ename="whCode" columnTemplate="#=textField#"
itemTemplate="#=textField#" blockName="whName_block_id"
itemTemplate="#=textField#" blockName="wh_record_block_id"
textField="textField" valueField="valueField"
align="center" filter="contains" width="120">
</EF:EFComboColumn>
......
......@@ -12,7 +12,7 @@
role="date" format="yyyy-MM-dd" readonly="true"/>
<EF:EFSelect ename="inqu_status-0-whCode" cname="仓库名称" colWidth="3" filter="contains" defultValue="">
<EF:EFOption label="全部" value=""/>
<EF:EFOptions blockId="whName_block_id" textField="textField" valueField="valueField"/>
<EF:EFOptions blockId="wh_record_block_id" textField="textField" valueField="valueField"/>
</EF:EFSelect>
<EF:EFSelect ename="inqu_status-0-inventType" cname="存货类型" colWidth="3" filter="contains"
template="#=valueField#-#=textField#" valueTemplate="#=valueField#-#=textField#">
......
......@@ -16,7 +16,7 @@
</EF:EFSelect>
<EF:EFSelect ename="inqu_status-0-whCode" cname="仓库名称" filter="contains" defultValue="">
<EF:EFOption label="请选择" value=""/>
<EF:EFOptions blockId="whName_block_id" textField="textField" valueField="valueField"/>
<EF:EFOptions blockId="wh_record_block_id" textField="textField" valueField="valueField"/>
</EF:EFSelect>
</div>
</EF:EFRegion>
......@@ -29,7 +29,7 @@
</EF:EFComboColumn>
<EF:EFColumn cname="日期" ename="dateProc" enable="false" width="90" align="center"/>
<EF:EFComboColumn cname="仓库名称" ename="whCode" enable="false" columnTemplate="#=textField#"
itemTemplate="#=textField#" blockName="whName_block_id"
itemTemplate="#=textField#" blockName="wh_record_block_id"
textField="textField" valueField="valueField"
align="center" filter="contains" width="100">
</EF:EFComboColumn>
......
var inventNameGlobalData = [];
var specGlobalData = [];
$(function() {
// 查询
$("#QUERY").on("click", query);
// 保存
$("#BTN_SAVE").on("click", save);
IPLATUI.EFGrid = {
"result": {
loadComplete: function (grid) {
//删除
$("#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($("#HPKC010"), "HPKC010", "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) {
// 发生异常
console.log(ei);
//释放禁用按钮
btnNode.attr("disabled", false);
}
});
});
}
},
};
});
/**
* 页面加载时执行
*/
$(window).load(function () {
// let eiInfo = new EiInfo();
// // 规格
// EiCommunicator.send("HPPZ006", "queryComboBoxAll", eiInfo, {
// onSuccess: function (ei) {
// specGlobalData = ei.getBlock("invent_all_block_id").getMappedRows();
// },
// onFail: function (ei) {
// }
// }, {async: false});
// 查询
query();
});
/**
* 查询
*/
let query = function () {
resultGrid.dataSource.page(1); // 点击查询按钮,从第1页开始查询
}
/**
* 保存
*/
let save = function () {
let rows = resultGrid.getCheckedRows();
if (rows.length < 1) {
message("请选择数据");
return;
}
JSUtils.confirm("确定对勾选中的[" + rows.length + "]条数据做\"保存\"操作? ", {
ok: function () {
JSUtils.submitGridsData("result", "HPKC010", "save", true);
}
});
}
<!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="单据日期"
role="date" format="yyyy-MM-dd" readonly="true"/>
<EF:EFSelect ename="inqu_status-0-inventType" cname="存货类型" filter="contains" defaultValue="">
<EF:EFOption label="请选择" value=""/>
<EF:EFCodeOption codeName="hpjx.hpkc.inventType"/>
</EF:EFSelect>
<EF:EFSelect ename="inqu_status-0-whCode" cname="仓库名称" filter="contains" defultValue="">
<EF:EFOption label="请选择" value=""/>
<EF:EFOptions blockId="wh_record_block_id" textField="textField" valueField="valueField"/>
</EF:EFSelect>
</div>
</EF:EFRegion>
<EF:EFRegion id="result" title="明细信息">
<EF:EFGrid blockId="result" autoDraw="override" isFloat="true" checkMode="row">
<EF:EFColumn ename="id" cname="内码" hidden="true"/>
<EF:EFColumn ename="inventRecordId" cname="存货档案ID" hidden="true"/>
<EF:EFComboColumn ename="whCode" cname="仓库编码" width="120" columnTemplate="#=textField#"
itemTemplate="#=textField#" blockName="wh_record_block_id"
textField="textField" valueField="valueField"
align="center" filter="contains">
</EF:EFComboColumn>
<EF:EFComboColumn ename="inventType" cname="存货类型" width="120" columnTemplate="#=textField#"
itemTemplate="#=textField#" blockName="invent_all_block_id"
textField="textField" valueField="valueField"
align="center" filter="contains">
</EF:EFComboColumn>
<EF:EFComboColumn ename="inventCode" cname="存货名称" width="120" columnTemplate="#=param1Field#"
itemTemplate="#=param1Field#" blockName="invent_all_block_id"
textField="param1Field" valueField="valueField"
align="center" filter="contains">
</EF:EFComboColumn>
<EF:EFComboColumn ename="spec" cname="规格" width="120" columnTemplate="#=param2Field#"
itemTemplate="#=param2Field#" blockName="invent_all_block_id"
textField="param2Field" valueField="valueField"
align="center" filter="contains">
</EF:EFComboColumn>
<EF:EFComboColumn ename="material" cname="材质" width="120" columnTemplate="#=param3Field#"
itemTemplate="#=param3Field#" blockName="invent_all_block_id"
textField="param3Field" valueField="valueField"
align="center" filter="contains">
</EF:EFComboColumn>
<EF:EFComboColumn ename="unit" cname="单位" width="120" columnTemplate="#=param4Field#"
itemTemplate="#=param4Field#" blockName="invent_all_block_id"
textField="param4Field" valueField="valueField"
align="center" filter="contains">
</EF:EFComboColumn>
<EF:EFColumn ename="amount" cname="数量" format="{0:N3}" maxLength="20" width="90" align="right"/>
<EF:EFColumn ename="weight" cname="重量" format="{0:N3}" maxLength="20" width="90" align="right"/>
<EF:EFColumn ename="createdBy" cname="创建人" enable="false" width="100" align="center"/>
<EF:EFColumn ename="createdTime" cname="创建时刻" enable="false" width="140" align="center"
editType="datetime" parseFormats="['yyyyMMddHHmmss']"/>
<EF:EFColumn ename="updatedBy" cname="更新人" enable="false" width="100" align="center"/>
<EF:EFColumn ename="updatedTime" cname="更新时刻" enable="false" width="140" align="center"
editType="datetime" parseFormats="['yyyyMMddHHmmss']"/>
</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