Commit dd8026da by 宋祥

1.生产入库单页面调整

parent abfcdd85
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.DateUtils;
import com.baosight.iplat4j.core.data.DaoEPBase;
......@@ -103,6 +105,24 @@ public class DaoUtils {
} catch (Exception 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 {
BeanUtils.setProperty(bean, "createdTime", DateUtils.shortDateTime());
......@@ -141,6 +161,24 @@ public class DaoUtils {
}
map.put("createdName", userName);
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 {
map.put("createdTime", DateUtils.shortDateTime());
......
......@@ -20,6 +20,8 @@ public class HPConstant {
public static final String HPKC008_NUMBER = "HPKC008_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;
import com.baosight.iplat4j.core.util.NumberUtils;
import java.math.BigDecimal;
import com.baosight.iplat4j.core.ei.EiColumn;
import com.baosight.iplat4j.core.data.DaoEPBase;
import java.util.HashMap;
......@@ -11,114 +9,180 @@ import java.util.Map;
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 {
private Long id = 0L;
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_DOCUMENT_DATE = "documentDate"; /* 单据日期*/
public static final String FIELD_PROD_NO = "prodNo"; /* 生产入库单号*/
public static final String FIELD_WH_CODE = "whCode"; /* 仓库编码*/
public static final String FIELD_WH_NAME = "whName"; /* 仓库名称*/
public static final String FIELD_INVENT_TYPE = "inventType"; /* 物料类型*/
public static final String FIELD_INVENT_CODE = "inventCode"; /* 物料编码*/
public static final String FIELD_INVENT_NAME = "inventName"; /* 物料名称*/
public static final String FIELD_AMOUNT = "amount"; /* 数量*/
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_TIME = "updatedTime"; /* 更新时间*/
public static final String FIELD_UPDATED_NAME = "updatedName"; /* 修改人名称*/
public static final String COL_ID = "ID";
public static final String COL_COMPANY_CODE = "COMPANY_CODE"; /* 企业编码 预留*/
public static final String COL_DEP_CODE = "DEP_CODE"; /* 部门编码*/
public static final String COL_DOCUMENT_DATE = "DOCUMENT_DATE"; /* 单据日期*/
public static final String COL_PROD_NO = "PROD_NO"; /* 生产入库单号*/
public static final String COL_WH_CODE = "WH_CODE"; /* 仓库编码*/
public static final String COL_WH_NAME = "WH_NAME"; /* 仓库名称*/
public static final String COL_INVENT_TYPE = "INVENT_TYPE"; /* 物料类型*/
public static final String COL_INVENT_CODE = "INVENT_CODE"; /* 物料编码*/
public static final String COL_INVENT_NAME = "INVENT_NAME"; /* 物料名称*/
public static final String COL_AMOUNT = "AMOUNT"; /* 数量*/
public static final String COL_WEIGHT = "WEIGHT"; /* 重量*/
public static final String COL_REMARK = "REMARK"; /* 备注*/
public static final String COL_CREATED_BY = "CREATED_BY"; /* 创建人*/
public static final String COL_CREATED_NAME = "CREATED_NAME"; /* 创建人名称*/
public static final String COL_CREATED_TIME = "CREATED_TIME"; /* 创建时间*/
public static final String COL_UPDATED_BY = "UPDATED_BY"; /* 更新人*/
public static final String COL_UPDATED_TIME = "UPDATED_TIME"; /* 更新时间*/
public static final String COL_UPDATED_NAME = "UPDATED_NAME"; /* 修改人名称*/
private Long id = null;
private String companyCode = " "; /* 企业编码 预留*/
private String depCode = " "; /* 部门编码*/
private String documentDate = " "; /* 单据日期*/
private String productionNumber = " "; /* 生产入库单号*/
private String warehouseCode = " "; /* 仓库编码*/
private String warehouseName = " "; /* 仓库名称*/
private int materialType; /* 物料类型*/
private String materialCode = " "; /* 物料编码*/
private String materialName = " "; /* 物料名称*/
private String number = " "; /* 数量*/
private String weight = " "; /* 重量*/
private String prodNo = " "; /* 生产入库单号*/
private String whCode = " "; /* 仓库编码*/
private String whName = " "; /* 仓库名称*/
private Integer inventType; /* 物料类型*/
private String inventCode = " "; /* 物料编码*/
private String inventName = " "; /* 物料名称*/
private BigDecimal amount = new BigDecimal(0.00); /* 数量*/
private BigDecimal weight = new BigDecimal(0.00); /* 重量*/
private String remark = " "; /* 备注*/
private String createdBy = " "; /* 创建人*/
private String createdName = " "; /* 创建人名称*/
private String createdTime = " "; /* 创建时间*/
private String updatedBy = " "; /* 更新人*/
private String updatedTime = " "; /* 更新时间*/
/**
* initialize the metadata
*/
public void initMetaData() {
EiColumn eiColumn;
private String updatedName = " "; /* 修改人名称*/
/**
* initialize the metadata.
*/
public void initMetaData() {
EiColumn eiColumn;
eiColumn = new EiColumn("id");
eiColumn = new EiColumn(FIELD_ID);
eiColumn.setPrimaryKey(true);
eiColumn.setDescName(" ");
eiMetadata.addMeta(eiColumn);
eiColumn = new EiColumn("companyCode");
eiColumn = new EiColumn(FIELD_COMPANY_CODE);
eiColumn.setDescName("企业编码 预留");
eiMetadata.addMeta(eiColumn);
eiColumn = new EiColumn("depCode");
eiColumn = new EiColumn(FIELD_DEP_CODE);
eiColumn.setDescName("部门编码");
eiMetadata.addMeta(eiColumn);
eiColumn = new EiColumn("documentDate");
eiColumn = new EiColumn(FIELD_DOCUMENT_DATE);
eiColumn.setDescName("单据日期");
eiMetadata.addMeta(eiColumn);
eiColumn = new EiColumn("productionNumber");
eiColumn = new EiColumn(FIELD_PROD_NO);
eiColumn.setDescName("生产入库单号");
eiMetadata.addMeta(eiColumn);
eiColumn = new EiColumn("warehouseCode");
eiColumn = new EiColumn(FIELD_WH_CODE);
eiColumn.setDescName("仓库编码");
eiMetadata.addMeta(eiColumn);
eiColumn = new EiColumn("warehouseName");
eiColumn = new EiColumn(FIELD_WH_NAME);
eiColumn.setDescName("仓库名称");
eiMetadata.addMeta(eiColumn);
eiColumn = new EiColumn("materialType");
eiColumn = new EiColumn(FIELD_INVENT_TYPE);
eiColumn.setDescName("物料类型");
eiMetadata.addMeta(eiColumn);
eiColumn = new EiColumn("materialCode");
eiColumn = new EiColumn(FIELD_INVENT_CODE);
eiColumn.setDescName("物料编码");
eiMetadata.addMeta(eiColumn);
eiColumn = new EiColumn("materialName");
eiColumn = new EiColumn(FIELD_INVENT_NAME);
eiColumn.setDescName("物料名称");
eiMetadata.addMeta(eiColumn);
eiColumn = new EiColumn("number");
eiColumn = new EiColumn(FIELD_AMOUNT);
eiColumn.setType("N");
eiColumn.setScaleLength(2);
eiColumn.setFieldLength(10);
eiColumn.setDescName("数量");
eiMetadata.addMeta(eiColumn);
eiColumn = new EiColumn("weight");
eiColumn = new EiColumn(FIELD_WEIGHT);
eiColumn.setType("N");
eiColumn.setScaleLength(2);
eiColumn.setFieldLength(10);
eiColumn.setDescName("重量");
eiMetadata.addMeta(eiColumn);
eiColumn = new EiColumn("remark");
eiColumn = new EiColumn(FIELD_REMARK);
eiColumn.setDescName("备注");
eiMetadata.addMeta(eiColumn);
eiColumn = new EiColumn("createdBy");
eiColumn = new EiColumn(FIELD_CREATED_BY);
eiColumn.setDescName("创建人");
eiMetadata.addMeta(eiColumn);
eiColumn = new EiColumn("createdTime");
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("updatedBy");
eiColumn = new EiColumn(FIELD_UPDATED_BY);
eiColumn.setDescName("更新人");
eiMetadata.addMeta(eiColumn);
eiColumn = new EiColumn("updatedTime");
eiColumn = new EiColumn(FIELD_UPDATED_TIME);
eiColumn.setDescName("更新时间");
eiMetadata.addMeta(eiColumn);
eiColumn = new EiColumn(FIELD_UPDATED_NAME);
eiColumn.setDescName("修改人名称");
eiMetadata.addMeta(eiColumn);
}
/**
* the constructor
*/
public HPKC003() {
initMetaData();
}
}
/**
* get the id
* the constructor.
*/
public HPKC003() {
initMetaData();
}
/**
* get the id .
* @return the id
*/
public Long getId() {
......@@ -126,13 +190,15 @@ initMetaData();
}
/**
* set the id
* set the id .
*
* @param id
*/
public void setId(Long id) {
this.id = id;
}
/**
* get the companyCode - 企业编码 预留
* get the companyCode - 企业编码 预留.
* @return the companyCode
*/
public String getCompanyCode() {
......@@ -140,27 +206,31 @@ initMetaData();
}
/**
* set the companyCode - 企业编码 预留
* set the companyCode - 企业编码 预留.
*
* @param companyCode - 企业编码 预留
*/
public void setCompanyCode(String companyCode) {
this.companyCode = companyCode;
}
/**
* get the depCode - 部门编码
* @return the depCode
* get the depCode - 部门编码.
* @return the deptCode
*/
public String getDepCode() {
return this.depCode;
}
/**
* set the depCode - 部门编码
* set the deptCode - 部门编码.
*
* @param depCode - 部门编码
*/
public void setDepCode(String depCode) {
this.depCode = depCode;
}
/**
* get the documentDate - 单据日期
* get the documentDate - 单据日期.
* @return the documentDate
*/
public String getDocumentDate() {
......@@ -168,125 +238,143 @@ initMetaData();
}
/**
* set the documentDate - 单据日期
* set the documentDate - 单据日期.
*
* @param documentDate - 单据日期
*/
public void setDocumentDate(String documentDate) {
this.documentDate = documentDate;
}
/**
* get the productionNumber - 生产入库单号
* @return the productionNumber
* get the prodNo - 生产入库单号.
* @return the prodNo
*/
public String getProductionNumber() {
return this.productionNumber;
public String getProdNo() {
return this.prodNo;
}
/**
* set the productionNumber - 生产入库单号
* set the prodNo - 生产入库单号.
*
* @param prodNo - 生产入库单号
*/
public void setProductionNumber(String productionNumber) {
this.productionNumber = productionNumber;
public void setProdNo(String prodNo) {
this.prodNo = prodNo;
}
/**
* get the warehouseCode - 仓库编码
* @return the warehouseCode
* get the whCode - 仓库编码.
* @return the whCode
*/
public String getWarehouseCode() {
return this.warehouseCode;
public String getWhCode() {
return this.whCode;
}
/**
* set the warehouseCode - 仓库编码
* set the whCode - 仓库编码.
*
* @param whCode - 仓库编码
*/
public void setWarehouseCode(String warehouseCode) {
this.warehouseCode = warehouseCode;
public void setWhCode(String whCode) {
this.whCode = whCode;
}
/**
* get the warehouseName - 仓库名称
* @return the warehouseName
* get the whName - 仓库名称.
* @return the whName
*/
public String getWarehouseName() {
return this.warehouseName;
public String getWhName() {
return this.whName;
}
/**
* set the warehouseName - 仓库名称
* set the whName - 仓库名称.
*
* @param whName - 仓库名称
*/
public void setWarehouseName(String warehouseName) {
this.warehouseName = warehouseName;
public void setWhName(String whName) {
this.whName = whName;
}
/**
* get the materialType - 物料类型
* @return the materialType
* get the inventType - 物料类型.
* @return the inventType
*/
public int getMaterialType() {
return this.materialType;
public Integer getInventType() {
return this.inventType;
}
/**
* set the materialType - 物料类型
* set the inventType - 物料类型.
*
* @param inventType - 物料类型
*/
public void setMaterialType(int materialType) {
this.materialType = materialType;
public void setInventType(Integer inventType) {
this.inventType = inventType;
}
/**
* get the materialCode - 物料编码
* @return the materialCode
* get the inventCode - 物料编码.
* @return the inventCode
*/
public String getMaterialCode() {
return this.materialCode;
public String getInventCode() {
return this.inventCode;
}
/**
* set the materialCode - 物料编码
* set the inventCode - 物料编码.
*
* @param inventCode - 物料编码
*/
public void setMaterialCode(String materialCode) {
this.materialCode = materialCode;
public void setInventCode(String inventCode) {
this.inventCode = inventCode;
}
/**
* get the materialName - 物料名称
* @return the materialName
* get the inventName - 物料名称.
* @return the inventName
*/
public String getMaterialName() {
return this.materialName;
public String getInventName() {
return this.inventName;
}
/**
* set the materialName - 物料名称
* set the inventName - 物料名称.
*
* @param inventName - 物料名称
*/
public void setMaterialName(String materialName) {
this.materialName = materialName;
public void setInventName(String inventName) {
this.inventName = inventName;
}
/**
* get the number - 数量
* @return the number
* get the amount - 数量.
* @return the amount
*/
public String getNumber() {
return this.number;
public BigDecimal getAmount() {
return this.amount;
}
/**
* set the number - 数量
* set the amount - 数量.
*
* @param amount - 数量
*/
public void setNumber(String number) {
this.number = number;
public void setAmount(BigDecimal amount) {
this.amount = amount;
}
/**
* get the weight - 重量
* get the weight - 重量.
* @return the weight
*/
public String getWeight() {
public BigDecimal getWeight() {
return this.weight;
}
/**
* set the weight - 重量
* set the weight - 重量.
*
* @param weight - 重量
*/
public void setWeight(String weight) {
public void setWeight(BigDecimal weight) {
this.weight = weight;
}
/**
* get the remark - 备注
* get the remark - 备注.
* @return the remark
*/
public String getRemark() {
......@@ -294,13 +382,15 @@ initMetaData();
}
/**
* set the remark - 备注
* set the remark - 备注.
*
* @param remark - 备注
*/
public void setRemark(String remark) {
this.remark = remark;
}
/**
* get the createdBy - 创建人
* get the createdBy - 创建人.
* @return the createdBy
*/
public String getCreatedBy() {
......@@ -308,13 +398,31 @@ initMetaData();
}
/**
* set the createdBy - 创建人
* set the createdBy - 创建人.
*
* @param createdBy - 创建人
*/
public void setCreatedBy(String createdBy) {
this.createdBy = createdBy;
}
/**
* get the createdTime - 创建时间
* 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() {
......@@ -322,13 +430,15 @@ initMetaData();
}
/**
* set the createdTime - 创建时间
* set the createdTime - 创建时间.
*
* @param createdTime - 创建时间
*/
public void setCreatedTime(String createdTime) {
this.createdTime = createdTime;
}
/**
* get the updatedBy - 更新人
* get the updatedBy - 更新人.
* @return the updatedBy
*/
public String getUpdatedBy() {
......@@ -336,13 +446,15 @@ initMetaData();
}
/**
* set the updatedBy - 更新人
* set the updatedBy - 更新人.
*
* @param updatedBy - 更新人
*/
public void setUpdatedBy(String updatedBy) {
this.updatedBy = updatedBy;
}
/**
* get the updatedTime - 更新时间
* get the updatedTime - 更新时间.
* @return the updatedTime
*/
public String getUpdatedTime() {
......@@ -350,60 +462,85 @@ initMetaData();
}
/**
* set the updatedTime - 更新时间
* set the updatedTime - 更新时间.
*
* @param updatedTime - 更新时间
*/
public void setUpdatedTime(String updatedTime) {
this.updatedTime = updatedTime;
}
/**
* get the value from Map
*/
public void fromMap(Map map) {
setId(NumberUtils.toLong(StringUtils.toString(map.get("id")), id));
setCompanyCode(StringUtils.defaultIfEmpty(StringUtils.toString(map.get("companyCode")), companyCode));
setDepCode(StringUtils.defaultIfEmpty(StringUtils.toString(map.get("depCode")), depCode));
setDocumentDate(StringUtils.defaultIfEmpty(StringUtils.toString(map.get("documentDate")), documentDate));
setProductionNumber(StringUtils.defaultIfEmpty(StringUtils.toString(map.get("productionNumber")), productionNumber));
setWarehouseCode(StringUtils.defaultIfEmpty(StringUtils.toString(map.get("warehouseCode")), warehouseCode));
setWarehouseName(StringUtils.defaultIfEmpty(StringUtils.toString(map.get("warehouseName")), warehouseName));
setMaterialType(NumberUtils.toint(StringUtils.toString(map.get("materialType")), materialType));
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));
setWeight(StringUtils.defaultIfEmpty(StringUtils.toString(map.get("weight")), weight));
setRemark(StringUtils.defaultIfEmpty(StringUtils.toString(map.get("remark")), remark));
setCreatedBy(StringUtils.defaultIfEmpty(StringUtils.toString(map.get("createdBy")), createdBy));
setCreatedTime(StringUtils.defaultIfEmpty(StringUtils.toString(map.get("createdTime")), createdTime));
setUpdatedBy(StringUtils.defaultIfEmpty(StringUtils.toString(map.get("updatedBy")), updatedBy));
setUpdatedTime(StringUtils.defaultIfEmpty(StringUtils.toString(map.get("updatedTime")), updatedTime));
}
/**
* get the updatedName - 修改人名称.
* @return the updatedName
*/
public String getUpdatedName() {
return this.updatedName;
}
/**
* set the value to Map
*/
public Map toMap() {
Map map = new HashMap();
map.put("id",StringUtils.toString(id, eiMetadata.getMeta("id")));
map.put("companyCode",StringUtils.toString(companyCode, eiMetadata.getMeta("companyCode")));
map.put("depCode",StringUtils.toString(depCode, eiMetadata.getMeta("depCode")));
map.put("documentDate",StringUtils.toString(documentDate, eiMetadata.getMeta("documentDate")));
map.put("productionNumber",StringUtils.toString(productionNumber, eiMetadata.getMeta("productionNumber")));
map.put("warehouseCode",StringUtils.toString(warehouseCode, eiMetadata.getMeta("warehouseCode")));
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")));
map.put("number",StringUtils.toString(number, eiMetadata.getMeta("number")));
map.put("weight",StringUtils.toString(weight, eiMetadata.getMeta("weight")));
map.put("remark",StringUtils.toString(remark, eiMetadata.getMeta("remark")));
map.put("createdBy",StringUtils.toString(createdBy, eiMetadata.getMeta("createdBy")));
map.put("createdTime",StringUtils.toString(createdTime, eiMetadata.getMeta("createdTime")));
map.put("updatedBy",StringUtils.toString(updatedBy, eiMetadata.getMeta("updatedBy")));
map.put("updatedTime",StringUtils.toString(updatedTime, eiMetadata.getMeta("updatedTime")));
return map;
/**
* 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 {
private String dateProc = " "; /* 日期*/
private String whCode = " "; /* 仓库编码*/
private String whName = " "; /* 仓库名称*/
private String inventType = " "; /* 存货类型*/
private Integer inventType; /* 存货类型*/
private String inventCode = " "; /* 存货编码*/
private String inventName = " "; /* 存货名称*/
private String spec = " "; /* 规格*/
......@@ -380,7 +380,7 @@ public class HPKC009 extends DaoEPBase {
* get the inventType - 存货类型.
* @return the inventType
*/
public String getInventType() {
public Integer getInventType() {
return this.inventType;
}
......@@ -389,7 +389,7 @@ public class HPKC009 extends DaoEPBase {
*
* @param inventType - 存货类型
*/
public void setInventType(String inventType) {
public void setInventType(Integer inventType) {
this.inventType = inventType;
}
/**
......@@ -680,7 +680,7 @@ public class HPKC009 extends DaoEPBase {
setDateProc(StringUtils.defaultIfEmpty(StringUtils.toString(map.get(FIELD_DATE_PROC)), dateProc));
setWhCode(StringUtils.defaultIfEmpty(StringUtils.toString(map.get(FIELD_WH_CODE)), whCode));
setWhName(StringUtils.defaultIfEmpty(StringUtils.toString(map.get(FIELD_WH_NAME)), whName));
setInventType(StringUtils.defaultIfEmpty(StringUtils.toString(map.get(FIELD_INVENT_TYPE)), inventType));
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));
setSpec(StringUtils.defaultIfEmpty(StringUtils.toString(map.get(FIELD_SPEC)), spec));
......
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.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.LogUtils;
import com.baosight.hpjx.util.StringUtil;
import com.baosight.iplat4j.core.ei.EiBlock;
import com.baosight.iplat4j.core.ei.EiConstant;
import com.baosight.iplat4j.core.ei.EiInfo;
import com.baosight.iplat4j.core.exception.PlatException;
import com.baosight.iplat4j.core.service.impl.ServiceBase;
import com.baosight.iplat4j.ed.util.SequenceGenerator;
import java.util.Arrays;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
/**
* @author xuao
* @date 2024年01月12日 14:22
* @author:songx
* @date:2024/1/22,10:48
*/
public class ServiceHPKC003 extends ServiceBase {
/**
* 画面初始化.
* 画面初始化
*
* @param inInfo
* @return
*/
public EiInfo initLoad(EiInfo inInfo) {
HPKC003 hpkc003 = new HPKC003();
EiInfo outInfo = new EiInfo();
outInfo.addBlock(EiConstant.resultBlock);
outInfo.getBlock(EiConstant.resultBlock).addBlockMeta(hpkc003.eiMetadata);
return outInfo;
try {
CommonMethod.initBlock(inInfo, Arrays.asList(DdynamicEnum.WH_RECORD_QUERY_BLOCK_ID), null);
CommonMethod.initBlock(inInfo, Arrays.asList(DdynamicEnum.INVENT_NAME_BLOCK_ID), null);
inInfo.addBlock(EiConstant.resultBlock).addBlockMeta(new HPKC003().eiMetadata);
} catch (Exception e) {
LogUtils.setDetailMsg(inInfo, e, "初始化失败");
}
return inInfo;
}
/**
* 查询操作.
* 查询操作
*
* @param inInfo
* @return
*/
@Override
public EiInfo query(EiInfo inInfo) {
/* 调用EI查询方法.*/
EiInfo outInfo = super.query(inInfo, "HPKC003.query", new HPKC003());
return outInfo;
try {
inInfo = super.query(inInfo, "HPKC003.query", new HPPZ009());
} catch (Exception e) {
LogUtils.setDetailMsg(inInfo, e, "查询失败");
}
return inInfo;
}
/**
* 新增操作.
* 新增操作
*
* @param inInfo
* @return
*/
@Override
public EiInfo insert(EiInfo inInfo) {
CommonMethod.creatorInfo(inInfo, EiConstant.resultBlock);
try {
CommonMethod.creatorInfo(inInfo,EiConstant.resultBlock);
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");
inInfo.setCell(EiConstant.resultBlock,i,"documentDate", StringUtil.removeHorizontalLine(documentDate));
List<Map> resultRows = inInfo.getBlock(EiConstant.resultBlock).getRows();
// 数据写入
for (int i = 0; i < resultRows.size(); i++) {
HPKC003 fKc003 = new HPKC003();
fKc003.fromMap(resultRows.get(i));
fKc003.setDocumentDate(StringUtil.removeHorizontalLine(fKc003.getDocumentDate()));
// 仓库名称
fKc003.setWhName(HPPZTools.getWhNameByCode(fKc003.getWhCode()));
// 物料名称
fKc003.setInventName(HPPZTools.getInventNameByCode(fKc003.getInventCode()));
// 生成入库单号
fKc003.setProdNo(SequenceGenerator.getNextSequence(HPConstant.SequenceId.HPKC003_PROD_NO));
DaoUtils.insert("HPKC003.insert", fKc003);
}
inInfo.setStatus(EiConstant.STATUS_SUCCESS);
inInfo.setMsg("新增成功!");
} catch (PlatException e) {
e.printStackTrace();
inInfo.setStatus(EiConstant.STATUS_FAILURE);
inInfo.setMsg("新增失败!原因参见详细错误描述!");
inInfo.setDetailMsg(e.getMessage());
logError("新增失败", e.getMessage());
return inInfo;
inInfo = this.query(inInfo);
inInfo.setStatus(EiConstant.STATUS_DEFAULT);
inInfo.setMsg("操作成功!本次对[" + resultRows.size() + "]条数据新增成功!");
} catch (Exception e) {
LogUtils.setDetailMsg(inInfo, e, "新增失败");
}
return super.insert(inInfo,"HPKC003.insert");
return inInfo;
}
/**
* 修改操作.
* 修改操作
*
* @param inInfo
* @return
*/
public EiInfo update(EiInfo inInfo) {
try {
CommonMethod.creatorInfo(inInfo,EiConstant.resultBlock);
HPKC003 hpkc003 = new HPKC003();
EiBlock eiBlock = inInfo.getBlock(EiConstant.resultBlock);
for (int i = 0; i < eiBlock.getRowCount(); i++) {
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());
CommonMethod.creatorInfo(inInfo, EiConstant.resultBlock);
List<Map> resultRows = inInfo.getBlock(EiConstant.resultBlock).getRows();
for (int i = 0; i < resultRows.size(); i++) {
HPKC003 fKc003 = new HPKC003();
fKc003.fromMap(resultRows.get(i));
fKc003.setDocumentDate(StringUtil.removeHorizontalLine(fKc003.getDocumentDate()));
// 仓库名称
fKc003.setWhName(HPPZTools.getWhNameByCode(fKc003.getWhCode()));
// 物料名称
fKc003.setInventName(HPPZTools.getInventNameByCode(fKc003.getInventCode()));
DaoUtils.update("HPKC003.update", fKc003);
}
inInfo.setStatus(EiConstant.STATUS_SUCCESS);
inInfo.setMsg("修改成功!");
} catch (PlatException e) {
inInfo.setStatus(EiConstant.STATUS_FAILURE);
inInfo.setMsg("操作失败!原因参见详细错误描述!");
inInfo.setDetailMsg(e.getMessage());
logError("修改失败", e.getMessage());
return inInfo;
inInfo = this.query(inInfo);
inInfo.setStatus(EiConstant.STATUS_DEFAULT);
inInfo.setMsg("操作成功!本次对[" + resultRows.size() + "]条数据新增成功!");
} catch (Exception e) {
LogUtils.setDetailMsg(inInfo, e, "修改失败");
}
return query(inInfo);
return inInfo;
}
/**
* 删除操作.
* 删除操作
*
* @param eiInfo
* @return
*/
public EiInfo delete(EiInfo eiInfo) {
HPKC003 hpkc003 = new HPKC003();
......@@ -109,19 +139,13 @@ public class ServiceHPKC003 extends ServiceBase {
for (int i = 0; i < eiBlock.getRowCount(); i++) {
Map<?, ?> map = eiBlock.getRow(i);
hpkc003.fromMap(map);
this.dao.delete("HPKC003.delete", hpkc003.toMap());
}
} catch (PlatException e) {
eiInfo.setStatus(EiConstant.STATUS_FAILURE);
eiInfo.setMsg("删除失败,原因参见详细错误描述!");
eiInfo.setDetailMsg(e.getMessage());
logError("删除失败!", e.getMessage());
return eiInfo;
}
eiInfo.setStatus(EiConstant.STATUS_SUCCESS);
eiInfo.setMsg("删除成功!");
} catch (Exception e) {
LogUtils.setDetailMsg(eiInfo, e, "删除失败");
}
return eiInfo;
}
......
......@@ -30,13 +30,17 @@ import java.util.Map;
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 {
/**
* 画面初始化.
* 画面初始化
*
* @param inInfo
* @return
*/
public EiInfo initLoad(EiInfo inInfo) {
HPKC005 HPKC005 = new HPKC005();
......
......@@ -204,7 +204,7 @@ public class ServiceHPKC009 extends ServiceBase {
+ aItem.getWhCode() + "#" + aItem.getMaterialType() + "#"
+ aItem.getMaterialCode() + "#" + aItem.getSpec();
HPKC009 kc009 = BeanUtils.copy(aItem, HPKC009.class);
kc009.setInventType(aItem.getMaterialType());
kc009.setInventType(Integer.parseInt(aItem.getMaterialType()));
kc009.setInventCode(aItem.getMaterialCode());
kc009.setKcType(HPConstant.KcType.CG);
kc009.setDateType(queryMap.get("dateType").toString());
......@@ -251,8 +251,8 @@ public class ServiceHPKC009 extends ServiceBase {
queryMap.put("createdTimeTo", queryMap.get("yesterday") + "235959");
List<HPKC003> bItems = dao.query("HPKC003.statDate", queryMap);
Map<String, HPKC003> bItemMap = bItems.stream().collect(Collectors.toMap(item ->
item.getCompanyCode() + "#" + item.getDepCode() + "#" + item.getWarehouseCode() + "#"
+ item.getMaterialType() + "#" + item.getMaterialCode(), item -> item));
item.getCompanyCode() + "#" + item.getDepCode() + "#" + item.getWhCode() + "#"
+ item.getInventType() + "#" + item.getInventCode(), item -> item));
// 1.3、发出
List<HPKC004> cItems = dao.query("HPKC004.statDate", queryMap);
Map<String, HPKC004> cItemMap = cItems.stream().collect(Collectors.toMap(item ->
......@@ -268,22 +268,22 @@ public class ServiceHPKC009 extends ServiceBase {
// 根据期末库存生成收发存对象
for (HPKC003 aItem : aItems) {
String key = aItem.getCompanyCode() + "#" + aItem.getDepCode() + "#"
+ aItem.getWarehouseCode() + "#" + aItem.getMaterialType() + "#"
+ aItem.getMaterialCode();
+ aItem.getWhCode() + "#" + aItem.getInventType() + "#"
+ aItem.getInventCode();
HPKC009 kc009 = BeanUtils.copy(aItem, HPKC009.class);
kc009.setWhCode(aItem.getWarehouseCode());
kc009.setInventType(aItem.getMaterialType() + "");
kc009.setInventCode(aItem.getMaterialCode());
kc009.setWhCode(aItem.getWhCode());
kc009.setInventType(aItem.getInventType());
kc009.setInventCode(aItem.getInventCode());
kc009.setKcType(HPConstant.KcType.SC);
kc009.setDateType(queryMap.get("dateType").toString());
kc009.setDateProc(queryMap.get("yesterDate").toString());
// 期末
kc009.setEndAmount(new BigDecimal(aItem.getNumber()));
kc009.setEndWeight(new BigDecimal(aItem.getWeight()));
kc009.setEndAmount(aItem.getAmount());
kc009.setEndWeight(aItem.getWeight());
// 收入
HPKC003 bItem = bItemMap.get(key);
kc009.setStockinAmount(bItem == null ? BigDecimal.ZERO : new BigDecimal(bItem.getNumber()));
kc009.setStockinWeight(bItem == null ? BigDecimal.ZERO : new BigDecimal(bItem.getWeight()));
kc009.setStockinAmount(bItem == null ? BigDecimal.ZERO : bItem.getAmount());
kc009.setStockinWeight(bItem == null ? BigDecimal.ZERO : bItem.getWeight());
// 发出
HPKC004 cItem = cItemMap.get(key);
kc009.setStockoutAmount(cItem == null ? BigDecimal.ZERO : cItem.getAmount());
......@@ -338,7 +338,7 @@ public class ServiceHPKC009 extends ServiceBase {
String key = aItem.getCompanyCode() + "#" + aItem.getDepCode() + "#"
+ aItem.getWhCode() + "#" + aItem.getMatType() + "#" + aItem.getMatCode();
HPKC009 kc009 = BeanUtils.copy(aItem, HPKC009.class);
kc009.setInventType(aItem.getMatType());
kc009.setInventType(Integer.parseInt(aItem.getMatType()));
kc009.setInventCode(aItem.getMatCode());
kc009.setKcType(HPConstant.KcType.QT);
kc009.setDateType(queryMap.get("dateType").toString());
......
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE sqlMap PUBLIC "-//iBATIS.com//DTD SQL Map 2.0//EN" "http://www.ibatis.com/dtd/sql-map-2.dtd">
<!-- table information
Generate time : 2024-01-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">
<select id="query" parameterClass="java.util.HashMap"
resultClass="com.baosight.hpjx.hp.kc.domain.HPKC003">
SELECT
<sql id="column">
ID as "id",
COMPANY_CODE as "companyCode", <!-- 企业编码 预留 -->
DEP_CODE as "depCode", <!-- 部门编码 -->
DOCUMENT_DATE as "documentDate", <!-- 单据日期 -->
PRODUCTION_NUMBER as "productionNumber", <!-- 生产入库单号 -->
WAREHOUSE_CODE as "warehouseCode", <!-- 仓库编码 -->
WAREHOUSE_NAME as "warehouseName", <!-- 仓库名称 -->
MATERIAL_TYPE as "materialType", <!-- 物料类型 -->
MATERIAL_CODE as "materialCode", <!-- 物料编码 -->
MATERIAL_NAME as "materialName", <!-- 物料名称 -->
NUMBER as "number", <!-- 数量 -->
PROD_NO as "prodNo", <!-- 生产入库单号 -->
WH_CODE as "whCode", <!-- 仓库编码 -->
WH_NAME as "whName", <!-- 仓库名称 -->
INVENT_TYPE as "inventType", <!-- 物料类型 -->
INVENT_CODE as "inventCode", <!-- 物料编码 -->
INVENT_NAME as "inventName", <!-- 物料名称 -->
AMOUNT as "amount", <!-- 数量 -->
WEIGHT as "weight", <!-- 重量 -->
REMARK as "remark", <!-- 备注 -->
CREATED_BY as "createdBy", <!-- 创建人 -->
CREATED_NAME as "createdName", <!-- 创建人名称 -->
CREATED_TIME as "createdTime", <!-- 创建时间 -->
UPDATED_BY as "updatedBy", <!-- 更新人 -->
UPDATED_TIME as "updatedTime" <!-- 更新时间 -->
FROM hpjx.t_hpkc003 WHERE 1=1
UPDATED_TIME as "updatedTime", <!-- 更新时间 -->
UPDATED_NAME as "updatedName" <!-- 修改人名称 -->
</sql>
<sql id="condition">
<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 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="warehouseName">
WAREHOUSE_NAME = #warehouseName#
<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 asc
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 id="count" resultClass="int">
SELECT COUNT(*) FROM hpjx.t_hpkc003 WHERE 1=1
<isNotEmpty prepend=" AND " property="id">
ID = #id#
</isNotEmpty>
<include refid="condition"/>
</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 INTO hpjx.t_hpkc003 (
INSERT INTO ${hpjxSchema}.T_HPKC003 (
COMPANY_CODE, <!-- 企业编码 预留 -->
DEP_CODE, <!-- 部门编码 -->
DEPT_CODE, <!-- 部门编码 -->
DOCUMENT_DATE, <!-- 单据日期 -->
PRODUCTION_NUMBER, <!-- 生产入库单号 -->
WAREHOUSE_CODE, <!-- 仓库编码 -->
WAREHOUSE_NAME, <!-- 仓库名称 -->
MATERIAL_TYPE, <!-- 物料类型 -->
MATERIAL_CODE, <!-- 物料编码 -->
MATERIAL_NAME, <!-- 物料名称 -->
NUMBER, <!-- 数量 -->
PROD_NO, <!-- 生产入库单号 -->
WH_CODE, <!-- 仓库编码 -->
WH_NAME, <!-- 仓库名称 -->
INVENT_TYPE, <!-- 物料类型 -->
INVENT_CODE, <!-- 物料编码 -->
INVENT_NAME, <!-- 物料名称 -->
AMOUNT, <!-- 数量 -->
WEIGHT, <!-- 重量 -->
REMARK, <!-- 备注 -->
CREATED_BY, <!-- 创建人 -->
CREATED_NAME, <!-- 创建人名称 -->
CREATED_TIME <!-- 创建时间 -->
) VALUES (
#companyCode#, #deptCode#, #documentDate#, #prodNo#, #whCode#, #whName#,
#inventType#, #inventCode#, #inventName#, #amount#, #weight#, #remark#,
#createdBy#, #createdName#, #createdTime#
)
VALUES ( #companyCode#, #depCode#, #documentDate#, #productionNumber#, #warehouseCode#, #warehouseName#, #materialType#, #materialCode#, #materialName#, #number#, #weight#, #remark#, #createdBy#, #createdTime#)
</insert>
<delete id="delete">
DELETE FROM hpjx.t_hpkc003 WHERE
ID = #id#
DELETE FROM hpjx.t_hpkc003 WHERE ID = #id#
</delete>
<update id="update">
UPDATE hpjx.t_hpkc003
UPDATE ${hpjxSchema}.T_HPKC003
SET
COMPANY_CODE = #companyCode#, <!-- 企业编码 预留 -->
DEPT_CODE = #deptCode#, <!-- 部门编码 -->
DOCUMENT_DATE = #documentDate#, <!-- 单据日期 -->
PRODUCTION_NUMBER = #productionNumber#, <!-- 生产入库单号 -->
WAREHOUSE_CODE = #warehouseCode#, <!-- 仓库编码 -->
WAREHOUSE_NAME = #warehouseName#, <!-- 仓库名称 -->
MATERIAL_TYPE = #materialType#, <!-- 物料类型 -->
MATERIAL_CODE = #materialCode#, <!-- 物料编码 -->
MATERIAL_NAME = #materialName#, <!-- 物料名称 -->
NUMBER = #number#, <!-- 数量 -->
PROD_NO = #prodNo#, <!-- 生产入库单号 -->
WH_CODE = #whCode#, <!-- 仓库编码 -->
WH_NAME = #whName#, <!-- 仓库名称 -->
INVENT_TYPE = #inventType#, <!-- 物料类型 -->
INVENT_CODE = #inventCode#, <!-- 物料编码 -->
INVENT_NAME = #inventName#, <!-- 物料名称 -->
AMOUNT = #amount#, <!-- 数量 -->
WEIGHT = #weight#, <!-- 重量 -->
REMARK = #remark#, <!-- 备注 -->
UPDATED_BY = #updatedBy#, <!-- 更新人 -->
UPDATED_TIME = #updatedTime# <!-- 更新时间 -->
WHERE
ID = #id#
UPDATED_TIME = #updatedTime#, <!-- 更新时间 -->
UPDATED_NAME = #updatedName# <!-- 修改人名称 -->
WHERE ID = #id#
</update>
<!-- 统计库存 -->
<select id="statDate" resultClass="com.baosight.hpjx.hp.kc.domain.HPKC003">
SELECT
COMPANY_CODE AS "companyCode",
DEP_CODE AS "depCode",
WAREHOUSE_CODE AS "warehouseCode",
MATERIAL_TYPE AS "materialType",
MATERIAL_CODE AS "materialCode",
COALESCE(SUM(NUMBER), 0) AS "number",
DEPT_CODE AS "deptCode",
WH_CODE AS "whCode",
INVENT_TYPE AS "inventType",
INVENT_CODE AS "inventCode",
COALESCE(SUM(AMOUNT), 0) AS "amount",
COALESCE(SUM(WEIGHT), 0) AS "weight"
FROM ${hpjxSchema}.T_HPKC003
WHERE 1=1
<isNotEmpty prepend=" AND " property="createdTimeFrom">
CREATED_TIME BETWEEN #createdTimeFrom# AND #createdTimeTo#
</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>
</sqlMap>
......@@ -154,15 +154,10 @@
ORDER BY WH_CODE
</select>
<select id="queryByWhCode" parameterClass="java.util.HashMap"
resultClass="com.baosight.hpjx.hp.pz.domain.HPPZ007">
<select id="queryByWhCode" resultClass="com.baosight.hpjx.hp.pz.domain.HPPZ007">
SELECT WH_NAME as "whName"
FROM hpjx.t_hppz007 WHERE 1=1
<isNotEmpty prepend=" AND " property="whCode">
WH_CODE = #whCode#
</isNotEmpty>
AND WH_CODE = #whCode#
</select>
</sqlMap>
......@@ -21,6 +21,34 @@ import java.util.stream.Collectors;
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
......
......@@ -52,15 +52,11 @@
AND MEMBER_ID = #memberId#
</select>
<!-- 用户组查询 -->
<select id="queryGroupEname" resultClass="java.util.LinkedHashMap">
SELECT
ID as "id", <!-- id -->
GROUP_ENAME as "groupEname", <!-- 用户组id -->
GROUP_CNAME as "groupCname" <!-- 用户组名字 -->
FROM ${platSchema}.XS_USER_GROUP
WHERE 1=1
AND ID IN <iterate close=")" open="(" conjunction="," property="ids">#ids[]#</iterate>
<!-- 查询用户组织机构 -->
<select id="queryOrgId" resultClass="java.util.LinkedHashMap">
SELECT ORG_ID AS "orgId"
FROM ${platSchema}.TXSOG02
WHERE USER_ID = #userId#
</select>
</sqlMap>
package com.baosight.hpjx.hp.xs.tools;
import com.baosight.hpjx.core.dao.DaoBase;
import com.baosight.iplat4j.core.web.threadlocal.UserSession;
import org.springframework.util.CollectionUtils;
import java.util.HashMap;
......@@ -26,4 +27,16 @@ public class HPXSUserTools {
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 () {
$("#QUERY").on("click", function () {
resultGrid.dataSource.page(1);
});
$("#QUERY").on("click", query);
IPLATUI.EFGrid.result = {
pageable: {
pageSize: 20,
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,38 +6,45 @@
<c:set var="ctx" value="${pageContext.request.contextPath}"/>
<EF:EFPage title="生产入库单">
<EF:EFRegion id="inqu" title="查询条件">
<div class="row">
<EF:EFDatePicker ename="inqu_status-0-documentDate" cname="单据日期"
format="yyyy-MM-dd"/>
<EF:EFInput ename="inqu_status-0-productionNumber" cname="生产入库单号" colWidth="4" readonly="false"/>
<EF:EFInput ename="inqu_status-0-warehouseName" cname="仓库名称" colWidth="4" readonly="false"/>
<EF:EFDatePicker ename="inqu_status-0-documentDate" cname="单据日期" colWidth="3" format="yyyy-MM-dd"
readonly="true"/>
<EF:EFInput ename="inqu_status-0-prodNo" cname="生产入库单号" colWidth="3"/>
<EF:EFSelect ename="inqu_status-0-whCode" cname="仓库名称" colWidth="3" filter="contains" defultValue="">
<EF:EFOption label="请选择" value=""/>
<EF:EFOptions blockId="whName_block_id" textField="textField" valueField="valueField"/>
</EF: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:EFButton ename="QUERY" cname="查询" row="1" class="btn-align-right"></EF:EFButton>
</EF:EFRegion>
<EF:EFRegion id="result" title="明细信息">
<EF:EFGrid blockId="result" autoDraw="false" isFloat="true" autoFit="true">
<EF:EFColumn ename="id" cname="内码" hidden="true"/>
<EF:EFColumn ename="documentDate" cname="单据日期" editType="date" dateFormat="yyyy-MM-dd" parseFormats="['yyyyMMdd']" width="100" readonly="false" />
<EF:EFColumn ename="productionNumber" cname="生产入库单号" width="100" readonly="false" required="true"/>
<EF:EFColumn ename="warehouseCode" cname="仓库编码" width="100" readonly="false" required="true"/>
<EF:EFColumn ename="warehouseName" cname="仓库名称" width="100" readonly="false" required="true"/>
<EF:EFComboColumn ename="materialType" cname="物料类型" align="center"
columnTemplate="#=valueField#-#=textField#" optionLabel=" "
itemTemplate="#=valueField#-#=textField#" textField="textField"
valueField="valueField" width="100">
<EF:EFOption label="--请选择--" value=""></EF:EFOption>
<EF:EFOption label="待补充" value="1"></EF:EFOption>
<EF:EFColumn ename="prodNo" cname="生产入库单号" enable="false" width="130" align="center"/>
<EF:EFColumn ename="documentDate" cname="单据日期" width="100" align="center" editType="date"
dateFormat="yyyy-MM-dd" parseFormats="['yyyyMMdd']" required="true"/>
<EF:EFComboColumn cname="仓库名称" ename="whCode" columnTemplate="#=textField#"
itemTemplate="#=textField#" blockName="whName_block_id"
textField="textField" valueField="valueField"
align="center" filter="contains" width="100">
</EF:EFComboColumn>
<EF:EFColumn ename="materialCode" cname="物料编码" width="100" readonly="false" required="true"/>
<EF:EFColumn ename="materialName" cname="物料名称" width="100" readonly="false" required="true"/>
<EF:EFColumn ename="number" cname="数量" width="100" readonly="false" required="true"/>
<EF:EFColumn ename="weight" cname="重量" width="100" readonly="false" required="true"/>
<EF:EFColumn ename="remark" cname="备注" width="100" readonly="false" />
<EF:EFComboColumn cname="存货类型" ename="inventType" width="90" align="center">
<EF:EFCodeOption codeName="hpjx.hpkc.inventType"/>
</EF:EFComboColumn>
<EF:EFColumn cname="存货名称" ename="inventCode" width="120" align="center"/>
<EF:EFColumn cname="数量" ename="amount" width="100" align="right" format="{0:N3}"
sumType="all"/>
<EF:EFColumn cname="重量" ename="weight" width="100" align="right" format="{0:N3}"
sumType="all"/>
<EF:EFColumn ename="remark" cname="备注" width="150" editType="textarea"/>
<EF:EFColumn cname="创建人名称" ename="createdName" enable="false" width="120" align="center"/>
<EF:EFColumn cname="创建时间" ename="createdTime" enable="false" width="140" align="center"
editType="datetime" parseFormats="['yyyyMMddHHmmss','yyyy-MM-dd HH:mm:ss']"/>
</EF:EFGrid>
</EF:EFRegion>
......
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