Commit dd8026da by 宋祥

1.生产入库单页面调整

parent abfcdd85
package com.baosight.hpjx.core.dao; package com.baosight.hpjx.core.dao;
import com.baosight.hpjx.core.security.UserSessionUtils;
import com.baosight.hpjx.hp.xs.tools.HPXSUserTools;
import com.baosight.hpjx.util.AssertUtils; import com.baosight.hpjx.util.AssertUtils;
import com.baosight.hpjx.util.DateUtils; import com.baosight.hpjx.util.DateUtils;
import com.baosight.iplat4j.core.data.DaoEPBase; import com.baosight.iplat4j.core.data.DaoEPBase;
...@@ -103,6 +105,24 @@ public class DaoUtils { ...@@ -103,6 +105,24 @@ public class DaoUtils {
} catch (Exception e) { } catch (Exception e) {
log.warn("写入创建人姓名失败", e); log.warn("写入创建人姓名失败", e);
} }
// 创建人企业编码
try {
String companyCode;
try {
companyCode = UserSessionUtils.getCompanyCode();
} catch (Exception e) {
companyCode = "";
}
BeanUtils.setProperty(bean, "companyCode", companyCode);
} catch (Exception e) {
log.warn("写入创建人企业编码失败", e);
}
// 创建人部门编码
try {
BeanUtils.setProperty(bean, "depCode", HPXSUserTools.getOrgId());
} catch (Exception e) {
log.warn("写入创建人企业编码失败", e);
}
// 创建时刻 // 创建时刻
try { try {
BeanUtils.setProperty(bean, "createdTime", DateUtils.shortDateTime()); BeanUtils.setProperty(bean, "createdTime", DateUtils.shortDateTime());
...@@ -141,6 +161,24 @@ public class DaoUtils { ...@@ -141,6 +161,24 @@ public class DaoUtils {
} }
map.put("createdName", userName); map.put("createdName", userName);
map.put("updatedName", ""); map.put("updatedName", "");
// 创建人企业编码
try {
String companyCode;
try {
companyCode = UserSessionUtils.getCompanyCode();
} catch (Exception e) {
companyCode = "";
}
map.put("companyCode", companyCode);
} catch (Exception e) {
log.warn("写入创建人企业编码失败", e);
}
// 创建人部门编码
try {
map.put("depCode", HPXSUserTools.getOrgId());
} catch (Exception e) {
log.warn("写入创建人企业编码失败", e);
}
// 创建时刻 // 创建时刻
try { try {
map.put("createdTime", DateUtils.shortDateTime()); map.put("createdTime", DateUtils.shortDateTime());
......
...@@ -20,6 +20,8 @@ public class HPConstant { ...@@ -20,6 +20,8 @@ public class HPConstant {
public static final String HPKC008_NUMBER = "HPKC008_NUMBER"; public static final String HPKC008_NUMBER = "HPKC008_NUMBER";
// 巡检单号 // 巡检单号
public static final String HPZL001_NUMBER = "HPZL001_NUMBER"; public static final String HPZL001_NUMBER = "HPZL001_NUMBER";
// 生产入库单号
public static final String HPKC003_PROD_NO = "HPKC003_PROD_NO";
} }
/** /**
......
/**
* Generate time : 2024-01-12 14:21:33
* Version : 1.0
*/
package com.baosight.hpjx.hp.kc.domain; package com.baosight.hpjx.hp.kc.domain;
import com.baosight.iplat4j.core.util.NumberUtils; import com.baosight.iplat4j.core.util.NumberUtils;
import java.math.BigDecimal;
import com.baosight.iplat4j.core.ei.EiColumn; import com.baosight.iplat4j.core.ei.EiColumn;
import com.baosight.iplat4j.core.data.DaoEPBase; import com.baosight.iplat4j.core.data.DaoEPBase;
import java.util.HashMap; import java.util.HashMap;
...@@ -11,399 +9,538 @@ import java.util.Map; ...@@ -11,399 +9,538 @@ import java.util.Map;
import com.baosight.iplat4j.core.util.StringUtils; import com.baosight.iplat4j.core.util.StringUtils;
/** /**
* THpkc003 * Project: <br>
* * Title:THpkc003.java <br>
*/ * Description: <br>
*
* Copyrigth:Baosight Software LTD.co Copyright (c) 2019. <br>
*
* @version 1.0
* @history 2024-01-22 9:56:00 create
*/
public class HPKC003 extends DaoEPBase { public class HPKC003 extends DaoEPBase {
private Long id = 0L; private static final long serialVersionUID = 1L;
private String companyCode = " "; /* 企业编码 预留*/
private String depCode = " "; /* 部门编码*/ public static final String FIELD_ID = "id";
private String documentDate = " "; /* 单据日期*/ public static final String FIELD_COMPANY_CODE = "companyCode"; /* 企业编码 预留*/
private String productionNumber = " "; /* 生产入库单号*/ public static final String FIELD_DEP_CODE = "depCode"; /* 部门编码*/
private String warehouseCode = " "; /* 仓库编码*/ public static final String FIELD_DOCUMENT_DATE = "documentDate"; /* 单据日期*/
private String warehouseName = " "; /* 仓库名称*/ public static final String FIELD_PROD_NO = "prodNo"; /* 生产入库单号*/
private int materialType; /* 物料类型*/ public static final String FIELD_WH_CODE = "whCode"; /* 仓库编码*/
private String materialCode = " "; /* 物料编码*/ public static final String FIELD_WH_NAME = "whName"; /* 仓库名称*/
private String materialName = " "; /* 物料名称*/ public static final String FIELD_INVENT_TYPE = "inventType"; /* 物料类型*/
private String number = " "; /* 数量*/ public static final String FIELD_INVENT_CODE = "inventCode"; /* 物料编码*/
private String weight = " "; /* 重量*/ public static final String FIELD_INVENT_NAME = "inventName"; /* 物料名称*/
private String remark = " "; /* 备注*/ public static final String FIELD_AMOUNT = "amount"; /* 数量*/
private String createdBy = " "; /* 创建人*/ public static final String FIELD_WEIGHT = "weight"; /* 重量*/
private String createdTime = " "; /* 创建时间*/ public static final String FIELD_REMARK = "remark"; /* 备注*/
private String updatedBy = " "; /* 更新人*/ public static final String FIELD_CREATED_BY = "createdBy"; /* 创建人*/
private String updatedTime = " "; /* 更新时间*/ public static final String FIELD_CREATED_NAME = "createdName"; /* 创建人名称*/
/** public static final String FIELD_CREATED_TIME = "createdTime"; /* 创建时间*/
* initialize the metadata public static final String FIELD_UPDATED_BY = "updatedBy"; /* 更新人*/
*/ public static final String FIELD_UPDATED_TIME = "updatedTime"; /* 更新时间*/
public void initMetaData() { public static final String FIELD_UPDATED_NAME = "updatedName"; /* 修改人名称*/
EiColumn eiColumn;
public static final String COL_ID = "ID";
eiColumn = new EiColumn("id"); public static final String COL_COMPANY_CODE = "COMPANY_CODE"; /* 企业编码 预留*/
eiColumn.setPrimaryKey(true); public static final String COL_DEP_CODE = "DEP_CODE"; /* 部门编码*/
eiColumn.setDescName(" "); public static final String COL_DOCUMENT_DATE = "DOCUMENT_DATE"; /* 单据日期*/
eiMetadata.addMeta(eiColumn); public static final String COL_PROD_NO = "PROD_NO"; /* 生产入库单号*/
public static final String COL_WH_CODE = "WH_CODE"; /* 仓库编码*/
eiColumn = new EiColumn("companyCode"); public static final String COL_WH_NAME = "WH_NAME"; /* 仓库名称*/
eiColumn.setDescName("企业编码 预留"); public static final String COL_INVENT_TYPE = "INVENT_TYPE"; /* 物料类型*/
eiMetadata.addMeta(eiColumn); public static final String COL_INVENT_CODE = "INVENT_CODE"; /* 物料编码*/
public static final String COL_INVENT_NAME = "INVENT_NAME"; /* 物料名称*/
eiColumn = new EiColumn("depCode"); public static final String COL_AMOUNT = "AMOUNT"; /* 数量*/
eiColumn.setDescName("部门编码"); public static final String COL_WEIGHT = "WEIGHT"; /* 重量*/
eiMetadata.addMeta(eiColumn); public static final String COL_REMARK = "REMARK"; /* 备注*/
public static final String COL_CREATED_BY = "CREATED_BY"; /* 创建人*/
eiColumn = new EiColumn("documentDate"); public static final String COL_CREATED_NAME = "CREATED_NAME"; /* 创建人名称*/
eiColumn.setDescName("单据日期"); public static final String COL_CREATED_TIME = "CREATED_TIME"; /* 创建时间*/
eiMetadata.addMeta(eiColumn); public static final String COL_UPDATED_BY = "UPDATED_BY"; /* 更新人*/
public static final String COL_UPDATED_TIME = "UPDATED_TIME"; /* 更新时间*/
eiColumn = new EiColumn("productionNumber"); public static final String COL_UPDATED_NAME = "UPDATED_NAME"; /* 修改人名称*/
eiColumn.setDescName("生产入库单号");
eiMetadata.addMeta(eiColumn); private Long id = null;
private String companyCode = " "; /* 企业编码 预留*/
eiColumn = new EiColumn("warehouseCode"); private String depCode = " "; /* 部门编码*/
eiColumn.setDescName("仓库编码"); private String documentDate = " "; /* 单据日期*/
eiMetadata.addMeta(eiColumn); private String prodNo = " "; /* 生产入库单号*/
private String whCode = " "; /* 仓库编码*/
eiColumn = new EiColumn("warehouseName"); private String whName = " "; /* 仓库名称*/
eiColumn.setDescName("仓库名称"); private Integer inventType; /* 物料类型*/
eiMetadata.addMeta(eiColumn); private String inventCode = " "; /* 物料编码*/
private String inventName = " "; /* 物料名称*/
eiColumn = new EiColumn("materialType"); private BigDecimal amount = new BigDecimal(0.00); /* 数量*/
eiColumn.setDescName("物料类型"); private BigDecimal weight = new BigDecimal(0.00); /* 重量*/
eiMetadata.addMeta(eiColumn); private String remark = " "; /* 备注*/
private String createdBy = " "; /* 创建人*/
eiColumn = new EiColumn("materialCode"); private String createdName = " "; /* 创建人名称*/
eiColumn.setDescName("物料编码"); private String createdTime = " "; /* 创建时间*/
eiMetadata.addMeta(eiColumn); private String updatedBy = " "; /* 更新人*/
private String updatedTime = " "; /* 更新时间*/
eiColumn = new EiColumn("materialName"); private String updatedName = " "; /* 修改人名称*/
eiColumn.setDescName("物料名称");
eiMetadata.addMeta(eiColumn); /**
* initialize the metadata.
eiColumn = new EiColumn("number"); */
eiColumn.setDescName("数量"); public void initMetaData() {
eiMetadata.addMeta(eiColumn); EiColumn eiColumn;
eiColumn = new EiColumn("weight"); eiColumn = new EiColumn(FIELD_ID);
eiColumn.setDescName("重量"); eiColumn.setPrimaryKey(true);
eiMetadata.addMeta(eiColumn); eiColumn.setDescName(" ");
eiMetadata.addMeta(eiColumn);
eiColumn = new EiColumn("remark");
eiColumn.setDescName("备注"); eiColumn = new EiColumn(FIELD_COMPANY_CODE);
eiMetadata.addMeta(eiColumn); eiColumn.setDescName("企业编码 预留");
eiMetadata.addMeta(eiColumn);
eiColumn = new EiColumn("createdBy");
eiColumn.setDescName("创建人"); eiColumn = new EiColumn(FIELD_DEP_CODE);
eiMetadata.addMeta(eiColumn); eiColumn.setDescName("部门编码");
eiMetadata.addMeta(eiColumn);
eiColumn = new EiColumn("createdTime");
eiColumn.setDescName("创建时间"); eiColumn = new EiColumn(FIELD_DOCUMENT_DATE);
eiMetadata.addMeta(eiColumn); eiColumn.setDescName("单据日期");
eiMetadata.addMeta(eiColumn);
eiColumn = new EiColumn("updatedBy");
eiColumn.setDescName("更新人"); eiColumn = new EiColumn(FIELD_PROD_NO);
eiMetadata.addMeta(eiColumn); eiColumn.setDescName("生产入库单号");
eiMetadata.addMeta(eiColumn);
eiColumn = new EiColumn("updatedTime");
eiColumn.setDescName("更新时间"); eiColumn = new EiColumn(FIELD_WH_CODE);
eiMetadata.addMeta(eiColumn); eiColumn.setDescName("仓库编码");
eiMetadata.addMeta(eiColumn);
} eiColumn = new EiColumn(FIELD_WH_NAME);
/** eiColumn.setDescName("仓库名称");
* the constructor eiMetadata.addMeta(eiColumn);
*/
public HPKC003() { eiColumn = new EiColumn(FIELD_INVENT_TYPE);
initMetaData(); eiColumn.setDescName("物料类型");
} eiMetadata.addMeta(eiColumn);
/** eiColumn = new EiColumn(FIELD_INVENT_CODE);
* get the id eiColumn.setDescName("物料编码");
* @return the id eiMetadata.addMeta(eiColumn);
*/
public Long getId() { eiColumn = new EiColumn(FIELD_INVENT_NAME);
return this.id; eiColumn.setDescName("物料名称");
} eiMetadata.addMeta(eiColumn);
/** eiColumn = new EiColumn(FIELD_AMOUNT);
* set the id eiColumn.setType("N");
*/ eiColumn.setScaleLength(2);
public void setId(Long id) { eiColumn.setFieldLength(10);
this.id = id; eiColumn.setDescName("数量");
} eiMetadata.addMeta(eiColumn);
/**
* get the companyCode - 企业编码 预留 eiColumn = new EiColumn(FIELD_WEIGHT);
* @return the companyCode eiColumn.setType("N");
*/ eiColumn.setScaleLength(2);
public String getCompanyCode() { eiColumn.setFieldLength(10);
return this.companyCode; eiColumn.setDescName("重量");
} eiMetadata.addMeta(eiColumn);
/** eiColumn = new EiColumn(FIELD_REMARK);
* set the companyCode - 企业编码 预留 eiColumn.setDescName("备注");
*/ eiMetadata.addMeta(eiColumn);
public void setCompanyCode(String companyCode) {
this.companyCode = companyCode; eiColumn = new EiColumn(FIELD_CREATED_BY);
} eiColumn.setDescName("创建人");
/** eiMetadata.addMeta(eiColumn);
* get the depCode - 部门编码
* @return the depCode eiColumn = new EiColumn(FIELD_CREATED_NAME);
*/ eiColumn.setDescName("创建人名称");
public String getDepCode() { eiMetadata.addMeta(eiColumn);
return this.depCode;
} eiColumn = new EiColumn(FIELD_CREATED_TIME);
eiColumn.setDescName("创建时间");
/** eiMetadata.addMeta(eiColumn);
* set the depCode - 部门编码
*/ eiColumn = new EiColumn(FIELD_UPDATED_BY);
public void setDepCode(String depCode) { eiColumn.setDescName("更新人");
this.depCode = depCode; eiMetadata.addMeta(eiColumn);
}
/** eiColumn = new EiColumn(FIELD_UPDATED_TIME);
* get the documentDate - 单据日期 eiColumn.setDescName("更新时间");
* @return the documentDate eiMetadata.addMeta(eiColumn);
*/
public String getDocumentDate() { eiColumn = new EiColumn(FIELD_UPDATED_NAME);
return this.documentDate; eiColumn.setDescName("修改人名称");
} eiMetadata.addMeta(eiColumn);
/**
* set the documentDate - 单据日期 }
*/
public void setDocumentDate(String documentDate) { /**
this.documentDate = documentDate; * the constructor.
} */
/** public HPKC003() {
* get the productionNumber - 生产入库单号 initMetaData();
* @return the productionNumber }
*/
public String getProductionNumber() { /**
return this.productionNumber; * get the id .
} * @return the id
*/
/** public Long getId() {
* set the productionNumber - 生产入库单号 return this.id;
*/ }
public void setProductionNumber(String productionNumber) {
this.productionNumber = productionNumber; /**
} * set the id .
/** *
* get the warehouseCode - 仓库编码 * @param id
* @return the warehouseCode */
*/ public void setId(Long id) {
public String getWarehouseCode() { this.id = id;
return this.warehouseCode; }
} /**
* get the companyCode - 企业编码 预留.
/** * @return the companyCode
* set the warehouseCode - 仓库编码 */
*/ public String getCompanyCode() {
public void setWarehouseCode(String warehouseCode) { return this.companyCode;
this.warehouseCode = warehouseCode; }
}
/** /**
* get the warehouseName - 仓库名称 * set the companyCode - 企业编码 预留.
* @return the warehouseName *
*/ * @param companyCode - 企业编码 预留
public String getWarehouseName() { */
return this.warehouseName; public void setCompanyCode(String companyCode) {
} this.companyCode = companyCode;
}
/** /**
* set the warehouseName - 仓库名称 * get the depCode - 部门编码.
*/ * @return the deptCode
public void setWarehouseName(String warehouseName) { */
this.warehouseName = warehouseName; public String getDepCode() {
} return this.depCode;
/** }
* get the materialType - 物料类型
* @return the materialType /**
*/ * set the deptCode - 部门编码.
public int getMaterialType() { *
return this.materialType; * @param depCode - 部门编码
} */
public void setDepCode(String depCode) {
/** this.depCode = depCode;
* set the materialType - 物料类型 }
*/ /**
public void setMaterialType(int materialType) { * get the documentDate - 单据日期.
this.materialType = materialType; * @return the documentDate
} */
/** public String getDocumentDate() {
* get the materialCode - 物料编码 return this.documentDate;
* @return the materialCode }
*/
public String getMaterialCode() { /**
return this.materialCode; * set the documentDate - 单据日期.
} *
* @param documentDate - 单据日期
/** */
* set the materialCode - 物料编码 public void setDocumentDate(String documentDate) {
*/ this.documentDate = documentDate;
public void setMaterialCode(String materialCode) { }
this.materialCode = materialCode; /**
} * get the prodNo - 生产入库单号.
/** * @return the prodNo
* get the materialName - 物料名称 */
* @return the materialName public String getProdNo() {
*/ return this.prodNo;
public String getMaterialName() { }
return this.materialName;
} /**
* set the prodNo - 生产入库单号.
/** *
* set the materialName - 物料名称 * @param prodNo - 生产入库单号
*/ */
public void setMaterialName(String materialName) { public void setProdNo(String prodNo) {
this.materialName = materialName; this.prodNo = prodNo;
} }
/** /**
* get the number - 数量 * get the whCode - 仓库编码.
* @return the number * @return the whCode
*/ */
public String getNumber() { public String getWhCode() {
return this.number; return this.whCode;
} }
/** /**
* set the number - 数量 * set the whCode - 仓库编码.
*/ *
public void setNumber(String number) { * @param whCode - 仓库编码
this.number = number; */
} public void setWhCode(String whCode) {
/** this.whCode = whCode;
* get the weight - 重量 }
* @return the weight /**
*/ * get the whName - 仓库名称.
public String getWeight() { * @return the whName
return this.weight; */
} public String getWhName() {
return this.whName;
/** }
* set the weight - 重量
*/ /**
public void setWeight(String weight) { * set the whName - 仓库名称.
this.weight = weight; *
} * @param whName - 仓库名称
/** */
* get the remark - 备注 public void setWhName(String whName) {
* @return the remark this.whName = whName;
*/ }
public String getRemark() { /**
return this.remark; * get the inventType - 物料类型.
} * @return the inventType
*/
/** public Integer getInventType() {
* set the remark - 备注 return this.inventType;
*/ }
public void setRemark(String remark) {
this.remark = remark; /**
} * set the inventType - 物料类型.
/** *
* get the createdBy - 创建人 * @param inventType - 物料类型
* @return the createdBy */
*/ public void setInventType(Integer inventType) {
public String getCreatedBy() { this.inventType = inventType;
return this.createdBy; }
} /**
* get the inventCode - 物料编码.
/** * @return the inventCode
* set the createdBy - 创建人 */
*/ public String getInventCode() {
public void setCreatedBy(String createdBy) { return this.inventCode;
this.createdBy = createdBy; }
}
/** /**
* get the createdTime - 创建时间 * set the inventCode - 物料编码.
* @return the createdTime *
*/ * @param inventCode - 物料编码
public String getCreatedTime() { */
return this.createdTime; public void setInventCode(String inventCode) {
} this.inventCode = inventCode;
}
/** /**
* set the createdTime - 创建时间 * get the inventName - 物料名称.
*/ * @return the inventName
public void setCreatedTime(String createdTime) { */
this.createdTime = createdTime; public String getInventName() {
} return this.inventName;
/** }
* get the updatedBy - 更新人
* @return the updatedBy /**
*/ * set the inventName - 物料名称.
public String getUpdatedBy() { *
return this.updatedBy; * @param inventName - 物料名称
} */
public void setInventName(String inventName) {
/** this.inventName = inventName;
* set the updatedBy - 更新人 }
*/ /**
public void setUpdatedBy(String updatedBy) { * get the amount - 数量.
this.updatedBy = updatedBy; * @return the amount
} */
/** public BigDecimal getAmount() {
* get the updatedTime - 更新时间 return this.amount;
* @return the updatedTime }
*/
public String getUpdatedTime() { /**
return this.updatedTime; * set the amount - 数量.
} *
* @param amount - 数量
/** */
* set the updatedTime - 更新时间 public void setAmount(BigDecimal amount) {
*/ this.amount = amount;
public void setUpdatedTime(String updatedTime) { }
this.updatedTime = updatedTime; /**
} * get the weight - 重量.
/** * @return the weight
* get the value from Map */
*/ public BigDecimal getWeight() {
public void fromMap(Map map) { return this.weight;
}
setId(NumberUtils.toLong(StringUtils.toString(map.get("id")), id));
setCompanyCode(StringUtils.defaultIfEmpty(StringUtils.toString(map.get("companyCode")), companyCode)); /**
setDepCode(StringUtils.defaultIfEmpty(StringUtils.toString(map.get("depCode")), depCode)); * set the weight - 重量.
setDocumentDate(StringUtils.defaultIfEmpty(StringUtils.toString(map.get("documentDate")), documentDate)); *
setProductionNumber(StringUtils.defaultIfEmpty(StringUtils.toString(map.get("productionNumber")), productionNumber)); * @param weight - 重量
setWarehouseCode(StringUtils.defaultIfEmpty(StringUtils.toString(map.get("warehouseCode")), warehouseCode)); */
setWarehouseName(StringUtils.defaultIfEmpty(StringUtils.toString(map.get("warehouseName")), warehouseName)); public void setWeight(BigDecimal weight) {
setMaterialType(NumberUtils.toint(StringUtils.toString(map.get("materialType")), materialType)); this.weight = weight;
setMaterialCode(StringUtils.defaultIfEmpty(StringUtils.toString(map.get("materialCode")), materialCode)); }
setMaterialName(StringUtils.defaultIfEmpty(StringUtils.toString(map.get("materialName")), materialName)); /**
setNumber(StringUtils.defaultIfEmpty(StringUtils.toString(map.get("number")), number)); * get the remark - 备注.
setWeight(StringUtils.defaultIfEmpty(StringUtils.toString(map.get("weight")), weight)); * @return the remark
setRemark(StringUtils.defaultIfEmpty(StringUtils.toString(map.get("remark")), remark)); */
setCreatedBy(StringUtils.defaultIfEmpty(StringUtils.toString(map.get("createdBy")), createdBy)); public String getRemark() {
setCreatedTime(StringUtils.defaultIfEmpty(StringUtils.toString(map.get("createdTime")), createdTime)); return this.remark;
setUpdatedBy(StringUtils.defaultIfEmpty(StringUtils.toString(map.get("updatedBy")), updatedBy)); }
setUpdatedTime(StringUtils.defaultIfEmpty(StringUtils.toString(map.get("updatedTime")), updatedTime));
} /**
* set the remark - 备注.
/** *
* set the value to Map * @param remark - 备注
*/ */
public Map toMap() { public void setRemark(String remark) {
this.remark = remark;
Map map = new HashMap(); }
map.put("id",StringUtils.toString(id, eiMetadata.getMeta("id"))); /**
map.put("companyCode",StringUtils.toString(companyCode, eiMetadata.getMeta("companyCode"))); * get the createdBy - 创建人.
map.put("depCode",StringUtils.toString(depCode, eiMetadata.getMeta("depCode"))); * @return the createdBy
map.put("documentDate",StringUtils.toString(documentDate, eiMetadata.getMeta("documentDate"))); */
map.put("productionNumber",StringUtils.toString(productionNumber, eiMetadata.getMeta("productionNumber"))); public String getCreatedBy() {
map.put("warehouseCode",StringUtils.toString(warehouseCode, eiMetadata.getMeta("warehouseCode"))); return this.createdBy;
map.put("warehouseName",StringUtils.toString(warehouseName, eiMetadata.getMeta("warehouseName"))); }
map.put("materialType",StringUtils.toString(materialType, eiMetadata.getMeta("materialType")));
map.put("materialCode",StringUtils.toString(materialCode, eiMetadata.getMeta("materialCode"))); /**
map.put("materialName",StringUtils.toString(materialName, eiMetadata.getMeta("materialName"))); * set the createdBy - 创建人.
map.put("number",StringUtils.toString(number, eiMetadata.getMeta("number"))); *
map.put("weight",StringUtils.toString(weight, eiMetadata.getMeta("weight"))); * @param createdBy - 创建人
map.put("remark",StringUtils.toString(remark, eiMetadata.getMeta("remark"))); */
map.put("createdBy",StringUtils.toString(createdBy, eiMetadata.getMeta("createdBy"))); public void setCreatedBy(String createdBy) {
map.put("createdTime",StringUtils.toString(createdTime, eiMetadata.getMeta("createdTime"))); this.createdBy = createdBy;
map.put("updatedBy",StringUtils.toString(updatedBy, eiMetadata.getMeta("updatedBy"))); }
map.put("updatedTime",StringUtils.toString(updatedTime, eiMetadata.getMeta("updatedTime"))); /**
* get the createdName - 创建人名称.
return map; * @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 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 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 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));
setDocumentDate(StringUtils.defaultIfEmpty(StringUtils.toString(map.get(FIELD_DOCUMENT_DATE)), documentDate));
setProdNo(StringUtils.defaultIfEmpty(StringUtils.toString(map.get(FIELD_PROD_NO)), prodNo));
setWhCode(StringUtils.defaultIfEmpty(StringUtils.toString(map.get(FIELD_WH_CODE)), whCode));
setWhName(StringUtils.defaultIfEmpty(StringUtils.toString(map.get(FIELD_WH_NAME)), whName));
setInventType(NumberUtils.toInteger(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));
setAmount(NumberUtils.toBigDecimal(StringUtils.toString(map.get(FIELD_AMOUNT)), amount));
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));
setUpdatedTime(StringUtils.defaultIfEmpty(StringUtils.toString(map.get(FIELD_UPDATED_TIME)), updatedTime));
setUpdatedName(StringUtils.defaultIfEmpty(StringUtils.toString(map.get(FIELD_UPDATED_NAME)), updatedName));
}
/**
* 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_DOCUMENT_DATE, StringUtils.toString(documentDate, eiMetadata.getMeta(FIELD_DOCUMENT_DATE)));
map.put(FIELD_PROD_NO, StringUtils.toString(prodNo, eiMetadata.getMeta(FIELD_PROD_NO)));
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_AMOUNT, StringUtils.toString(amount, eiMetadata.getMeta(FIELD_AMOUNT)));
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_TIME, StringUtils.toString(updatedTime, eiMetadata.getMeta(FIELD_UPDATED_TIME)));
map.put(FIELD_UPDATED_NAME, StringUtils.toString(updatedName, eiMetadata.getMeta(FIELD_UPDATED_NAME)));
return map;
}
} }
...@@ -84,7 +84,7 @@ public class HPKC009 extends DaoEPBase { ...@@ -84,7 +84,7 @@ public class HPKC009 extends DaoEPBase {
private String dateProc = " "; /* 日期*/ private String dateProc = " "; /* 日期*/
private String whCode = " "; /* 仓库编码*/ private String whCode = " "; /* 仓库编码*/
private String whName = " "; /* 仓库名称*/ private String whName = " "; /* 仓库名称*/
private String inventType = " "; /* 存货类型*/ private Integer inventType; /* 存货类型*/
private String inventCode = " "; /* 存货编码*/ private String inventCode = " "; /* 存货编码*/
private String inventName = " "; /* 存货名称*/ private String inventName = " "; /* 存货名称*/
private String spec = " "; /* 规格*/ private String spec = " "; /* 规格*/
...@@ -380,7 +380,7 @@ public class HPKC009 extends DaoEPBase { ...@@ -380,7 +380,7 @@ public class HPKC009 extends DaoEPBase {
* get the inventType - 存货类型. * get the inventType - 存货类型.
* @return the inventType * @return the inventType
*/ */
public String getInventType() { public Integer getInventType() {
return this.inventType; return this.inventType;
} }
...@@ -389,7 +389,7 @@ public class HPKC009 extends DaoEPBase { ...@@ -389,7 +389,7 @@ public class HPKC009 extends DaoEPBase {
* *
* @param inventType - 存货类型 * @param inventType - 存货类型
*/ */
public void setInventType(String inventType) { public void setInventType(Integer inventType) {
this.inventType = inventType; this.inventType = inventType;
} }
/** /**
...@@ -680,7 +680,7 @@ public class HPKC009 extends DaoEPBase { ...@@ -680,7 +680,7 @@ public class HPKC009 extends DaoEPBase {
setDateProc(StringUtils.defaultIfEmpty(StringUtils.toString(map.get(FIELD_DATE_PROC)), dateProc)); setDateProc(StringUtils.defaultIfEmpty(StringUtils.toString(map.get(FIELD_DATE_PROC)), dateProc));
setWhCode(StringUtils.defaultIfEmpty(StringUtils.toString(map.get(FIELD_WH_CODE)), whCode)); setWhCode(StringUtils.defaultIfEmpty(StringUtils.toString(map.get(FIELD_WH_CODE)), whCode));
setWhName(StringUtils.defaultIfEmpty(StringUtils.toString(map.get(FIELD_WH_NAME)), whName)); setWhName(StringUtils.defaultIfEmpty(StringUtils.toString(map.get(FIELD_WH_NAME)), whName));
setInventType(StringUtils.defaultIfEmpty(StringUtils.toString(map.get(FIELD_INVENT_TYPE)), inventType)); setInventType(NumberUtils.toInteger(StringUtils.toString(map.get(FIELD_INVENT_TYPE)), inventType));
setInventCode(StringUtils.defaultIfEmpty(StringUtils.toString(map.get(FIELD_INVENT_CODE)), inventCode)); setInventCode(StringUtils.defaultIfEmpty(StringUtils.toString(map.get(FIELD_INVENT_CODE)), inventCode));
setInventName(StringUtils.defaultIfEmpty(StringUtils.toString(map.get(FIELD_INVENT_NAME)), inventName)); setInventName(StringUtils.defaultIfEmpty(StringUtils.toString(map.get(FIELD_INVENT_NAME)), inventName));
setSpec(StringUtils.defaultIfEmpty(StringUtils.toString(map.get(FIELD_SPEC)), spec)); setSpec(StringUtils.defaultIfEmpty(StringUtils.toString(map.get(FIELD_SPEC)), spec));
......
package com.baosight.hpjx.hp.kc.service; package com.baosight.hpjx.hp.kc.service;
import com.baosight.hpjx.common.DdynamicEnum;
import com.baosight.hpjx.core.constant.CommonConstant;
import com.baosight.hpjx.core.dao.DaoUtils;
import com.baosight.hpjx.hp.constant.HPConstant;
import com.baosight.hpjx.hp.kc.domain.HPKC003; import com.baosight.hpjx.hp.kc.domain.HPKC003;
import com.baosight.hpjx.hp.kc.domain.HPKC009;
import com.baosight.hpjx.hp.pz.domain.HPPZ007;
import com.baosight.hpjx.hp.pz.domain.HPPZ009;
import com.baosight.hpjx.hp.pz.domain.THppz004;
import com.baosight.hpjx.hp.pz.tools.HPPZTools;
import com.baosight.hpjx.util.CommonMethod; import com.baosight.hpjx.util.CommonMethod;
import com.baosight.hpjx.util.LogUtils;
import com.baosight.hpjx.util.StringUtil; import com.baosight.hpjx.util.StringUtil;
import com.baosight.iplat4j.core.ei.EiBlock; import com.baosight.iplat4j.core.ei.EiBlock;
import com.baosight.iplat4j.core.ei.EiConstant; 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.impl.ServiceBase; import com.baosight.iplat4j.core.service.impl.ServiceBase;
import com.baosight.iplat4j.ed.util.SequenceGenerator;
import java.util.Arrays;
import java.util.HashMap;
import java.util.List;
import java.util.Map; import java.util.Map;
/** /**
* @author xuao * @author:songx
* @date 2024年01月12日 14:22 * @date:2024/1/22,10:48
*/ */
public class ServiceHPKC003 extends ServiceBase { public class ServiceHPKC003 extends ServiceBase {
/**
/** * 画面初始化
* 画面初始化. *
*/ * @param inInfo
public EiInfo initLoad(EiInfo inInfo) { * @return
HPKC003 hpkc003 = new HPKC003(); */
EiInfo outInfo = new EiInfo(); public EiInfo initLoad(EiInfo inInfo) {
outInfo.addBlock(EiConstant.resultBlock); try {
outInfo.getBlock(EiConstant.resultBlock).addBlockMeta(hpkc003.eiMetadata); CommonMethod.initBlock(inInfo, Arrays.asList(DdynamicEnum.WH_RECORD_QUERY_BLOCK_ID), null);
return outInfo; CommonMethod.initBlock(inInfo, Arrays.asList(DdynamicEnum.INVENT_NAME_BLOCK_ID), null);
} inInfo.addBlock(EiConstant.resultBlock).addBlockMeta(new HPKC003().eiMetadata);
} catch (Exception e) {
/** LogUtils.setDetailMsg(inInfo, e, "初始化失败");
* 查询操作. }
*/ return inInfo;
@Override }
public EiInfo query(EiInfo inInfo) {
/* 调用EI查询方法.*/ /**
EiInfo outInfo = super.query(inInfo, "HPKC003.query", new HPKC003()); * 查询操作
return outInfo; *
* @param inInfo
} * @return
*/
/** @Override
* 新增操作. public EiInfo query(EiInfo inInfo) {
*/ try {
@Override inInfo = super.query(inInfo, "HPKC003.query", new HPPZ009());
public EiInfo insert(EiInfo inInfo) { } catch (Exception e) {
try { LogUtils.setDetailMsg(inInfo, e, "查询失败");
CommonMethod.creatorInfo(inInfo,EiConstant.resultBlock); }
return inInfo;
for (int i = 0; i < inInfo.getBlock(EiConstant.resultBlock).getRowCount(); i++) { }
// String inventName =inInfo.getCellStr(EiConstant.resultBlock,i,"inventName");
// String[] str = inventName.split("-"); /**
// inInfo.setCell(EiConstant.resultBlock,i,"inventCode", str[0]); * 新增操作
// inInfo.setCell(EiConstant.resultBlock,i,"inventName", str[1]); *
String documentDate = inInfo.getCellStr(EiConstant.resultBlock,i,"documentDate"); * @param inInfo
inInfo.setCell(EiConstant.resultBlock,i,"documentDate", StringUtil.removeHorizontalLine(documentDate)); * @return
*/
} @Override
inInfo.setStatus(EiConstant.STATUS_SUCCESS); public EiInfo insert(EiInfo inInfo) {
inInfo.setMsg("新增成功!"); CommonMethod.creatorInfo(inInfo, EiConstant.resultBlock);
try {
} catch (PlatException e) { List<Map> resultRows = inInfo.getBlock(EiConstant.resultBlock).getRows();
e.printStackTrace(); // 数据写入
inInfo.setStatus(EiConstant.STATUS_FAILURE); for (int i = 0; i < resultRows.size(); i++) {
inInfo.setMsg("新增失败!原因参见详细错误描述!"); HPKC003 fKc003 = new HPKC003();
inInfo.setDetailMsg(e.getMessage()); fKc003.fromMap(resultRows.get(i));
logError("新增失败", e.getMessage()); fKc003.setDocumentDate(StringUtil.removeHorizontalLine(fKc003.getDocumentDate()));
return inInfo; // 仓库名称
} fKc003.setWhName(HPPZTools.getWhNameByCode(fKc003.getWhCode()));
return super.insert(inInfo,"HPKC003.insert"); // 物料名称
} fKc003.setInventName(HPPZTools.getInventNameByCode(fKc003.getInventCode()));
// 生成入库单号
fKc003.setProdNo(SequenceGenerator.getNextSequence(HPConstant.SequenceId.HPKC003_PROD_NO));
/** DaoUtils.insert("HPKC003.insert", fKc003);
* 修改操作. }
*/ inInfo = this.query(inInfo);
public EiInfo update(EiInfo inInfo) { inInfo.setStatus(EiConstant.STATUS_DEFAULT);
try { inInfo.setMsg("操作成功!本次对[" + resultRows.size() + "]条数据新增成功!");
CommonMethod.creatorInfo(inInfo,EiConstant.resultBlock); } catch (Exception e) {
HPKC003 hpkc003 = new HPKC003(); LogUtils.setDetailMsg(inInfo, e, "新增失败");
EiBlock eiBlock = inInfo.getBlock(EiConstant.resultBlock); }
for (int i = 0; i < eiBlock.getRowCount(); i++) { return inInfo;
Map<?, ?> map = eiBlock.getRow(i); }
hpkc003.fromMap(map);
String documentDate = inInfo.getCellStr(EiConstant.resultBlock,i,"documentDate"); /**
inInfo.setCell(EiConstant.resultBlock,i,"documentDate", StringUtil.removeHorizontalLine(documentDate)); * 修改操作
this.dao.update("HPKC003.update", hpkc003.toMap()); *
} * @param inInfo
inInfo.setStatus(EiConstant.STATUS_SUCCESS); * @return
inInfo.setMsg("修改成功!"); */
} catch (PlatException e) { public EiInfo update(EiInfo inInfo) {
inInfo.setStatus(EiConstant.STATUS_FAILURE); try {
inInfo.setMsg("操作失败!原因参见详细错误描述!"); CommonMethod.creatorInfo(inInfo, EiConstant.resultBlock);
inInfo.setDetailMsg(e.getMessage()); List<Map> resultRows = inInfo.getBlock(EiConstant.resultBlock).getRows();
logError("修改失败", e.getMessage()); for (int i = 0; i < resultRows.size(); i++) {
return inInfo; HPKC003 fKc003 = new HPKC003();
} fKc003.fromMap(resultRows.get(i));
return query(inInfo); fKc003.setDocumentDate(StringUtil.removeHorizontalLine(fKc003.getDocumentDate()));
} // 仓库名称
fKc003.setWhName(HPPZTools.getWhNameByCode(fKc003.getWhCode()));
/** // 物料名称
* 删除操作. fKc003.setInventName(HPPZTools.getInventNameByCode(fKc003.getInventCode()));
*/ DaoUtils.update("HPKC003.update", fKc003);
public EiInfo delete(EiInfo eiInfo) { }
HPKC003 hpkc003 = new HPKC003(); inInfo = this.query(inInfo);
EiBlock eiBlock = eiInfo.getBlock(EiConstant.resultBlock); inInfo.setStatus(EiConstant.STATUS_DEFAULT);
try { inInfo.setMsg("操作成功!本次对[" + resultRows.size() + "]条数据新增成功!");
for (int i = 0; i < eiBlock.getRowCount(); i++) { } catch (Exception e) {
Map<?, ?> map = eiBlock.getRow(i); LogUtils.setDetailMsg(inInfo, e, "修改失败");
hpkc003.fromMap(map); }
return inInfo;
this.dao.delete("HPKC003.delete", hpkc003.toMap()); }
}
} catch (PlatException e) { /**
eiInfo.setStatus(EiConstant.STATUS_FAILURE); * 删除操作
eiInfo.setMsg("删除失败,原因参见详细错误描述!"); *
eiInfo.setDetailMsg(e.getMessage()); * @param eiInfo
logError("删除失败!", e.getMessage()); * @return
return eiInfo; */
} public EiInfo delete(EiInfo eiInfo) {
HPKC003 hpkc003 = new HPKC003();
eiInfo.setStatus(EiConstant.STATUS_SUCCESS); EiBlock eiBlock = eiInfo.getBlock(EiConstant.resultBlock);
eiInfo.setMsg("删除成功!"); try {
return eiInfo; for (int i = 0; i < eiBlock.getRowCount(); i++) {
} Map<?, ?> map = eiBlock.getRow(i);
hpkc003.fromMap(map);
this.dao.delete("HPKC003.delete", hpkc003.toMap());
}
eiInfo.setStatus(EiConstant.STATUS_SUCCESS);
eiInfo.setMsg("删除成功!");
} catch (Exception e) {
LogUtils.setDetailMsg(eiInfo, e, "删除失败");
}
return eiInfo;
}
} }
...@@ -30,24 +30,28 @@ import java.util.Map; ...@@ -30,24 +30,28 @@ import java.util.Map;
import java.util.stream.Collectors; import java.util.stream.Collectors;
/** /**
* @author YK *
* @date 2024年01月09日 10:18 * @author:songx
* @date:2024/1/22,10:51
*/ */
public class ServiceHPKC005 extends ServiceBase { public class ServiceHPKC005 extends ServiceBase {
/** /**
* 画面初始化. * 画面初始化
*/ *
public EiInfo initLoad(EiInfo inInfo) { * @param inInfo
HPKC005 HPKC005 = new HPKC005(); * @return
EiInfo outInfo = super.initLoad(inInfo, HPKC005); */
outInfo.addBlock(EiConstant.queryBlock).setCell(0, "receiptDate", CommonMethod.getCurrentSameYearMonth()); public EiInfo initLoad(EiInfo inInfo) {
outInfo.getBlock(EiConstant.resultBlock).getRows().clear(); HPKC005 HPKC005 = new HPKC005();
CommonMethod.initBlock(outInfo, Arrays.asList(DdynamicEnum.WH_RECORD_BLOCK_ID), null); EiInfo outInfo = super.initLoad(inInfo, HPKC005);
CommonMethod.initBlock(outInfo, Arrays.asList(DdynamicEnum.WH_RECORD_QUERY_BLOCK_ID), null); outInfo.addBlock(EiConstant.queryBlock).setCell(0, "receiptDate", CommonMethod.getCurrentSameYearMonth());
CommonMethod.initBlock(outInfo, Arrays.asList(DdynamicEnum.INVENT_SPEC_BLOCK_ID), null); outInfo.getBlock(EiConstant.resultBlock).getRows().clear();
return outInfo; 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.INVENT_SPEC_BLOCK_ID), null);
return outInfo;
}
/** /**
* 查询操作. * 查询操作.
......
...@@ -204,7 +204,7 @@ public class ServiceHPKC009 extends ServiceBase { ...@@ -204,7 +204,7 @@ public class ServiceHPKC009 extends ServiceBase {
+ aItem.getWhCode() + "#" + aItem.getMaterialType() + "#" + aItem.getWhCode() + "#" + aItem.getMaterialType() + "#"
+ aItem.getMaterialCode() + "#" + aItem.getSpec(); + aItem.getMaterialCode() + "#" + aItem.getSpec();
HPKC009 kc009 = BeanUtils.copy(aItem, HPKC009.class); HPKC009 kc009 = BeanUtils.copy(aItem, HPKC009.class);
kc009.setInventType(aItem.getMaterialType()); kc009.setInventType(Integer.parseInt(aItem.getMaterialType()));
kc009.setInventCode(aItem.getMaterialCode()); kc009.setInventCode(aItem.getMaterialCode());
kc009.setKcType(HPConstant.KcType.CG); kc009.setKcType(HPConstant.KcType.CG);
kc009.setDateType(queryMap.get("dateType").toString()); kc009.setDateType(queryMap.get("dateType").toString());
...@@ -251,8 +251,8 @@ public class ServiceHPKC009 extends ServiceBase { ...@@ -251,8 +251,8 @@ public class ServiceHPKC009 extends ServiceBase {
queryMap.put("createdTimeTo", queryMap.get("yesterday") + "235959"); queryMap.put("createdTimeTo", queryMap.get("yesterday") + "235959");
List<HPKC003> bItems = dao.query("HPKC003.statDate", queryMap); List<HPKC003> bItems = dao.query("HPKC003.statDate", queryMap);
Map<String, HPKC003> bItemMap = bItems.stream().collect(Collectors.toMap(item -> Map<String, HPKC003> bItemMap = bItems.stream().collect(Collectors.toMap(item ->
item.getCompanyCode() + "#" + item.getDepCode() + "#" + item.getWarehouseCode() + "#" item.getCompanyCode() + "#" + item.getDepCode() + "#" + item.getWhCode() + "#"
+ item.getMaterialType() + "#" + item.getMaterialCode(), item -> item)); + item.getInventType() + "#" + item.getInventCode(), item -> item));
// 1.3、发出 // 1.3、发出
List<HPKC004> cItems = dao.query("HPKC004.statDate", queryMap); List<HPKC004> cItems = dao.query("HPKC004.statDate", queryMap);
Map<String, HPKC004> cItemMap = cItems.stream().collect(Collectors.toMap(item -> Map<String, HPKC004> cItemMap = cItems.stream().collect(Collectors.toMap(item ->
...@@ -268,22 +268,22 @@ public class ServiceHPKC009 extends ServiceBase { ...@@ -268,22 +268,22 @@ public class ServiceHPKC009 extends ServiceBase {
// 根据期末库存生成收发存对象 // 根据期末库存生成收发存对象
for (HPKC003 aItem : aItems) { for (HPKC003 aItem : aItems) {
String key = aItem.getCompanyCode() + "#" + aItem.getDepCode() + "#" String key = aItem.getCompanyCode() + "#" + aItem.getDepCode() + "#"
+ aItem.getWarehouseCode() + "#" + aItem.getMaterialType() + "#" + aItem.getWhCode() + "#" + aItem.getInventType() + "#"
+ aItem.getMaterialCode(); + aItem.getInventCode();
HPKC009 kc009 = BeanUtils.copy(aItem, HPKC009.class); HPKC009 kc009 = BeanUtils.copy(aItem, HPKC009.class);
kc009.setWhCode(aItem.getWarehouseCode()); kc009.setWhCode(aItem.getWhCode());
kc009.setInventType(aItem.getMaterialType() + ""); kc009.setInventType(aItem.getInventType());
kc009.setInventCode(aItem.getMaterialCode()); kc009.setInventCode(aItem.getInventCode());
kc009.setKcType(HPConstant.KcType.SC); kc009.setKcType(HPConstant.KcType.SC);
kc009.setDateType(queryMap.get("dateType").toString()); kc009.setDateType(queryMap.get("dateType").toString());
kc009.setDateProc(queryMap.get("yesterDate").toString()); kc009.setDateProc(queryMap.get("yesterDate").toString());
// 期末 // 期末
kc009.setEndAmount(new BigDecimal(aItem.getNumber())); kc009.setEndAmount(aItem.getAmount());
kc009.setEndWeight(new BigDecimal(aItem.getWeight())); kc009.setEndWeight(aItem.getWeight());
// 收入 // 收入
HPKC003 bItem = bItemMap.get(key); HPKC003 bItem = bItemMap.get(key);
kc009.setStockinAmount(bItem == null ? BigDecimal.ZERO : new BigDecimal(bItem.getNumber())); kc009.setStockinAmount(bItem == null ? BigDecimal.ZERO : bItem.getAmount());
kc009.setStockinWeight(bItem == null ? BigDecimal.ZERO : new BigDecimal(bItem.getWeight())); kc009.setStockinWeight(bItem == null ? BigDecimal.ZERO : bItem.getWeight());
// 发出 // 发出
HPKC004 cItem = cItemMap.get(key); HPKC004 cItem = cItemMap.get(key);
kc009.setStockoutAmount(cItem == null ? BigDecimal.ZERO : cItem.getAmount()); kc009.setStockoutAmount(cItem == null ? BigDecimal.ZERO : cItem.getAmount());
...@@ -338,7 +338,7 @@ public class ServiceHPKC009 extends ServiceBase { ...@@ -338,7 +338,7 @@ public class ServiceHPKC009 extends ServiceBase {
String key = aItem.getCompanyCode() + "#" + aItem.getDepCode() + "#" String key = aItem.getCompanyCode() + "#" + aItem.getDepCode() + "#"
+ aItem.getWhCode() + "#" + aItem.getMatType() + "#" + aItem.getMatCode(); + aItem.getWhCode() + "#" + aItem.getMatType() + "#" + aItem.getMatCode();
HPKC009 kc009 = BeanUtils.copy(aItem, HPKC009.class); HPKC009 kc009 = BeanUtils.copy(aItem, HPKC009.class);
kc009.setInventType(aItem.getMatType()); kc009.setInventType(Integer.parseInt(aItem.getMatType()));
kc009.setInventCode(aItem.getMatCode()); kc009.setInventCode(aItem.getMatCode());
kc009.setKcType(HPConstant.KcType.QT); kc009.setKcType(HPConstant.KcType.QT);
kc009.setDateType(queryMap.get("dateType").toString()); kc009.setDateType(queryMap.get("dateType").toString());
......
<?xml version="1.0" encoding="UTF-8"?> <?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"> <!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-12 14:21:33
Version : 1.0
tableName :hpjx.t_hpkc003
ID BIGINT NOT NULL primarykey,
COMPANY_CODE VARCHAR NOT NULL,
DEP_CODE VARCHAR,
DOCUMENT_DATE VARCHAR NOT NULL,
PRODUCTION_NUMBER VARCHAR NOT NULL,
WAREHOUSE_CODE VARCHAR NOT NULL,
WAREHOUSE_NAME VARCHAR NOT NULL,
MATERIAL_TYPE TINYINT NOT NULL,
MATERIAL_CODE VARCHAR NOT NULL,
MATERIAL_NAME VARCHAR NOT NULL,
NUMBER VARCHAR NOT NULL,
WEIGHT VARCHAR NOT NULL,
REMARK VARCHAR,
CREATED_BY VARCHAR,
CREATED_TIME VARCHAR,
UPDATED_BY VARCHAR,
UPDATED_TIME VARCHAR
-->
<sqlMap namespace="HPKC003"> <sqlMap namespace="HPKC003">
<select id="query" parameterClass="java.util.HashMap" <sql id="column">
resultClass="com.baosight.hpjx.hp.kc.domain.HPKC003"> ID as "id",
SELECT COMPANY_CODE as "companyCode", <!-- 企业编码 预留 -->
ID as "id", DEP_CODE as "depCode", <!-- 部门编码 -->
COMPANY_CODE as "companyCode", <!-- 企业编码 预留 --> DOCUMENT_DATE as "documentDate", <!-- 单据日期 -->
DEP_CODE as "depCode", <!-- 部门编码 --> PROD_NO as "prodNo", <!-- 生产入库单号 -->
DOCUMENT_DATE as "documentDate", <!-- 单据日期 --> WH_CODE as "whCode", <!-- 仓库编码 -->
PRODUCTION_NUMBER as "productionNumber", <!-- 生产入库单号 --> WH_NAME as "whName", <!-- 仓库名称 -->
WAREHOUSE_CODE as "warehouseCode", <!-- 仓库编码 --> INVENT_TYPE as "inventType", <!-- 物料类型 -->
WAREHOUSE_NAME as "warehouseName", <!-- 仓库名称 --> INVENT_CODE as "inventCode", <!-- 物料编码 -->
MATERIAL_TYPE as "materialType", <!-- 物料类型 --> INVENT_NAME as "inventName", <!-- 物料名称 -->
MATERIAL_CODE as "materialCode", <!-- 物料编码 --> AMOUNT as "amount", <!-- 数量 -->
MATERIAL_NAME as "materialName", <!-- 物料名称 --> WEIGHT as "weight", <!-- 重量 -->
NUMBER as "number", <!-- 数量 --> REMARK as "remark", <!-- 备注 -->
WEIGHT as "weight", <!-- 重量 --> CREATED_BY as "createdBy", <!-- 创建人 -->
REMARK as "remark", <!-- 备注 --> CREATED_NAME as "createdName", <!-- 创建人名称 -->
CREATED_BY as "createdBy", <!-- 创建人 --> CREATED_TIME as "createdTime", <!-- 创建时间 -->
CREATED_TIME as "createdTime", <!-- 创建时间 --> UPDATED_BY as "updatedBy", <!-- 更新人 -->
UPDATED_BY as "updatedBy", <!-- 更新人 --> UPDATED_TIME as "updatedTime", <!-- 更新时间 -->
UPDATED_TIME as "updatedTime" <!-- 更新时间 --> UPDATED_NAME as "updatedName" <!-- 修改人名称 -->
FROM hpjx.t_hpkc003 WHERE 1=1 </sql>
<isNotEmpty prepend=" AND " property="id">
ID = #id#
</isNotEmpty>
<isNotEmpty prepend=" AND " property="documentDate">
DOCUMENT_DATE = #documentDate#
</isNotEmpty>
<isNotEmpty prepend=" AND " property="productionNumber">
PRODUCTION_NUMBER = #productionNumber#
</isNotEmpty>
<isNotEmpty prepend=" AND " property="warehouseName">
WAREHOUSE_NAME = #warehouseName#
</isNotEmpty>
<dynamic prepend="ORDER BY">
<isNotEmpty property="orderBy">
$orderBy$
</isNotEmpty>
<isEmpty property="orderBy">
ID asc
</isEmpty>
</dynamic>
<sql id="condition">
<isNotEmpty prepend=" AND " property="id">
ID = #id#
</isNotEmpty>
<isNotEmpty prepend=" AND " property="documentDate">
DOCUMENT_DATE = #documentDate#
</isNotEmpty>
<isNotEmpty prepend=" AND " property="prodNo">
PROD_NO = #prodNo#
</isNotEmpty>
<isNotEmpty prepend=" AND " property="whCode">
WH_CODE = #whCode#
</isNotEmpty>
<isNotEmpty prepend=" AND " property="whName">
WH_NAME = #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>
</sql>
<sql id="order">
<dynamic prepend="ORDER BY">
<isNotEmpty property="orderBy">
$orderBy$
</isNotEmpty>
<isEmpty property="orderBy">
ID DESC
</isEmpty>
</dynamic>
</sql>
<select id="query" resultClass="com.baosight.hpjx.hp.kc.domain.HPKC003">
SELECT <include refid="column"/>
FROM hpjx.t_hpkc003 WHERE 1=1
<include refid="condition"/>
<include refid="order"/>
</select> </select>
<select id="count" resultClass="int"> <select id="count" resultClass="int">
SELECT COUNT(*) FROM hpjx.t_hpkc003 WHERE 1=1 SELECT COUNT(*) FROM hpjx.t_hpkc003 WHERE 1=1
<isNotEmpty prepend=" AND " property="id"> <include refid="condition"/>
ID = #id#
</isNotEmpty>
</select> </select>
<!--
<isNotEmpty prepend=" AND " property="id">
ID = #id#
</isNotEmpty>
<isNotEmpty prepend=" AND " property="companyCode">
COMPANY_CODE = #companyCode#
</isNotEmpty>
<isNotEmpty prepend=" AND " property="depCode">
DEP_CODE = #depCode#
</isNotEmpty>
<isNotEmpty prepend=" AND " property="documentDate">
DOCUMENT_DATE = #documentDate#
</isNotEmpty>
<isNotEmpty prepend=" AND " property="productionNumber">
PRODUCTION_NUMBER = #productionNumber#
</isNotEmpty>
<isNotEmpty prepend=" AND " property="warehouseCode">
WAREHOUSE_CODE = #warehouseCode#
</isNotEmpty>
<isNotEmpty prepend=" AND " property="warehouseName">
WAREHOUSE_NAME = #warehouseName#
</isNotEmpty>
<isNotEmpty prepend=" AND " property="materialType">
MATERIAL_TYPE = #materialType#
</isNotEmpty>
<isNotEmpty prepend=" AND " property="materialCode">
MATERIAL_CODE = #materialCode#
</isNotEmpty>
<isNotEmpty prepend=" AND " property="materialName">
MATERIAL_NAME = #materialName#
</isNotEmpty>
<isNotEmpty prepend=" AND " property="number">
NUMBER = #number#
</isNotEmpty>
<isNotEmpty prepend=" AND " property="weight">
WEIGHT = #weight#
</isNotEmpty>
<isNotEmpty prepend=" AND " property="remark">
REMARK = #remark#
</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>
-->
<insert id="insert"> <insert id="insert">
INSERT INTO hpjx.t_hpkc003 ( INSERT INTO ${hpjxSchema}.T_HPKC003 (
COMPANY_CODE, <!-- 企业编码 预留 --> COMPANY_CODE, <!-- 企业编码 预留 -->
DEP_CODE, <!-- 部门编码 --> DEPT_CODE, <!-- 部门编码 -->
DOCUMENT_DATE, <!-- 单据日期 --> DOCUMENT_DATE, <!-- 单据日期 -->
PRODUCTION_NUMBER, <!-- 生产入库单号 --> PROD_NO, <!-- 生产入库单号 -->
WAREHOUSE_CODE, <!-- 仓库编码 --> WH_CODE, <!-- 仓库编码 -->
WAREHOUSE_NAME, <!-- 仓库名称 --> WH_NAME, <!-- 仓库名称 -->
MATERIAL_TYPE, <!-- 物料类型 --> INVENT_TYPE, <!-- 物料类型 -->
MATERIAL_CODE, <!-- 物料编码 --> INVENT_CODE, <!-- 物料编码 -->
MATERIAL_NAME, <!-- 物料名称 --> INVENT_NAME, <!-- 物料名称 -->
NUMBER, <!-- 数量 --> AMOUNT, <!-- 数量 -->
WEIGHT, <!-- 重量 --> WEIGHT, <!-- 重量 -->
REMARK, <!-- 备注 --> REMARK, <!-- 备注 -->
CREATED_BY, <!-- 创建人 --> CREATED_BY, <!-- 创建人 -->
CREATED_TIME <!-- 创建时间 --> CREATED_NAME, <!-- 创建人名称 -->
) CREATED_TIME <!-- 创建时间 -->
VALUES ( #companyCode#, #depCode#, #documentDate#, #productionNumber#, #warehouseCode#, #warehouseName#, #materialType#, #materialCode#, #materialName#, #number#, #weight#, #remark#, #createdBy#, #createdTime#) ) VALUES (
</insert> #companyCode#, #deptCode#, #documentDate#, #prodNo#, #whCode#, #whName#,
#inventType#, #inventCode#, #inventName#, #amount#, #weight#, #remark#,
#createdBy#, #createdName#, #createdTime#
)
</insert>
<delete id="delete"> <delete id="delete">
DELETE FROM hpjx.t_hpkc003 WHERE DELETE FROM hpjx.t_hpkc003 WHERE ID = #id#
ID = #id#
</delete> </delete>
<update id="update"> <update id="update">
UPDATE hpjx.t_hpkc003 UPDATE ${hpjxSchema}.T_HPKC003
SET SET
DOCUMENT_DATE = #documentDate#, <!-- 单据日期 --> COMPANY_CODE = #companyCode#, <!-- 企业编码 预留 -->
PRODUCTION_NUMBER = #productionNumber#, <!-- 生产入库单号 --> DEPT_CODE = #deptCode#, <!-- 部门编码 -->
WAREHOUSE_CODE = #warehouseCode#, <!-- 仓库编码 --> DOCUMENT_DATE = #documentDate#, <!-- 单据日期 -->
WAREHOUSE_NAME = #warehouseName#, <!-- 仓库名称 --> PROD_NO = #prodNo#, <!-- 生产入库单号 -->
MATERIAL_TYPE = #materialType#, <!-- 物料类型 --> WH_CODE = #whCode#, <!-- 仓库编码 -->
MATERIAL_CODE = #materialCode#, <!-- 物料编码 --> WH_NAME = #whName#, <!-- 仓库名称 -->
MATERIAL_NAME = #materialName#, <!-- 物料名称 --> INVENT_TYPE = #inventType#, <!-- 物料类型 -->
NUMBER = #number#, <!-- 数量 --> INVENT_CODE = #inventCode#, <!-- 物料编码 -->
WEIGHT = #weight#, <!-- 重量 --> INVENT_NAME = #inventName#, <!-- 物料名称 -->
REMARK = #remark#, <!-- 备注 --> AMOUNT = #amount#, <!-- 数量 -->
UPDATED_BY = #updatedBy#, <!-- 更新人 --> WEIGHT = #weight#, <!-- 重量 -->
UPDATED_TIME = #updatedTime# <!-- 更新时间 --> REMARK = #remark#, <!-- 备注 -->
WHERE UPDATED_BY = #updatedBy#, <!-- 更新人 -->
ID = #id# UPDATED_TIME = #updatedTime#, <!-- 更新时间 -->
UPDATED_NAME = #updatedName# <!-- 修改人名称 -->
WHERE ID = #id#
</update> </update>
<!-- 统计库存 --> <!-- 统计库存 -->
<select id="statDate" resultClass="com.baosight.hpjx.hp.kc.domain.HPKC003"> <select id="statDate" resultClass="com.baosight.hpjx.hp.kc.domain.HPKC003">
SELECT SELECT
COMPANY_CODE AS "companyCode", COMPANY_CODE AS "companyCode",
DEP_CODE AS "depCode", DEPT_CODE AS "deptCode",
WAREHOUSE_CODE AS "warehouseCode", WH_CODE AS "whCode",
MATERIAL_TYPE AS "materialType", INVENT_TYPE AS "inventType",
MATERIAL_CODE AS "materialCode", INVENT_CODE AS "inventCode",
COALESCE(SUM(NUMBER), 0) AS "number", COALESCE(SUM(AMOUNT), 0) AS "amount",
COALESCE(SUM(WEIGHT), 0) AS "weight" COALESCE(SUM(WEIGHT), 0) AS "weight"
FROM ${hpjxSchema}.T_HPKC003 FROM ${hpjxSchema}.T_HPKC003
WHERE 1=1 WHERE 1=1
<isNotEmpty prepend=" AND " property="createdTimeFrom"> <isNotEmpty prepend=" AND " property="createdTimeFrom">
CREATED_TIME BETWEEN #createdTimeFrom# AND #createdTimeTo# CREATED_TIME BETWEEN #createdTimeFrom# AND #createdTimeTo#
</isNotEmpty> </isNotEmpty>
GROUP BY COMPANY_CODE, DEP_CODE, WAREHOUSE_CODE, MATERIAL_TYPE, MATERIAL_CODE GROUP BY COMPANY_CODE, DEPT_CODE, WH_CODE, INVENT_TYPE, INVENT_CODE
</select> </select>
</sqlMap> </sqlMap>
...@@ -154,15 +154,10 @@ ...@@ -154,15 +154,10 @@
ORDER BY WH_CODE ORDER BY WH_CODE
</select> </select>
<select id="queryByWhCode" parameterClass="java.util.HashMap" <select id="queryByWhCode" resultClass="com.baosight.hpjx.hp.pz.domain.HPPZ007">
resultClass="com.baosight.hpjx.hp.pz.domain.HPPZ007">
SELECT WH_NAME as "whName" SELECT WH_NAME as "whName"
FROM hpjx.t_hppz007 WHERE 1=1 FROM hpjx.t_hppz007 WHERE 1=1
<isNotEmpty prepend=" AND " property="whCode"> AND WH_CODE = #whCode#
WH_CODE = #whCode#
</isNotEmpty>
</select> </select>
</sqlMap> </sqlMap>
...@@ -21,6 +21,34 @@ import java.util.stream.Collectors; ...@@ -21,6 +21,34 @@ import java.util.stream.Collectors;
public class HPPZTools { public class HPPZTools {
/** /**
* 查询存货名称
*
* @param inventCode
* @return
*/
public static String getInventNameByCode(String inventCode) {
AssertUtils.isEmpty(inventCode, "存货编码不能为空");
Map queryMap = new HashMap();
queryMap.put("inventCode", inventCode);
List<THppz004> pz004s = DaoBase.getInstance().query("HPPZ004.queryMatNameByCode", queryMap);
return CollectionUtils.isEmpty(pz004s) ? null : pz004s.get(0).getInventName();
}
/**
* 查询仓库名称
*
* @param whCode
* @return
*/
public static String getWhNameByCode(String whCode) {
AssertUtils.isEmpty(whCode, "仓库编码不能为空");
Map queryMap = new HashMap();
queryMap.put("whCode", whCode);
List<HPPZ007> pz007s = DaoBase.getInstance().query("HPPZ007.queryByWhCode", queryMap);
return CollectionUtils.isEmpty(pz007s) ? null : pz007s.get(0).getWhName();
}
/**
* 查询存货信息 * 查询存货信息
* *
* @param inventCodes * @param inventCodes
......
...@@ -52,15 +52,11 @@ ...@@ -52,15 +52,11 @@
AND MEMBER_ID = #memberId# AND MEMBER_ID = #memberId#
</select> </select>
<!-- 用户组查询 --> <!-- 查询用户组织机构 -->
<select id="queryGroupEname" resultClass="java.util.LinkedHashMap"> <select id="queryOrgId" resultClass="java.util.LinkedHashMap">
SELECT SELECT ORG_ID AS "orgId"
ID as "id", <!-- id --> FROM ${platSchema}.TXSOG02
GROUP_ENAME as "groupEname", <!-- 用户组id --> WHERE USER_ID = #userId#
GROUP_CNAME as "groupCname" <!-- 用户组名字 -->
FROM ${platSchema}.XS_USER_GROUP
WHERE 1=1
AND ID IN <iterate close=")" open="(" conjunction="," property="ids">#ids[]#</iterate>
</select> </select>
</sqlMap> </sqlMap>
package com.baosight.hpjx.hp.xs.tools; package com.baosight.hpjx.hp.xs.tools;
import com.baosight.hpjx.core.dao.DaoBase; import com.baosight.hpjx.core.dao.DaoBase;
import com.baosight.iplat4j.core.web.threadlocal.UserSession;
import org.springframework.util.CollectionUtils; import org.springframework.util.CollectionUtils;
import java.util.HashMap; import java.util.HashMap;
...@@ -26,4 +27,16 @@ public class HPXSUserTools { ...@@ -26,4 +27,16 @@ public class HPXSUserTools {
return CollectionUtils.isEmpty(results) ? 0 : results.get(0); return CollectionUtils.isEmpty(results) ? 0 : results.get(0);
} }
/**
* 查询用户组织机构
*
* @return
*/
public static String getOrgId() {
Map paramMap = new HashMap();
paramMap.put("userId", UserSession.getLoginName());
List<Map> results = DaoBase.getInstance().query("HPXSUser.queryOrgId", paramMap);
return CollectionUtils.isEmpty(results) ? "" : results.get(0).get("orgId").toString();
}
} }
let inventNameGlobalData = [];
$(function () { $(function () {
$("#QUERY").on("click", function () { $("#QUERY").on("click", query);
resultGrid.dataSource.page(1);
});
IPLATUI.EFGrid.result = { IPLATUI.EFGrid.result = {
pageable: { pageable: {
pageSize: 20, pageSize: 20,
pageSizes: [10, 20, 30, 50, 100, 200], pageSizes: [10, 20, 30, 50, 100, 200],
}, },
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 "";
},
editor: function (container, options) {
var grid = container.closest(".k-grid").data("kendoGrid");
var cellIndex = grid.cellIndex(container);
var input = $('<input />');
input.attr("name", options.field);
input.attr("id", options.field);
input.appendTo(container);
let eiInfo = new EiInfo();
eiInfo.set("inventType", options.model["inventType"]);
var dataSource;
EiCommunicator.send("HPPZ004", "queryComboBox", eiInfo, {
onSuccess: function (ei) {
dataSource = ei.getBlock("invent_name_block_id").getMappedRows();
inventNameGlobalData = dataSource;
},
onFail: function (ei) {
}
}, {async: false});
input.kendoDropDownList({
valuePrimitive: true,
dataTextField: "textField",
dataValueField: "valueField",
dataSource: dataSource,
template: "#=textField#"
});
}
}]
}
}
}); });
/**
* 页面加载时执行
*/
$(window).load(function () {
// 存货名称
let inInfo = new EiInfo();
EiCommunicator.send("HPPZ004", "queryComboBox", inInfo, {
onSuccess: function (ei) {
inventNameGlobalData = ei.getBlock("invent_name_block_id").getMappedRows();
},
onFail: function (ei) {
}
}, {async: false});
// 查询
query();
});
/**
* 查询
*/
let query = function () {
resultGrid.dataSource.page(1);
}
...@@ -6,40 +6,47 @@ ...@@ -6,40 +6,47 @@
<c:set var="ctx" value="${pageContext.request.contextPath}"/> <c:set var="ctx" value="${pageContext.request.contextPath}"/>
<EF:EFPage title="生产入库单"> <EF:EFPage title="生产入库单">
<EF:EFRegion id="inqu" title="查询条件"> <EF:EFRegion id="inqu" title="查询条件">
<div class="row"> <div class="row">
<EF:EFDatePicker ename="inqu_status-0-documentDate" cname="单据日期" <EF:EFDatePicker ename="inqu_status-0-documentDate" cname="单据日期" colWidth="3" format="yyyy-MM-dd"
format="yyyy-MM-dd"/> readonly="true"/>
<EF:EFInput ename="inqu_status-0-productionNumber" cname="生产入库单号" colWidth="4" readonly="false"/> <EF:EFInput ename="inqu_status-0-prodNo" cname="生产入库单号" colWidth="3"/>
<EF:EFInput ename="inqu_status-0-warehouseName" cname="仓库名称" colWidth="4" readonly="false"/> <EF:EFSelect ename="inqu_status-0-whCode" cname="仓库名称" colWidth="3" filter="contains" defultValue="">
</div> <EF:EFOption label="请选择" value=""/>
<EF:EFButton ename="QUERY" cname="查询" row="1" class="btn-align-right"></EF:EFButton> <EF:EFOptions blockId="whName_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=""/>
<EF:EFOptions blockId="invent_name_block_id" textField="textField" valueField="valueField"/>
</EF:EFSelect>
</div>
</EF:EFRegion> </EF:EFRegion>
<EF:EFRegion id="result" title="明细信息"> <EF:EFRegion id="result" title="明细信息">
<EF:EFGrid blockId="result" autoDraw="false" isFloat="true" autoFit="true"> <EF:EFGrid blockId="result" autoDraw="false" isFloat="true" autoFit="true">
<EF:EFColumn ename="id" cname="内码" hidden="true"/>
<EF:EFColumn ename="id" cname="内码" hidden="true"/> <EF:EFColumn ename="prodNo" cname="生产入库单号" enable="false" width="130" align="center"/>
<EF:EFColumn ename="documentDate" cname="单据日期" editType="date" dateFormat="yyyy-MM-dd" parseFormats="['yyyyMMdd']" width="100" readonly="false" /> <EF:EFColumn ename="documentDate" cname="单据日期" width="100" align="center" editType="date"
<EF:EFColumn ename="productionNumber" cname="生产入库单号" width="100" readonly="false" required="true"/> dateFormat="yyyy-MM-dd" parseFormats="['yyyyMMdd']" required="true"/>
<EF:EFColumn ename="warehouseCode" cname="仓库编码" width="100" readonly="false" required="true"/> <EF:EFComboColumn cname="仓库名称" ename="whCode" columnTemplate="#=textField#"
<EF:EFColumn ename="warehouseName" cname="仓库名称" width="100" readonly="false" required="true"/> itemTemplate="#=textField#" blockName="whName_block_id"
<EF:EFComboColumn ename="materialType" cname="物料类型" align="center" textField="textField" valueField="valueField"
columnTemplate="#=valueField#-#=textField#" optionLabel=" " align="center" filter="contains" width="100">
itemTemplate="#=valueField#-#=textField#" textField="textField" </EF:EFComboColumn>
valueField="valueField" width="100"> <EF:EFComboColumn cname="存货类型" ename="inventType" width="90" align="center">
<EF:EFOption label="--请选择--" value=""></EF:EFOption> <EF:EFCodeOption codeName="hpjx.hpkc.inventType"/>
<EF:EFOption label="待补充" value="1"></EF:EFOption> </EF:EFComboColumn>
</EF:EFComboColumn> <EF:EFColumn cname="存货名称" ename="inventCode" width="120" align="center"/>
<EF:EFColumn ename="materialCode" cname="物料编码" width="100" readonly="false" required="true"/> <EF:EFColumn cname="数量" ename="amount" width="100" align="right" format="{0:N3}"
<EF:EFColumn ename="materialName" cname="物料名称" width="100" readonly="false" required="true"/> sumType="all"/>
<EF:EFColumn ename="number" cname="数量" width="100" readonly="false" required="true"/> <EF:EFColumn cname="重量" ename="weight" width="100" align="right" format="{0:N3}"
<EF:EFColumn ename="weight" cname="重量" width="100" readonly="false" required="true"/> sumType="all"/>
<EF:EFColumn ename="remark" cname="备注" width="100" readonly="false" /> <EF:EFColumn ename="remark" cname="备注" width="150" editType="textarea"/>
<EF:EFColumn cname="创建人名称" ename="createdName" enable="false" width="120" align="center"/>
</EF:EFGrid> <EF:EFColumn cname="创建时间" ename="createdTime" enable="false" width="140" align="center"
</EF:EFRegion> editType="datetime" parseFormats="['yyyyMMddHHmmss','yyyy-MM-dd HH:mm:ss']"/>
</EF:EFGrid>
</EF:EFRegion>
</EF:EFPage> </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