Commit da0de78c by yukang

Merge branch 'dev' of https://gitlab.baocloud.cn/bggf/smart/hp-smart into dev

parents 8bd0cbe5 15b4e566
...@@ -58,6 +58,10 @@ public enum InventTypeEnum { ...@@ -58,6 +58,10 @@ public enum InventTypeEnum {
this.value = value; this.value = value;
} }
public static Integer[] getProdTypes(){
return new Integer[]{SEMI_FINISHED_PRODUCT.code,FINISHED_PRODUCT.code};
}
public static EiBlock generatorEiBlock() { public static EiBlock generatorEiBlock() {
EiBlock block = new EiBlock("customer_type_block_id"); EiBlock block = new EiBlock("customer_type_block_id");
List<Map<String, Object>> rows = new ArrayList<Map<String, Object>>() {{ List<Map<String, Object>> rows = new ArrayList<Map<String, Object>>() {{
......
...@@ -163,6 +163,18 @@ public class HPSqlConstant { ...@@ -163,6 +163,18 @@ public class HPSqlConstant {
} }
/** /**
* HPKC011 SQL 定义
*
* @author:songx
* @date:2024/1/20,16:45
*/
public class HPKC011 {
// 锁
public static final String LOCK = "HPKC011.lock";
}
/**
* HPPZ010 SQL 定义 * HPPZ010 SQL 定义
* *
* @author:songx * @author:songx
......
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:THpkc010.java <br>
* Description: <br>
*
* Copyrigth:Baosight Software LTD.co Copyright (c) 2019. <br>
*
* @version 1.0
* @history 2024-01-25 17:57:24 create
*/
public class HPKC011 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_DEP_CODE = "depCode"; /* 部门编码*/
public static final String FIELD_WH_CODE = "whCode"; /* 仓库编码*/
public static final String FIELD_WH_NAME = "whName"; /* 仓库名称*/
public static final String FIELD_PROD_NO = "prodNo"; /* 生产单号*/
public static final String FIELD_PROJ_CODE = "projCode"; /* 项目编码*/
public static final String FIELD_PROJ_NAME = "projName"; /* 项目名称*/
public static final String FIELD_INVENT_CODE = "inventCode"; /* 部件编码*/
public static final String FIELD_INVENT_NAME = "inventName"; /* 部件名称*/
public static final String FIELD_SUB_INVENT_CODE = "subInventCode"; /* 零部件编码*/
public static final String FIELD_SUB_INVENT_NAME = "subInventName"; /* 零部件名称*/
public static final String FIELD_LENGTH = "length"; /* 长*/
public static final String FIELD_WIDTH = "width"; /* 宽*/
public static final String FIELD_THICK = "thick"; /* 厚*/
public static final String FIELD_AMOUNT = "amount"; /* 数量*/
public static final String FIELD_UNIT_WEIGHT = "unitWeight"; /* 单重*/
public static final String FIELD_WEIGHT = "weight"; /* 重量*/
public static final String FIELD_REMARK = "remark"; /* 备注*/
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 = "FIELD_ID";
public static final String COL_COMPANY_CODE = "FIELD_COMPANY_CODE"; /* 企业编码*/
public static final String COL_DEP_CODE = "FIELD_DEP_CODE"; /* 部门编码*/
public static final String COL_WH_CODE = "FIELD_WH_CODE"; /* 仓库编码*/
public static final String COL_WH_NAME = "FIELD_WH_NAME"; /* 仓库名称*/
public static final String COL_PROD_NO = "FIELD_PROD_NO"; /* 生产单号*/
public static final String COL_PROJ_CODE = "FIELD_PROJ_CODE"; /* 项目编码*/
public static final String COL_PROJ_NAME = "FIELD_PROJ_NAME"; /* 项目名称*/
public static final String COL_INVENT_CODE = "FIELD_INVENT_CODE"; /* 部件编码*/
public static final String COL_INVENT_NAME = "FIELD_INVENT_NAME"; /* 部件名称*/
public static final String COL_SUB_INVENT_CODE = "FIELD_SUB_INVENT_CODE"; /* 零部件编码*/
public static final String COL_SUB_INVENT_NAME = "FIELD_SUB_INVENT_NAME"; /* 零部件名称*/
public static final String COL_LENGTH = "FIELD_LENGTH"; /* 长*/
public static final String COL_WIDTH = "FIELD_WIDTH"; /* 宽*/
public static final String COL_THICK = "FIELD_THICK"; /* 厚*/
public static final String COL_AMOUNT = "FIELD_AMOUNT"; /* 数量*/
public static final String COL_UNIT_WEIGHT = "FIELD_UNIT_WEIGHT"; /* 单重*/
public static final String COL_WEIGHT = "FIELD_WEIGHT"; /* 重量*/
public static final String COL_REMARK = "FIELD_REMARK"; /* 备注*/
public static final String COL_CREATED_BY = "FIELD_CREATED_BY"; /* 创建人*/
public static final String COL_CREATED_NAME = "FIELD_CREATED_NAME"; /* 创建人名称*/
public static final String COL_CREATED_TIME = "FIELD_CREATED_TIME"; /* 创建时间*/
public static final String COL_UPDATED_BY = "FIELD_UPDATED_BY"; /* 更新人*/
public static final String COL_UPDATED_NAME = "FIELD_UPDATED_NAME"; /* 更新人名称*/
public static final String COL_UPDATED_TIME = "FIELD_UPDATED_TIME"; /* 更新时间*/
public static final String COL_VERSION = "FIELD_VERSION"; /* 版本号*/
public static final String QUERY = "HPKC011.query";
public static final String COUNT = "HPKC011.count";
public static final String INSERT = "HPKC011.insert";
public static final String UPDATE = "HPKC011.update";
public static final String DELETE = "HPKC011.delete";
private Long id = null;
private String companyCode = " "; /* 企业编码*/
private String depCode = " "; /* 部门编码*/
private String whCode = " "; /* 仓库编码*/
private String whName = " "; /* 仓库名称*/
private String prodNo = " "; /* 生产单号*/
private String projCode = " "; /* 项目编码*/
private String projName = " "; /* 项目名称*/
private String inventCode = " "; /* 物料编码*/
private String inventName = " "; /* 物料名称*/
private String subInventCode = " "; /* 零部件编码*/
private String subInventName = " "; /* 零部件名称*/
private BigDecimal length = new BigDecimal("0"); /* 长*/
private BigDecimal width = new BigDecimal("0"); /* 宽*/
private BigDecimal thick = new BigDecimal("0"); /* 厚*/
private BigDecimal amount = new BigDecimal("0"); /* 数量*/
private BigDecimal unitWeight = new BigDecimal("0"); /* 单重*/
private BigDecimal weight = new BigDecimal("0"); /* 重量*/
private String remark = " "; /* 备注*/
private String createdBy = " "; /* 创建人*/
private String createdName = " "; /* 创建人名称*/
private String createdTime = " "; /* 创建时间*/
private String updatedBy = " "; /* 更新人*/
private String updatedName = " "; /* 更新人名称*/
private String updatedTime = " "; /* 更新时间*/
private Integer version = null; /* 版本号*/
/**
* 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_DEP_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_PROD_NO);
eiColumn.setDescName("生产单号");
eiMetadata.addMeta(eiColumn);
eiColumn = new EiColumn(FIELD_PROJ_CODE);
eiColumn.setDescName("项目编码");
eiMetadata.addMeta(eiColumn);
eiColumn = new EiColumn(FIELD_PROJ_NAME);
eiColumn.setDescName("项目名称");
eiMetadata.addMeta(eiColumn);
eiColumn = new EiColumn(FIELD_INVENT_CODE);
eiColumn.setDescName("物料编码");
eiMetadata.addMeta(eiColumn);
eiColumn = new EiColumn(FIELD_INVENT_NAME);
eiColumn.setDescName("物料名称");
eiMetadata.addMeta(eiColumn);
eiColumn = new EiColumn(FIELD_LENGTH);
eiColumn.setType("N");
eiColumn.setScaleLength(2);
eiColumn.setFieldLength(10);
eiColumn.setDescName("长");
eiMetadata.addMeta(eiColumn);
eiColumn = new EiColumn(FIELD_WIDTH);
eiColumn.setType("N");
eiColumn.setScaleLength(2);
eiColumn.setFieldLength(10);
eiColumn.setDescName("宽");
eiMetadata.addMeta(eiColumn);
eiColumn = new EiColumn(FIELD_THICK);
eiColumn.setType("N");
eiColumn.setScaleLength(2);
eiColumn.setFieldLength(10);
eiColumn.setDescName("厚");
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_UNIT_WEIGHT);
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_REMARK);
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 HPKC011() {
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 depCode - 部门编码.
* @return the depCode
*/
public String getDepCode() {
return this.depCode;
}
/**
* set the depCode - 部门编码.
*
* @param depCode - 部门编码
*/
public void setDepCode(String depCode) {
this.depCode = depCode;
}
/**
* get the 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 inventCode - 物料编码.
* @return the inventCode
*/
public String getInventCode() {
return this.inventCode;
}
/**
* set the inventCode - 物料编码.
*
* @param inventCode - 物料编码
*/
public void setInventCode(String inventCode) {
this.inventCode = inventCode;
}
/**
* get the inventName - 物料名称.
* @return the inventName
*/
public String getInventName() {
return this.inventName;
}
/**
* set the inventName - 物料名称.
*
* @param inventName - 物料名称
*/
public void setInventName(String inventName) {
this.inventName = inventName;
}
/**
* get the amount - 数量.
* @return the amount
*/
public BigDecimal getAmount() {
return this.amount;
}
/**
* set the amount - 数量.
*
* @param amount - 数量
*/
public void setAmount(BigDecimal amount) {
this.amount = amount;
}
/**
* get the weight - 重量.
* @return the weight
*/
public BigDecimal getWeight() {
return this.weight;
}
/**
* set the weight - 重量.
*
* @param weight - 重量
*/
public void setWeight(BigDecimal weight) {
this.weight = weight;
}
/**
* get the createdBy - 创建人.
* @return the createdBy
*/
public String getCreatedBy() {
return this.createdBy;
}
/**
* set the createdBy - 创建人.
*
* @param createdBy - 创建人
*/
public void setCreatedBy(String createdBy) {
this.createdBy = createdBy;
}
/**
* get the createdName - 创建人名称.
* @return the createdName
*/
public String getCreatedName() {
return this.createdName;
}
/**
* set the createdName - 创建人名称.
*
* @param createdName - 创建人名称
*/
public void setCreatedName(String createdName) {
this.createdName = createdName;
}
/**
* get the createdTime - 创建时间.
* @return the createdTime
*/
public String getCreatedTime() {
return this.createdTime;
}
/**
* set the createdTime - 创建时间.
*
* @param createdTime - 创建时间
*/
public void setCreatedTime(String createdTime) {
this.createdTime = createdTime;
}
/**
* get the updatedBy - 更新人.
* @return the updatedBy
*/
public String getUpdatedBy() {
return this.updatedBy;
}
/**
* set the updatedBy - 更新人.
*
* @param updatedBy - 更新人
*/
public void setUpdatedBy(String updatedBy) {
this.updatedBy = updatedBy;
}
/**
* get the updatedName - 更新人名称.
* @return the updatedName
*/
public String getUpdatedName() {
return this.updatedName;
}
/**
* set the updatedName - 更新人名称.
*
* @param updatedName - 更新人名称
*/
public void setUpdatedName(String updatedName) {
this.updatedName = updatedName;
}
/**
* get the updatedTime - 更新时间.
* @return the updatedTime
*/
public String getUpdatedTime() {
return this.updatedTime;
}
/**
* set the updatedTime - 更新时间.
*
* @param updatedTime - 更新时间
*/
public void setUpdatedTime(String updatedTime) {
this.updatedTime = updatedTime;
}
/**
* get the version - 版本号.
* @return the version
*/
public Integer getVersion() {
return this.version;
}
/**
* set the version - 版本号.
*
* @param version - 版本号
*/
public void setVersion(Integer version) {
this.version = version;
}
public String getProdNo() {
return prodNo;
}
public void setProdNo(String prodNo) {
this.prodNo = prodNo;
}
public String getProjCode() {
return projCode;
}
public String getProjName() {
return projName;
}
public String getSubInventCode() {
return subInventCode;
}
public void setSubInventCode(String subInventCode) {
this.subInventCode = subInventCode;
}
public String getSubInventName() {
return subInventName;
}
public void setSubInventName(String subInventName) {
this.subInventName = subInventName;
}
public BigDecimal getLength() {
return length;
}
public void setLength(BigDecimal length) {
this.length = length;
}
public BigDecimal getWidth() {
return width;
}
public void setWidth(BigDecimal width) {
this.width = width;
}
public BigDecimal getThick() {
return thick;
}
public void setThick(BigDecimal thick) {
this.thick = thick;
}
public BigDecimal getUnitWeight() {
return unitWeight;
}
public void setUnitWeight(BigDecimal unitWeight) {
this.unitWeight = unitWeight;
}
public void setProjCode(String projCode) {
this.projCode = projCode;
}
public void setProjName(String projName) {
this.projName = projName;
}
public String getRemark() {
return remark;
}
public void setRemark(String remark) {
this.remark = remark;
}
/**
* 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));
setDepCode(StringUtils.defaultIfEmpty(StringUtils.toString(map.get(FIELD_DEP_CODE)), depCode));
setWhCode(StringUtils.defaultIfEmpty(StringUtils.toString(map.get(FIELD_WH_CODE)), whCode));
setWhName(StringUtils.defaultIfEmpty(StringUtils.toString(map.get(FIELD_WH_NAME)), whName));
setProdNo(StringUtils.defaultIfEmpty(StringUtils.toString(map.get(FIELD_PROD_NO)), prodNo));
setProjCode(StringUtils.defaultIfEmpty(StringUtils.toString(map.get(FIELD_PROJ_CODE)), projCode));
setProjName(StringUtils.defaultIfEmpty(StringUtils.toString(map.get(FIELD_PROJ_NAME)), projName));
setInventCode(StringUtils.defaultIfEmpty(StringUtils.toString(map.get(FIELD_INVENT_CODE)), inventCode));
setInventName(StringUtils.defaultIfEmpty(StringUtils.toString(map.get(FIELD_INVENT_NAME)), inventName));
setSubInventCode(StringUtils.defaultIfEmpty(StringUtils.toString(map.get(FIELD_SUB_INVENT_CODE)), subInventCode));
setSubInventName(StringUtils.defaultIfEmpty(StringUtils.toString(map.get(FIELD_SUB_INVENT_NAME)), subInventName));
setLength(NumberUtils.toBigDecimal(StringUtils.toString(map.get(FIELD_LENGTH)), length));
setWeight(NumberUtils.toBigDecimal(StringUtils.toString(map.get(FIELD_WIDTH)), width));
setThick(NumberUtils.toBigDecimal(StringUtils.toString(map.get(FIELD_THICK)), thick));
setAmount(NumberUtils.toBigDecimal(StringUtils.toString(map.get(FIELD_AMOUNT)), amount));
setUnitWeight(NumberUtils.toBigDecimal(StringUtils.toString(map.get(FIELD_UNIT_WEIGHT)), unitWeight));
setWeight(NumberUtils.toBigDecimal(StringUtils.toString(map.get(FIELD_WEIGHT)), weight));
setRemark(StringUtils.defaultIfEmpty(StringUtils.toString(map.get(FIELD_REMARK)), remark));
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.toInteger(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_DEP_CODE, StringUtils.toString(depCode, eiMetadata.getMeta(FIELD_DEP_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_PROD_NO, StringUtils.toString(prodNo, eiMetadata.getMeta(FIELD_PROD_NO)));
map.put(FIELD_PROJ_CODE, StringUtils.toString(projCode, eiMetadata.getMeta(FIELD_PROJ_CODE)));
map.put(FIELD_PROJ_NAME, StringUtils.toString(projName, eiMetadata.getMeta(FIELD_PROJ_NAME)));
map.put(FIELD_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_SUB_INVENT_CODE, StringUtils.toString(subInventCode, eiMetadata.getMeta(FIELD_SUB_INVENT_CODE)));
map.put(FIELD_SUB_INVENT_NAME, StringUtils.toString(subInventName, eiMetadata.getMeta(FIELD_SUB_INVENT_NAME)));
map.put(FIELD_LENGTH, StringUtils.toString(length, eiMetadata.getMeta(FIELD_LENGTH)));
map.put(FIELD_WIDTH, StringUtils.toString(width, eiMetadata.getMeta(FIELD_WIDTH)));
map.put(FIELD_THICK, StringUtils.toString(thick, eiMetadata.getMeta(FIELD_THICK)));
map.put(FIELD_AMOUNT, StringUtils.toString(amount, eiMetadata.getMeta(FIELD_AMOUNT)));
map.put(FIELD_UNIT_WEIGHT, StringUtils.toString(unitWeight, eiMetadata.getMeta(FIELD_UNIT_WEIGHT)));
map.put(FIELD_WEIGHT, StringUtils.toString(weight, eiMetadata.getMeta(FIELD_WEIGHT)));
map.put(FIELD_REMARK, StringUtils.toString(remark, eiMetadata.getMeta(FIELD_REMARK)));
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;
}
}
package com.baosight.hpjx.hp.kc.service;
import com.baosight.hpjx.common.DdynamicEnum;
import com.baosight.hpjx.common.InventTypeEnum;
import com.baosight.hpjx.core.dao.DaoUtils;
import com.baosight.hpjx.core.security.UserSessionUtils;
import com.baosight.hpjx.hp.kc.domain.HPKC011;
import com.baosight.hpjx.hp.pz.domain.HPPZ006;
import com.baosight.hpjx.hp.pz.domain.HPPZ007;
import com.baosight.hpjx.hp.sc.domain.HPSC005;
import com.baosight.hpjx.util.CommonMethod;
import com.baosight.hpjx.util.LogUtils;
import com.baosight.iplat4j.core.ei.EiConstant;
import com.baosight.iplat4j.core.ei.EiInfo;
import com.baosight.iplat4j.core.exception.PlatException;
import com.baosight.iplat4j.core.service.impl.ServiceBase;
import com.baosight.iplat4j.core.service.soa.XLocalManager;
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.lang.StringUtils;
import java.math.BigDecimal;
import java.util.*;
/**
*
* @author:wwl
* @date:2024/1/23,10:51
*/
public class ServiceHPKC011 extends ServiceBase {
/**
* 画面初始化
*
* @param inInfo
* @return
*/
public EiInfo initLoad(EiInfo inInfo) {
HPKC011 HPKC011 = new HPKC011();
EiInfo outInfo = super.initLoad(inInfo, HPKC011);
outInfo.getBlock(EiConstant.resultBlock).getRows().clear();
Map paramMap = new HashMap<String,Object>(){{
put("inventTypes", InventTypeEnum.getProdTypes());
}};
CommonMethod.initBlock(outInfo, Arrays.asList(DdynamicEnum.WH_RECORD_BLOCK_ID), paramMap);
CommonMethod.initBlock(outInfo, Arrays.asList(DdynamicEnum.MATERIAL_RECORD_BLOCK_ID), paramMap);
return outInfo;
}
/**
* 查询操作.
*/
@Override
public EiInfo query(EiInfo inInfo) {
try {
inInfo = super.query(inInfo, "HPKC011.query", new HPKC011());
} catch (Exception e) {
LogUtils.setDetailMsg(inInfo, e, "查询失败");
}
return inInfo;
}
/**
* 新增操作.
*/
@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++) {
HPKC011 fKc010 = new HPKC011();
fKc010.fromMap(resultRows.get(i));
// 设置基础信息
DaoUtils.insert(HPKC011.INSERT, fKc010);
}
inInfo.setMsg("操作成功!本次对[" + resultRows.size() + "]条数据新增成功!");
} catch (Exception e) {
LogUtils.setDetailMsg(inInfo, e, "新增失败");
}
return inInfo;
}
/**
* 更新库存
*
* @param inInfo
* @return
*/
public EiInfo updateStock(EiInfo inInfo){
String whCode = inInfo.getString("whCode");
String prodNo = inInfo.getString("prodNo");
BigDecimal amount = new BigDecimal(inInfo.getString("amount"));
BigDecimal weight = new BigDecimal(inInfo.getString("weight"));
String companyCode = UserSessionUtils.getCompanyCode();
try {
checkUpdateStockParam(companyCode,whCode,prodNo,amount,weight);
HPKC011 newObj = generatorBaseInfo(companyCode,whCode,prodNo,amount,weight);
List<Map> list = dao.query("HPKC011.queryByCondition",new HashMap<String,Object>(){{
put("companyCode",companyCode);
put("whCode",whCode);
put("prodNo",prodNo);
}});
if(CollectionUtils.isEmpty(list)){
//新增
if(amount.compareTo(BigDecimal.ZERO)<0
||weight.compareTo(BigDecimal.ZERO)<0){
throw new PlatException("当前库存为空,库存变更数量与重量不能小于等于0!");
}
generatorBaseInfo(newObj);
DaoUtils.insert("HPKC011.insert",newObj);
}else{
//修改
HPKC011 oldObj = new HPKC011();
oldObj.fromMap(list.get(0));
BigDecimal afterAmout = oldObj.getAmount().add(amount);
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("HPKC011.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 prodNo
* @param amout
* @param weight
* @reutrn HPKC011
*/
private HPKC011 generatorBaseInfo(String companyCode, String whCode, String prodNo, BigDecimal amout, BigDecimal weight) {
HPKC011 hpkc011 = new HPKC011();
hpkc011.setCompanyCode(companyCode);
hpkc011.setWhCode(whCode);
hpkc011.setProdNo(prodNo);
hpkc011.setAmount(amout);
hpkc011.setWeight(weight);
String userId = UserSession.getLoginName();
String userName = UserSession.getLoginCName();
String time = DateUtils.curDateTimeStr14();
hpkc011.setCreatedBy(userId);
hpkc011.setCreatedName(userName);
hpkc011.setCreatedTime(time);
hpkc011.setUpdatedBy(userId);
hpkc011.setUpdatedName(userName);
hpkc011.setUpdatedTime(time);
return hpkc011;
}
private void generatorBaseInfo(HPKC011 hpkc011) {
EiInfo inInfo = new EiInfo();
try {
inInfo.set("whCode", hpkc011.getWhCode());
inInfo.set(EiConstant.serviceName, "HPPZ007");
inInfo.set(EiConstant.methodName, "queryByWhCode");
EiInfo outInfo = XLocalManager.call(inInfo);
List<HPPZ007> whNameList = (List) outInfo.get("list");
hpkc011.setWhName(whNameList.get(0).getWhName());
}catch (Exception e){
LogUtils.setDetailMsg(inInfo, e, "库存更新失败!");
throw new PlatException("仓库编码异常,找不到对应的仓库档案!");
}
try {
inInfo.setRows(EiConstant.queryBlock,new ArrayList(){{add(new HashMap<String,Object>(){{put("prodNo",hpkc011.getProdNo());}});}});
inInfo.set(EiConstant.serviceName, "HPSC005");
inInfo.set(EiConstant.methodName, "query");
EiInfo outInfo = XLocalManager.call(inInfo);
HPSC005 hpsc005 = new HPSC005();
List<Map> inventList = outInfo.getBlock(EiConstant.resultBlock).getRows();
hpsc005.fromMap(inventList.get(0));
hpkc011.setProjCode(hpsc005.getProjCode());
hpkc011.setProjName(hpsc005.getProjName());
hpkc011.setInventCode(hpsc005.getPrdtCode());
hpkc011.setInventName(hpsc005.getPrdtName());
hpkc011.setSubInventCode(hpsc005.getPartCode());
hpkc011.setSubInventName(hpsc005.getPartName());
hpkc011.setLength(hpsc005.getPartLength());
hpkc011.setWidth(hpsc005.getPartWidth());
hpkc011.setThick(hpsc005.getPartThick());
hpkc011.setUnitWeight(hpsc005.getUnitWt());
hpkc011.setRemark(hpsc005.getRemark1());
}catch (Exception e){
LogUtils.setDetailMsg(inInfo, e, "库存更新失败!");
throw new PlatException("生产单号异常,找不到对应的生产订单!");
}
hpkc011.setVersion(new Integer(1));
}
/**
* 校验库存变更请求参数
* @param companyCode
* @param whCode
* @param prodNo
* @param amout
* @param weight
*/
private void checkUpdateStockParam(String companyCode, String whCode, String prodNo
, BigDecimal amout, BigDecimal weight){
if(StringUtils.isBlank(companyCode)){
throw new PlatException("企业编码不能为空!");
}
if(StringUtils.isBlank(whCode)){
throw new PlatException("仓库编码不能为空!");
}
if(StringUtils.isBlank(prodNo)){
throw new PlatException("生产单号不能为空!");
}
if(Objects.isNull(amout)||
Objects.isNull(amout)){
throw new PlatException("库存变更数量或重量不能为空!");
}
if(amout.compareTo(BigDecimal.ZERO)==0
&&weight.compareTo(BigDecimal.ZERO)==0){
throw new PlatException("库存变更数量或重量不能为0)!");
}
}
}
<?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="HPKC011">
<sql id="column">
ID as "id",
COMPANY_CODE as "companyCode", <!-- 企业编码 -->
DEP_CODE as "depCode", <!-- 部门编码 -->
WH_CODE as "whCode", <!-- 仓库编码 -->
WH_NAME as "whName", <!-- 仓库名称 -->
PROD_NO as "prodNo", <!-- 生产单号 -->
PROJ_CODE as "projCode", <!-- 生产单号 -->
PROJ_NAME as "projName", <!-- 生产单号 -->
INVENT_CODE as "inventCode", <!-- 部件编码 -->
INVENT_NAME as "inventName", <!-- 部件名称 -->
SUB_INVENT_CODE as "subInventCode", <!-- 零部件编码 -->
SUB_INVENT_NAME as "subInventName", <!-- 零部件名称 -->
LENGTH as "length", <!-- 长 -->
WIDTH as "width", <!-- 宽 -->
THICK as "thick", <!-- 厚 -->
AMOUNT as "amount", <!-- 数量 -->
UNIT_WEIGHT as "unitWeight", <!-- 单重 -->
WEIGHT as "weight", <!-- 重量 -->
REMARK as "remark", <!-- 备注 -->
CREATED_BY as "createdBy", <!-- 创建人 -->
CREATED_NAME as "createdName", <!-- 创建人名称 -->
CREATED_TIME as "createdTime", <!-- 创建时间 -->
UPDATED_BY as "updatedBy", <!-- 更新人 -->
UPDATED_NAME as "updatedName", <!-- 更新人名称 -->
UPDATED_TIME as "updatedTime", <!-- 更新时间 -->
VERSION as "version" <!-- 版本号 -->
</sql>
<sql id="condition">
<isNotEmpty prepend=" AND " property="id">
ID = #id#
</isNotEmpty>
<isNotEmpty prepend=" AND " property="companyCode">
COMPANY_CODE = #companyCode#
</isNotEmpty>
<isNotEmpty prepend=" AND " property="whCode">
WH_CODE = #whCode#
</isNotEmpty>
<isNotEmpty prepend=" AND " property="whName">
WH_NAME LIKE '%' || #whName# || '%'
</isNotEmpty>
<isNotEmpty prepend=" AND " property="prodNo">
PROD_NO = #prodNo#
</isNotEmpty>
<isNotEmpty prepend=" AND " property="projCode">
PROJ_CODE = #projCode#
</isNotEmpty>
<isNotEmpty prepend=" AND " property="projName">
PROJ_NAME LIKE '%' || #projName# || '%'
</isNotEmpty>
<isNotEmpty prepend=" AND " property="inventCode">
INVENT_CODE = #inventCode#
</isNotEmpty>
<isNotEmpty prepend=" AND " property="inventName">
INVENT_NAME = #inventName#
</isNotEmpty>
<isNotEmpty prepend=" AND " property="subInventCode">
SUB_INVENT_CODE = #subInventCode#
</isNotEmpty>
<isNotEmpty prepend=" AND " property="subInventName">
SUB_INVENT_NAME = #subInventName#
</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>
<sql id="customCondition">
<isNotEmpty prepend=" AND " property="ids">
ID IN <iterate close=")" open="(" conjunction="," property="ids">#ids[]#</iterate>
</isNotEmpty>
</sql>
<select id="query" resultClass="com.baosight.hpjx.hp.kc.domain.HPKC011">
SELECT <include refid="column"/>
FROM hpjx.T_HPKC011
WHERE 1=1
<include refid="condition"/>
<include refid="customCondition"/>
<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_HPKC011
WHERE 1=1
<include refid="condition"/>
<include refid="customCondition"/>
</select>
<select id="count" resultClass="int">
SELECT COUNT(*) FROM hpjx.T_HPKC011
WHERE 1=1
<include refid="condition"/>
<include refid="customCondition"/>
</select>
<insert id="insert">
INSERT INTO hpjx.T_HPKC011 (
COMPANY_CODE, <!-- 企业编码 预留 -->
DEP_CODE, <!-- 部门编码 -->
WH_CODE, <!-- 仓库编码 -->
WH_NAME, <!-- 仓库名称 -->
PROD_NO, <!-- 生产单号 -->
PROJ_CODE, <!-- 生产单号 -->
PROJ_NAME, <!-- 生产单号 -->
INVENT_CODE, <!-- 部件编码 -->
INVENT_NAME, <!-- 部件名称 -->
SUB_INVENT_CODE, <!-- 零部件编码 -->
SUB_INVENT_NAME, <!-- 零部件名称 -->
LENGTH, <!-- 长 -->
WIDTH, <!-- 宽 -->
THICK, <!-- 厚 -->
AMOUNT, <!-- 数量 -->
UNIT_WEIGHT, <!-- 单重 -->
WEIGHT, <!-- 重量 -->
REMARK, <!-- 备注 -->
CREATED_BY, <!-- 创建人 -->
CREATED_TIME, <!-- 创建时间 -->
UPDATED_BY, <!-- 更新人 -->
UPDATED_TIME, <!-- 更新时间 -->
VERSION
) VALUES (
#companyCode#, #depCode#, #whCode#, #whName#, #prodNo#, #projCode#, #projName#,
#inventCode#, #inventName#, #subInventCode#, #subInventName#, #length#, #width#, #thick#,
#amount#, #unitWeight#, #weight#, #remark#,
#createdBy#, #createdTime#, #updatedBy#,
#updatedTime#, #version#
)
</insert>
<update id="updateStock">
UPDATE hpjx.T_HPKC011
SET
AMOUNT = #amount#, <!-- 数量 -->
WEIGHT = #weight#, <!-- 重量 -->
UPDATED_BY = #updatedBy#, <!-- 更新人 -->
UPDATED_NAME = #updatedName#, <!-- 更新人 -->
UPDATED_TIME = #updatedTime#, <!-- 更新时间 -->
VERSION = VERSION+1
WHERE ID = #id#
AND VERSION = #version#
</update>
<!-- 行锁 -->
<update id="lock">
UPDATE ${hpjxSchema}.T_HPKC011
SET CREATED_TIME = CREATED_TIME
WHERE 1=1
<isNotEmpty prepend=" AND " property="id">
ID = #id#
</isNotEmpty>
<isNotEmpty prepend=" AND " property="ids">
ID IN <iterate close=")" open="(" conjunction="," property="ids">#ids[]#</iterate>
</isNotEmpty>
</update>
</sqlMap>
...@@ -354,4 +354,74 @@ public class HPKCTools { ...@@ -354,4 +354,74 @@ public class HPKCTools {
} }
} }
/**
* 查询产品库存信息
*
* @param ids
* @return
*/
public static List<HPKC011> listKc011(List<Long> ids) {
if (CollectionUtils.isEmpty(ids)) {
return null;
}
Map queryMap = new HashMap();
queryMap.put("ids", ids);
return DaoBase.getInstance().query(HPKC011.QUERY, queryMap);
}
/**
* 查询产品库存信息
*
* @param ids
* @return
*/
public static Map<Long, HPKC011> mapKc011(List<Long> ids) {
List<HPKC011> results = listKc011(ids);
if (CollectionUtils.isEmpty(results)) {
return null;
}
return results.stream().collect(Collectors.toMap(HPKC011::getId, item -> item));
}
/**
* 锁
*
* @param ids
* @return
*/
public static void lockKc011(List<Long> ids) {
if (CollectionUtils.isEmpty(ids)) {
return;
}
Map queryMap = new HashMap();
queryMap.put("ids", ids);
DaoBase.getInstance().update(HPSqlConstant.HPKC011.LOCK, queryMap);
}
/**
* 更新产品库存
*
* @param whCode
* @param prodNo
* @param amount
* @param weight
*/
public static void updateProdStock(String whCode, String prodNo, BigDecimal amount, BigDecimal weight) {
if (amount.compareTo(BigDecimal.ZERO) == 0 && weight.compareTo(BigDecimal.ZERO) == 0) {
return;
}
EiInfo inInfo = new EiInfo();
inInfo.set("whCode", whCode);
inInfo.set("prodNo", prodNo);
inInfo.set("amount", amount);
inInfo.set("weight", weight);
inInfo.set(EiConstant.serviceName, "HPKC011");
inInfo.set(EiConstant.methodName, "updateStock");
EiInfo outInfo = XLocalManager.call(inInfo);
if (outInfo.getStatus() < 0) {
throw new PlatException("跟新库存失败:" + outInfo.getMsg());
}
}
} }
...@@ -200,13 +200,7 @@ public class ServiceHPPZ006 extends ServiceBase { ...@@ -200,13 +200,7 @@ public class ServiceHPPZ006 extends ServiceBase {
hppz006.setCoefficient(new BigDecimal(coefficient)); hppz006.setCoefficient(new BigDecimal(coefficient));
hppz006.setUnit(unit); hppz006.setUnit(unit);
hppz006.setStatus(CommonConstant.YesNo.YES_1.intValue()); hppz006.setStatus(CommonConstant.YesNo.YES_1.intValue());
StringBuffer sepbuf = new StringBuffer(); hppz006.setSpec(HPPZTools.jointSpec(hppz006.getLength(),hppz006.getWidth(),hppz006.getThick()));
if(Objects.nonNull(length)){sepbuf.append(length).append("*");}
if(Objects.nonNull(width)){sepbuf.append(width).append("*");}
if(Objects.nonNull(thick)){sepbuf.append(thick);}
if(StringUtils.isNotEmpty(sepbuf.toString())){
hppz006.setSpec(sepbuf.toString());
}
DaoUtils.insert(HPPZ006.INSERT, hppz006); DaoUtils.insert(HPPZ006.INSERT, hppz006);
} }
inInfo.setAttr(new HashMap(){{put("obj",hppz006);}}); inInfo.setAttr(new HashMap(){{put("obj",hppz006);}});
......
package com.baosight.hpjx.hp.pz.tools; package com.baosight.hpjx.hp.pz.tools;
import com.baosight.eplat.utils.StringUtils;
import com.baosight.hpjx.common.InventTypeEnum; import com.baosight.hpjx.common.InventTypeEnum;
import com.baosight.hpjx.core.constant.CommonConstant; import com.baosight.hpjx.core.constant.CommonConstant;
import com.baosight.hpjx.core.dao.DaoBase; import com.baosight.hpjx.core.dao.DaoBase;
...@@ -15,6 +14,7 @@ import com.baosight.iplat4j.core.ei.EiConstant; ...@@ -15,6 +14,7 @@ import com.baosight.iplat4j.core.ei.EiConstant;
import com.baosight.iplat4j.core.ei.EiInfo; import com.baosight.iplat4j.core.ei.EiInfo;
import com.baosight.iplat4j.core.exception.PlatException; import com.baosight.iplat4j.core.exception.PlatException;
import com.baosight.iplat4j.core.service.soa.XLocalManager; import com.baosight.iplat4j.core.service.soa.XLocalManager;
import org.apache.commons.lang.StringUtils;
import org.springframework.util.CollectionUtils; import org.springframework.util.CollectionUtils;
import java.math.BigDecimal; import java.math.BigDecimal;
...@@ -170,15 +170,15 @@ public class HPPZTools { ...@@ -170,15 +170,15 @@ public class HPPZTools {
public static String jointSpec(BigDecimal length, BigDecimal width, BigDecimal thick) { public static String jointSpec(BigDecimal length, BigDecimal width, BigDecimal thick) {
StringBuffer sb = new StringBuffer(); StringBuffer sb = new StringBuffer();
if (length != null && length.compareTo(BigDecimal.ZERO) != 0) { if (length != null && length.compareTo(BigDecimal.ZERO) != 0) {
sb.append(com.baosight.iplat4j.core.util.StringUtils.toString(length)); sb.append(length.toString());
sb.append("*"); sb.append("*");
} }
if (width != null && width.compareTo(BigDecimal.ZERO) != 0) { if (width != null && width.compareTo(BigDecimal.ZERO) != 0) {
sb.append(com.baosight.iplat4j.core.util.StringUtils.toString(width)); sb.append(width.toString());
sb.append("*"); sb.append("*");
} }
if (thick != null && thick.compareTo(BigDecimal.ZERO) != 0) { if (thick != null && thick.compareTo(BigDecimal.ZERO) != 0) {
sb.append(com.baosight.iplat4j.core.util.StringUtils.toString(thick)); sb.append(thick.toString());
} }
return sb.toString(); return sb.toString();
} }
......
...@@ -31,7 +31,7 @@ public class CommonMethod { ...@@ -31,7 +31,7 @@ public class CommonMethod {
* @param selectParams 筛选条件 * @param selectParams 筛选条件
* 公用下拉方法 * 公用下拉方法
*/ */
public static void initBlock(EiInfo inInfo, List<DdynamicEnum> tableParams, Map<String, String> selectParams){ public static void initBlock(EiInfo inInfo, List<DdynamicEnum> tableParams, Map<String, Object> selectParams){
initBlock(inInfo, tableParams, selectParams,true); initBlock(inInfo, tableParams, selectParams,true);
} }
...@@ -41,7 +41,7 @@ public class CommonMethod { ...@@ -41,7 +41,7 @@ public class CommonMethod {
* @param selectParams 筛选条件 * @param selectParams 筛选条件
* 公用下拉方法 * 公用下拉方法
*/ */
public static void initBlock(EiInfo inInfo, List<DdynamicEnum> tableParams, Map<String, String> selectParams, Boolean isSplicingSymbol){ public static void initBlock(EiInfo inInfo, List<DdynamicEnum> tableParams, Map<String, Object> selectParams, Boolean isSplicingSymbol){
/* 新建一个块 将每个表查询到的结果放入单独的块中 */ /* 新建一个块 将每个表查询到的结果放入单独的块中 */
EiBlock eiBlock; EiBlock eiBlock;
/* 行数据 将每个数据源查询到的数据放到每个模块的行数据中 */ /* 行数据 将每个数据源查询到的数据放到每个模块的行数据中 */
......
var inventNameGlobalData = [];
var specGlobalData = [];
$(function() {
// 查询
$("#QUERY").on("click", query);
IPLATUI.EFGrid = {
"result": {
columns: [{
field: "inventCode",
template: function (dataItem) {
for (let i = 0; i < inventNameGlobalData.length; i++) {
if (inventNameGlobalData[i]['valueField'] === dataItem['inventCode']) {
return inventNameGlobalData[i]['textField'];
}
}
return "";
}
}, {
field: "spec",
template: function (dataItem) {
for (let i = 0; i < specGlobalData.length; i++) {
if (specGlobalData[i]['valueField'] === dataItem['inventRecordId']) {
return specGlobalData[i]['textField'];
}
}
return "";
}
}, {
field: "material",
template: function (dataItem) {
for (let i = 0; i < specGlobalData.length; i++) {
if (specGlobalData[i]['valueField'] === dataItem['inventRecordId']) {
return specGlobalData[i]['param1Field'];
}
}
return "";
}
}, {
field: "unit",
template: function (dataItem) {
for (let i = 0; i < specGlobalData.length; i++) {
if (specGlobalData[i]['valueField'] === dataItem['inventRecordId']) {
return specGlobalData[i]['param2Field'];
}
}
return "";
}
}]
},
};
});
/**
* 页面加载时执行
*/
$(window).load(function () {
// 存货名称
let eiInfo = new EiInfo();
EiCommunicator.send("HPPZ004", "queryComboBox", eiInfo, {
onSuccess: function (ei) {
inventNameGlobalData = ei.getBlock("invent_name_block_id").getMappedRows();
},
onFail: function (ei) {
}
}, {async: false});
// 规格
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页开始查询
}
<!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-whCode" cname="仓库名称" colWidth="3" filter="contains" defultValue="">
<EF:EFOption label="全部" value=""/>
<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">
<EF:EFOption label="全部" value=""/>
<EF:EFCodeOption codeName="hpjx.hpkc.inventType"/>
</EF:EFSelect>
<EF:EFSelect ename="inqu_status-0-inventCode" cname="存货名称" colWidth="3" filter="contains" defultValue="">
<EF:EFOption label="全部" value=""/>
<EF:EFOptions blockId="material_record_block_id" textField="textField" valueField="valueField"/>
</EF:EFSelect>
<EF:EFSelect ename="inqu_status-0-spec" cname="规格" colWidth="3" filter="contains" defultValue="">
<EF:EFOption label="全部" value=""/>
<EF:EFOptions blockId="spec_name_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="100" align="center" required="true">
<EF:EFCodeOption codeName="hpjx.hpkc.inventType"/>
</EF:EFComboColumn>
<EF:EFColumn ename="inventCode" cname="存货名称" width="120" align="center" required="true"/>
<EF:EFColumn ename="spec" cname="规格" width="120" align="center"/>
<EF:EFColumn ename="material" cname="材质" width="120" align="center"/>
<EF:EFColumn ename="unit" cname="单位" width="120" align="center"/>
<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