Commit e195dfb6 by 宋祥

1.库存模块增加单重

parent d4cf55ed
...@@ -221,6 +221,18 @@ public class HPSqlConstant { ...@@ -221,6 +221,18 @@ public class HPSqlConstant {
} }
/** /**
* HPKC012 SQL 定义
*
* @author:songx
* @date:2024/1/20,16:45
*/
public class HPKC012 {
// 锁
public static final String QUERY = "HPKC012.query";
}
/**
* HPPZ010 SQL 定义 * HPPZ010 SQL 定义
* *
* @author:songx * @author:songx
......
...@@ -2,8 +2,6 @@ package com.baosight.hpjx.hp.kc.domain; ...@@ -2,8 +2,6 @@ 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 java.math.BigDecimal;
import com.baosight.iplat4j.core.util.DateUtils;
import java.sql.Timestamp;
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;
...@@ -18,7 +16,7 @@ import com.baosight.iplat4j.core.util.StringUtils; ...@@ -18,7 +16,7 @@ import com.baosight.iplat4j.core.util.StringUtils;
* Copyrigth:Baosight Software LTD.co Copyright (c) 2019. <br> * Copyrigth:Baosight Software LTD.co Copyright (c) 2019. <br>
* *
* @version 1.0 * @version 1.0
* @history 2024-01-25 11:33:46 create * @history 2024-02-27 11:14:12 create
*/ */
public class HPKC001 extends DaoEPBase { public class HPKC001 extends DaoEPBase {
...@@ -34,7 +32,6 @@ public class HPKC001 extends DaoEPBase { ...@@ -34,7 +32,6 @@ public class HPKC001 extends DaoEPBase {
public static final String FIELD_UPDATED_NAME = "updatedName"; /* 更新人名称*/ public static final String FIELD_UPDATED_NAME = "updatedName"; /* 更新人名称*/
public static final String FIELD_UPDATED_TIME = "updatedTime"; /* 更新时间*/ public static final String FIELD_UPDATED_TIME = "updatedTime"; /* 更新时间*/
public static final String FIELD_PURCHASE_NO = "purchaseNo"; /* 采购单号*/ public static final String FIELD_PURCHASE_NO = "purchaseNo"; /* 采购单号*/
public static final String FIELD_OLD_PURCHASE_NO = "oldPurchaseNo"; /* 原采购单号*/
public static final String FIELD_RECEIPT_DATE = "receiptDate"; /* 单据日期*/ public static final String FIELD_RECEIPT_DATE = "receiptDate"; /* 单据日期*/
public static final String FIELD_WH_CODE = "whCode"; /* 仓库编码*/ public static final String FIELD_WH_CODE = "whCode"; /* 仓库编码*/
public static final String FIELD_WH_NAME = "whName"; /* 仓库名称*/ public static final String FIELD_WH_NAME = "whName"; /* 仓库名称*/
...@@ -43,8 +40,10 @@ public class HPKC001 extends DaoEPBase { ...@@ -43,8 +40,10 @@ public class HPKC001 extends DaoEPBase {
public static final String FIELD_INVENT_NAME = "inventName"; /* 存货名称*/ public static final String FIELD_INVENT_NAME = "inventName"; /* 存货名称*/
public static final String FIELD_INVENT_RECORD_ID = "inventRecordId"; /* 存货档案ID*/ public static final String FIELD_INVENT_RECORD_ID = "inventRecordId"; /* 存货档案ID*/
public static final String FIELD_AMOUNT = "amount"; /* 数量*/ public static final String FIELD_AMOUNT = "amount"; /* 数量*/
public static final String FIELD_UNIT_WEIGHT = "unitWeight"; /* 单重*/
public static final String FIELD_WEIGHT = "weight"; /* 重量*/ public static final String FIELD_WEIGHT = "weight"; /* 重量*/
public static final String FIELD_REMARK = "remark"; /* 备注*/ public static final String FIELD_REMARK = "remark"; /* 备注*/
public static final String FIELD_OLD_PURCHASE_NO = "oldPurchaseNo"; /* 原采购单号*/
public static final String FIELD_DELETE_FLAG = "deleteFlag"; /* 是否删除0.否1.是*/ public static final String FIELD_DELETE_FLAG = "deleteFlag"; /* 是否删除0.否1.是*/
public static final String COL_ID = "ID"; /* 主键id*/ public static final String COL_ID = "ID"; /* 主键id*/
...@@ -56,7 +55,7 @@ public class HPKC001 extends DaoEPBase { ...@@ -56,7 +55,7 @@ public class HPKC001 extends DaoEPBase {
public static final String COL_UPDATED_BY = "UPDATED_BY"; /* 更新人*/ public static final String COL_UPDATED_BY = "UPDATED_BY"; /* 更新人*/
public static final String COL_UPDATED_NAME = "UPDATED_NAME"; /* 更新人名称*/ public static final String COL_UPDATED_NAME = "UPDATED_NAME"; /* 更新人名称*/
public static final String COL_UPDATED_TIME = "UPDATED_TIME"; /* 更新时间*/ public static final String COL_UPDATED_TIME = "UPDATED_TIME"; /* 更新时间*/
public static final String COL_OLD_PURCHASE_NO = "OLD_PURCHASE_NO"; /* 原采购单号*/ public static final String COL_PURCHASE_NO = "PURCHASE_NO"; /* 采购单号*/
public static final String COL_RECEIPT_DATE = "RECEIPT_DATE"; /* 单据日期*/ public static final String COL_RECEIPT_DATE = "RECEIPT_DATE"; /* 单据日期*/
public static final String COL_WH_CODE = "WH_CODE"; /* 仓库编码*/ public static final String COL_WH_CODE = "WH_CODE"; /* 仓库编码*/
public static final String COL_WH_NAME = "WH_NAME"; /* 仓库名称*/ public static final String COL_WH_NAME = "WH_NAME"; /* 仓库名称*/
...@@ -65,8 +64,10 @@ public class HPKC001 extends DaoEPBase { ...@@ -65,8 +64,10 @@ public class HPKC001 extends DaoEPBase {
public static final String COL_INVENT_NAME = "INVENT_NAME"; /* 存货名称*/ public static final String COL_INVENT_NAME = "INVENT_NAME"; /* 存货名称*/
public static final String COL_INVENT_RECORD_ID = "INVENT_RECORD_ID"; /* 存货档案ID*/ public static final String COL_INVENT_RECORD_ID = "INVENT_RECORD_ID"; /* 存货档案ID*/
public static final String COL_AMOUNT = "AMOUNT"; /* 数量*/ public static final String COL_AMOUNT = "AMOUNT"; /* 数量*/
public static final String COL_UNIT_WEIGHT = "UNIT_WEIGHT"; /* 单重*/
public static final String COL_WEIGHT = "WEIGHT"; /* 重量*/ public static final String COL_WEIGHT = "WEIGHT"; /* 重量*/
public static final String COL_REMARK = "REMARK"; /* 备注*/ public static final String COL_REMARK = "REMARK"; /* 备注*/
public static final String COL_OLD_PURCHASE_NO = "OLD_PURCHASE_NO"; /* 原采购单号*/
public static final String COL_DELETE_FLAG = "DELETE_FLAG"; /* 是否删除0.否1.是*/ public static final String COL_DELETE_FLAG = "DELETE_FLAG"; /* 是否删除0.否1.是*/
public static final String QUERY = "HPKC001.query"; public static final String QUERY = "HPKC001.query";
...@@ -75,27 +76,28 @@ public class HPKC001 extends DaoEPBase { ...@@ -75,27 +76,28 @@ public class HPKC001 extends DaoEPBase {
public static final String UPDATE = "HPKC001.update"; public static final String UPDATE = "HPKC001.update";
public static final String DELETE = "HPKC001.delete"; public static final String DELETE = "HPKC001.delete";
private Long id = null; /* 主键id*/ private Long id; /* 主键id*/
private String companyCode = " "; /* 企业编码 预留*/ private String companyCode = " "; /* 企业编码 预留*/
private String depCode = " "; /* 部门编码*/ private String depCode = " "; /* 部门编码*/
private String createdBy = " "; /* 创建人*/ private String createdBy = " "; /* 创建人*/
private String createdName = " "; /* 创建人名称*/ private String createdName = " "; /* 创建人名称*/
private String createdTime ; /* 创建时间*/ private String createdTime = " "; /* 创建时间*/
private String updatedBy = " "; /* 更新人*/ private String updatedBy = " "; /* 更新人*/
private String updatedName = " "; /* 更新人名称*/ private String updatedName = " "; /* 更新人名称*/
private String updatedTime ; /* 更新时间*/ private String updatedTime = " "; /* 更新时间*/
private String purchaseNo = " "; /* 采购单号*/ private String purchaseNo = " "; /* 采购单号*/
private String oldPurchaseNo = " "; /* 原采购单号*/ private String receiptDate = " "; /* 单据日期*/
private String receiptDate ; /* 单据日期*/
private String whCode = " "; /* 仓库编码*/ private String whCode = " "; /* 仓库编码*/
private String whName = " "; /* 仓库名称*/ private String whName = " "; /* 仓库名称*/
private String inventType = " "; /* 存货类型*/ private String inventType = " "; /* 存货类型*/
private String inventCode = " "; /* 存货编码*/ private String inventCode = " "; /* 存货编码*/
private String inventName = " "; /* 存货名称*/ private String inventName = " "; /* 存货名称*/
private Long inventRecordId = new Long(0); /* 存货档案ID*/ private Long inventRecordId; /* 存货档案ID*/
private BigDecimal amount = new BigDecimal("0"); /* 数量*/ private BigDecimal amount = new BigDecimal(0.00); /* 数量*/
private BigDecimal weight = new BigDecimal("0"); /* 重量*/ private BigDecimal unitWeight = new BigDecimal(0.00); /* 单重*/
private BigDecimal weight = new BigDecimal(0.00); /* 重量*/
private String remark = " "; /* 备注*/ private String remark = " "; /* 备注*/
private String oldPurchaseNo = " "; /* 原采购单号*/
private Integer deleteFlag; /* 是否删除0.否1.是*/ private Integer deleteFlag; /* 是否删除0.否1.是*/
/** /**
...@@ -145,10 +147,6 @@ public class HPKC001 extends DaoEPBase { ...@@ -145,10 +147,6 @@ public class HPKC001 extends DaoEPBase {
eiColumn.setDescName("采购单号"); eiColumn.setDescName("采购单号");
eiMetadata.addMeta(eiColumn); eiMetadata.addMeta(eiColumn);
eiColumn = new EiColumn(FIELD_OLD_PURCHASE_NO);
eiColumn.setDescName("原采购单号");
eiMetadata.addMeta(eiColumn);
eiColumn = new EiColumn(FIELD_RECEIPT_DATE); eiColumn = new EiColumn(FIELD_RECEIPT_DATE);
eiColumn.setDescName("单据日期"); eiColumn.setDescName("单据日期");
eiMetadata.addMeta(eiColumn); eiMetadata.addMeta(eiColumn);
...@@ -179,15 +177,22 @@ public class HPKC001 extends DaoEPBase { ...@@ -179,15 +177,22 @@ public class HPKC001 extends DaoEPBase {
eiColumn = new EiColumn(FIELD_AMOUNT); eiColumn = new EiColumn(FIELD_AMOUNT);
eiColumn.setType("N"); eiColumn.setType("N");
eiColumn.setScaleLength(0); eiColumn.setScaleLength(2);
eiColumn.setFieldLength(12); eiColumn.setFieldLength(15);
eiColumn.setDescName("数量"); eiColumn.setDescName("数量");
eiMetadata.addMeta(eiColumn); eiMetadata.addMeta(eiColumn);
eiColumn = new EiColumn(FIELD_UNIT_WEIGHT);
eiColumn.setType("N");
eiColumn.setScaleLength(2);
eiColumn.setFieldLength(15);
eiColumn.setDescName("单重");
eiMetadata.addMeta(eiColumn);
eiColumn = new EiColumn(FIELD_WEIGHT); eiColumn = new EiColumn(FIELD_WEIGHT);
eiColumn.setType("N"); eiColumn.setType("N");
eiColumn.setScaleLength(0); eiColumn.setScaleLength(2);
eiColumn.setFieldLength(12); eiColumn.setFieldLength(15);
eiColumn.setDescName("重量"); eiColumn.setDescName("重量");
eiMetadata.addMeta(eiColumn); eiMetadata.addMeta(eiColumn);
...@@ -195,6 +200,10 @@ public class HPKC001 extends DaoEPBase { ...@@ -195,6 +200,10 @@ public class HPKC001 extends DaoEPBase {
eiColumn.setDescName("备注"); eiColumn.setDescName("备注");
eiMetadata.addMeta(eiColumn); eiMetadata.addMeta(eiColumn);
eiColumn = new EiColumn(FIELD_OLD_PURCHASE_NO);
eiColumn.setDescName("原采购单号");
eiMetadata.addMeta(eiColumn);
eiColumn = new EiColumn(FIELD_DELETE_FLAG); eiColumn = new EiColumn(FIELD_DELETE_FLAG);
eiColumn.setDescName("是否删除0.否1.是"); eiColumn.setDescName("是否删除0.否1.是");
eiMetadata.addMeta(eiColumn); eiMetadata.addMeta(eiColumn);
...@@ -369,23 +378,6 @@ public class HPKC001 extends DaoEPBase { ...@@ -369,23 +378,6 @@ public class HPKC001 extends DaoEPBase {
public void setPurchaseNo(String purchaseNo) { public void setPurchaseNo(String purchaseNo) {
this.purchaseNo = purchaseNo; this.purchaseNo = purchaseNo;
} }
/**
* set the oldPurchaseNo - 原采购单号.
*
* @param oldPurchaseNo - 原采购单号
*/
public void setOldPurchaseNo(String oldPurchaseNo) {
this.oldPurchaseNo = oldPurchaseNo;
}
/**
* get the oldPurchaseNo - 原采购单号.
* @return the oldPurchaseNo
*/
public String getOldPurchaseNo() {
return this.oldPurchaseNo;
}
/** /**
* get the receiptDate - 单据日期. * get the receiptDate - 单据日期.
* @return the receiptDate * @return the receiptDate
...@@ -515,6 +507,22 @@ public class HPKC001 extends DaoEPBase { ...@@ -515,6 +507,22 @@ public class HPKC001 extends DaoEPBase {
this.amount = amount; this.amount = amount;
} }
/** /**
* get the unitWeight - 单重.
* @return the unitWeight
*/
public BigDecimal getUnitWeight() {
return this.unitWeight;
}
/**
* set the unitWeight - 单重.
*
* @param unitWeight - 单重
*/
public void setUnitWeight(BigDecimal unitWeight) {
this.unitWeight = unitWeight;
}
/**
* get the weight - 重量. * get the weight - 重量.
* @return the weight * @return the weight
*/ */
...@@ -547,6 +555,22 @@ public class HPKC001 extends DaoEPBase { ...@@ -547,6 +555,22 @@ public class HPKC001 extends DaoEPBase {
this.remark = remark; this.remark = remark;
} }
/** /**
* get the oldPurchaseNo - 原采购单号.
* @return the oldPurchaseNo
*/
public String getOldPurchaseNo() {
return this.oldPurchaseNo;
}
/**
* set the oldPurchaseNo - 原采购单号.
*
* @param oldPurchaseNo - 原采购单号
*/
public void setOldPurchaseNo(String oldPurchaseNo) {
this.oldPurchaseNo = oldPurchaseNo;
}
/**
* get the deleteFlag - 是否删除0.否1.是. * get the deleteFlag - 是否删除0.否1.是.
* @return the deleteFlag * @return the deleteFlag
*/ */
...@@ -580,7 +604,6 @@ public class HPKC001 extends DaoEPBase { ...@@ -580,7 +604,6 @@ public class HPKC001 extends DaoEPBase {
setUpdatedName(StringUtils.defaultIfEmpty(StringUtils.toString(map.get(FIELD_UPDATED_NAME)), updatedName)); setUpdatedName(StringUtils.defaultIfEmpty(StringUtils.toString(map.get(FIELD_UPDATED_NAME)), updatedName));
setUpdatedTime(StringUtils.defaultIfEmpty(StringUtils.toString(map.get(FIELD_UPDATED_TIME)), updatedTime)); setUpdatedTime(StringUtils.defaultIfEmpty(StringUtils.toString(map.get(FIELD_UPDATED_TIME)), updatedTime));
setPurchaseNo(StringUtils.defaultIfEmpty(StringUtils.toString(map.get(FIELD_PURCHASE_NO)), purchaseNo)); setPurchaseNo(StringUtils.defaultIfEmpty(StringUtils.toString(map.get(FIELD_PURCHASE_NO)), purchaseNo));
setOldPurchaseNo(StringUtils.defaultIfEmpty(StringUtils.toString(map.get(FIELD_OLD_PURCHASE_NO)), oldPurchaseNo));
setReceiptDate(StringUtils.defaultIfEmpty(StringUtils.toString(map.get(FIELD_RECEIPT_DATE)), receiptDate)); setReceiptDate(StringUtils.defaultIfEmpty(StringUtils.toString(map.get(FIELD_RECEIPT_DATE)), receiptDate));
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));
...@@ -589,8 +612,10 @@ public class HPKC001 extends DaoEPBase { ...@@ -589,8 +612,10 @@ public class HPKC001 extends DaoEPBase {
setInventName(StringUtils.defaultIfEmpty(StringUtils.toString(map.get(FIELD_INVENT_NAME)), inventName)); setInventName(StringUtils.defaultIfEmpty(StringUtils.toString(map.get(FIELD_INVENT_NAME)), inventName));
setInventRecordId(NumberUtils.toLong(StringUtils.toString(map.get(FIELD_INVENT_RECORD_ID)), inventRecordId)); setInventRecordId(NumberUtils.toLong(StringUtils.toString(map.get(FIELD_INVENT_RECORD_ID)), inventRecordId));
setAmount(NumberUtils.toBigDecimal(StringUtils.toString(map.get(FIELD_AMOUNT)), amount)); setAmount(NumberUtils.toBigDecimal(StringUtils.toString(map.get(FIELD_AMOUNT)), amount));
setUnitWeight(NumberUtils.toBigDecimal(StringUtils.toString(map.get(FIELD_UNIT_WEIGHT)), unitWeight));
setWeight(NumberUtils.toBigDecimal(StringUtils.toString(map.get(FIELD_WEIGHT)), weight)); setWeight(NumberUtils.toBigDecimal(StringUtils.toString(map.get(FIELD_WEIGHT)), weight));
setRemark(StringUtils.defaultIfEmpty(StringUtils.toString(map.get(FIELD_REMARK)), remark)); setRemark(StringUtils.defaultIfEmpty(StringUtils.toString(map.get(FIELD_REMARK)), remark));
setOldPurchaseNo(StringUtils.defaultIfEmpty(StringUtils.toString(map.get(FIELD_OLD_PURCHASE_NO)), oldPurchaseNo));
setDeleteFlag(NumberUtils.toInteger(StringUtils.toString(map.get(FIELD_DELETE_FLAG)), deleteFlag)); setDeleteFlag(NumberUtils.toInteger(StringUtils.toString(map.get(FIELD_DELETE_FLAG)), deleteFlag));
} }
...@@ -611,7 +636,6 @@ public class HPKC001 extends DaoEPBase { ...@@ -611,7 +636,6 @@ public class HPKC001 extends DaoEPBase {
map.put(FIELD_UPDATED_NAME, StringUtils.toString(updatedName, eiMetadata.getMeta(FIELD_UPDATED_NAME))); map.put(FIELD_UPDATED_NAME, StringUtils.toString(updatedName, eiMetadata.getMeta(FIELD_UPDATED_NAME)));
map.put(FIELD_UPDATED_TIME, StringUtils.toString(updatedTime, eiMetadata.getMeta(FIELD_UPDATED_TIME))); map.put(FIELD_UPDATED_TIME, StringUtils.toString(updatedTime, eiMetadata.getMeta(FIELD_UPDATED_TIME)));
map.put(FIELD_PURCHASE_NO, StringUtils.toString(purchaseNo, eiMetadata.getMeta(FIELD_PURCHASE_NO))); map.put(FIELD_PURCHASE_NO, StringUtils.toString(purchaseNo, eiMetadata.getMeta(FIELD_PURCHASE_NO)));
map.put(FIELD_OLD_PURCHASE_NO, StringUtils.toString(oldPurchaseNo, eiMetadata.getMeta(FIELD_OLD_PURCHASE_NO)));
map.put(FIELD_RECEIPT_DATE, StringUtils.toString(receiptDate, eiMetadata.getMeta(FIELD_RECEIPT_DATE))); map.put(FIELD_RECEIPT_DATE, StringUtils.toString(receiptDate, eiMetadata.getMeta(FIELD_RECEIPT_DATE)));
map.put(FIELD_WH_CODE, StringUtils.toString(whCode, eiMetadata.getMeta(FIELD_WH_CODE))); map.put(FIELD_WH_CODE, StringUtils.toString(whCode, eiMetadata.getMeta(FIELD_WH_CODE)));
map.put(FIELD_WH_NAME, StringUtils.toString(whName, eiMetadata.getMeta(FIELD_WH_NAME))); map.put(FIELD_WH_NAME, StringUtils.toString(whName, eiMetadata.getMeta(FIELD_WH_NAME)));
...@@ -620,8 +644,10 @@ public class HPKC001 extends DaoEPBase { ...@@ -620,8 +644,10 @@ public class HPKC001 extends DaoEPBase {
map.put(FIELD_INVENT_NAME, StringUtils.toString(inventName, eiMetadata.getMeta(FIELD_INVENT_NAME))); map.put(FIELD_INVENT_NAME, StringUtils.toString(inventName, eiMetadata.getMeta(FIELD_INVENT_NAME)));
map.put(FIELD_INVENT_RECORD_ID, StringUtils.toString(inventRecordId, eiMetadata.getMeta(FIELD_INVENT_RECORD_ID))); map.put(FIELD_INVENT_RECORD_ID, StringUtils.toString(inventRecordId, eiMetadata.getMeta(FIELD_INVENT_RECORD_ID)));
map.put(FIELD_AMOUNT, StringUtils.toString(amount, eiMetadata.getMeta(FIELD_AMOUNT))); map.put(FIELD_AMOUNT, StringUtils.toString(amount, eiMetadata.getMeta(FIELD_AMOUNT)));
map.put(FIELD_UNIT_WEIGHT, StringUtils.toString(unitWeight, eiMetadata.getMeta(FIELD_UNIT_WEIGHT)));
map.put(FIELD_WEIGHT, StringUtils.toString(weight, eiMetadata.getMeta(FIELD_WEIGHT))); map.put(FIELD_WEIGHT, StringUtils.toString(weight, eiMetadata.getMeta(FIELD_WEIGHT)));
map.put(FIELD_REMARK, StringUtils.toString(remark, eiMetadata.getMeta(FIELD_REMARK))); map.put(FIELD_REMARK, StringUtils.toString(remark, eiMetadata.getMeta(FIELD_REMARK)));
map.put(FIELD_OLD_PURCHASE_NO, StringUtils.toString(oldPurchaseNo, eiMetadata.getMeta(FIELD_OLD_PURCHASE_NO)));
map.put(FIELD_DELETE_FLAG, StringUtils.toString(deleteFlag, eiMetadata.getMeta(FIELD_DELETE_FLAG))); map.put(FIELD_DELETE_FLAG, StringUtils.toString(deleteFlag, eiMetadata.getMeta(FIELD_DELETE_FLAG)));
return map; return map;
......
...@@ -16,7 +16,7 @@ import com.baosight.iplat4j.core.util.StringUtils; ...@@ -16,7 +16,7 @@ import com.baosight.iplat4j.core.util.StringUtils;
* Copyrigth:Baosight Software LTD.co Copyright (c) 2019. <br> * Copyrigth:Baosight Software LTD.co Copyright (c) 2019. <br>
* *
* @version 1.0 * @version 1.0
* @history 2024-01-25 23:15:22 create * @history 2024-02-27 14:22:00 create
*/ */
public class HPKC002 extends DaoEPBase { public class HPKC002 extends DaoEPBase {
...@@ -40,6 +40,7 @@ public class HPKC002 extends DaoEPBase { ...@@ -40,6 +40,7 @@ public class HPKC002 extends DaoEPBase {
public static final String FIELD_INVENT_NAME = "inventName"; /* 存货名称*/ public static final String FIELD_INVENT_NAME = "inventName"; /* 存货名称*/
public static final String FIELD_INVENT_RECORD_ID = "inventRecordId"; /* 存货档案ID*/ public static final String FIELD_INVENT_RECORD_ID = "inventRecordId"; /* 存货档案ID*/
public static final String FIELD_AMOUNT = "amount"; /* 数量*/ public static final String FIELD_AMOUNT = "amount"; /* 数量*/
public static final String FIELD_UNIT_WEIGHT = "unitWeight"; /* 单重*/
public static final String FIELD_WEIGHT = "weight"; /* 重量*/ public static final String FIELD_WEIGHT = "weight"; /* 重量*/
public static final String FIELD_REMARK = "remark"; /* 备注*/ public static final String FIELD_REMARK = "remark"; /* 备注*/
public static final String FIELD_KC_ID = "kcId"; /* 库存ID*/ public static final String FIELD_KC_ID = "kcId"; /* 库存ID*/
...@@ -64,6 +65,7 @@ public class HPKC002 extends DaoEPBase { ...@@ -64,6 +65,7 @@ public class HPKC002 extends DaoEPBase {
public static final String COL_INVENT_NAME = "INVENT_NAME"; /* 存货名称*/ public static final String COL_INVENT_NAME = "INVENT_NAME"; /* 存货名称*/
public static final String COL_INVENT_RECORD_ID = "INVENT_RECORD_ID"; /* 存货档案ID*/ public static final String COL_INVENT_RECORD_ID = "INVENT_RECORD_ID"; /* 存货档案ID*/
public static final String COL_AMOUNT = "AMOUNT"; /* 数量*/ public static final String COL_AMOUNT = "AMOUNT"; /* 数量*/
public static final String COL_UNIT_WEIGHT = "UNIT_WEIGHT"; /* 单重*/
public static final String COL_WEIGHT = "WEIGHT"; /* 重量*/ public static final String COL_WEIGHT = "WEIGHT"; /* 重量*/
public static final String COL_REMARK = "REMARK"; /* 备注*/ public static final String COL_REMARK = "REMARK"; /* 备注*/
public static final String COL_KC_ID = "KC_ID"; /* 库存ID*/ public static final String COL_KC_ID = "KC_ID"; /* 库存ID*/
...@@ -76,7 +78,7 @@ public class HPKC002 extends DaoEPBase { ...@@ -76,7 +78,7 @@ public class HPKC002 extends DaoEPBase {
public static final String UPDATE = "HPKC002.update"; public static final String UPDATE = "HPKC002.update";
public static final String DELETE = "HPKC002.delete"; public static final String DELETE = "HPKC002.delete";
private Long id = null; /* 主键id*/ private Long id; /* 主键id*/
private String companyCode = " "; /* 企业编码 预留*/ private String companyCode = " "; /* 企业编码 预留*/
private String depCode = " "; /* 部门编码*/ private String depCode = " "; /* 部门编码*/
private String createdBy = " "; /* 创建人*/ private String createdBy = " "; /* 创建人*/
...@@ -92,11 +94,12 @@ public class HPKC002 extends DaoEPBase { ...@@ -92,11 +94,12 @@ public class HPKC002 extends DaoEPBase {
private String inventType = " "; /* 存货类型*/ private String inventType = " "; /* 存货类型*/
private String inventCode = " "; /* 存货编码*/ private String inventCode = " "; /* 存货编码*/
private String inventName = " "; /* 存货名称*/ private String inventName = " "; /* 存货名称*/
private Long inventRecordId = null; /* 存货档案ID*/ private Long inventRecordId; /* 存货档案ID*/
private BigDecimal amount = new BigDecimal(0.00); /* 数量*/ private BigDecimal amount = new BigDecimal(0.000); /* 数量*/
private BigDecimal weight = new BigDecimal(0.00); /* 重量*/ private BigDecimal unitWeight = new BigDecimal(0.000); /* 单重*/
private BigDecimal weight = new BigDecimal(0.000); /* 重量*/
private String remark = " "; /* 备注*/ private String remark = " "; /* 备注*/
private Long kcId = new Long(0); /* 库存ID*/ private Long kcId; /* 库存ID*/
private String oldReqNo = " "; /* 原领料单号*/ private String oldReqNo = " "; /* 原领料单号*/
private Integer deleteFlag; /* 是否删除0.否1.是*/ private Integer deleteFlag; /* 是否删除0.否1.是*/
...@@ -177,15 +180,22 @@ public class HPKC002 extends DaoEPBase { ...@@ -177,15 +180,22 @@ public class HPKC002 extends DaoEPBase {
eiColumn = new EiColumn(FIELD_AMOUNT); eiColumn = new EiColumn(FIELD_AMOUNT);
eiColumn.setType("N"); eiColumn.setType("N");
eiColumn.setScaleLength(2); eiColumn.setScaleLength(3);
eiColumn.setFieldLength(10); eiColumn.setFieldLength(15);
eiColumn.setDescName("数量"); eiColumn.setDescName("数量");
eiMetadata.addMeta(eiColumn); eiMetadata.addMeta(eiColumn);
eiColumn = new EiColumn(FIELD_UNIT_WEIGHT);
eiColumn.setType("N");
eiColumn.setScaleLength(3);
eiColumn.setFieldLength(15);
eiColumn.setDescName("单重");
eiMetadata.addMeta(eiColumn);
eiColumn = new EiColumn(FIELD_WEIGHT); eiColumn = new EiColumn(FIELD_WEIGHT);
eiColumn.setType("N"); eiColumn.setType("N");
eiColumn.setScaleLength(2); eiColumn.setScaleLength(3);
eiColumn.setFieldLength(10); eiColumn.setFieldLength(15);
eiColumn.setDescName("重量"); eiColumn.setDescName("重量");
eiMetadata.addMeta(eiColumn); eiMetadata.addMeta(eiColumn);
...@@ -504,6 +514,22 @@ public class HPKC002 extends DaoEPBase { ...@@ -504,6 +514,22 @@ public class HPKC002 extends DaoEPBase {
this.amount = amount; this.amount = amount;
} }
/** /**
* get the unitWeight - 单重.
* @return the unitWeight
*/
public BigDecimal getUnitWeight() {
return this.unitWeight;
}
/**
* set the unitWeight - 单重.
*
* @param unitWeight - 单重
*/
public void setUnitWeight(BigDecimal unitWeight) {
this.unitWeight = unitWeight;
}
/**
* get the weight - 重量. * get the weight - 重量.
* @return the weight * @return the weight
*/ */
...@@ -609,6 +635,7 @@ public class HPKC002 extends DaoEPBase { ...@@ -609,6 +635,7 @@ public class HPKC002 extends DaoEPBase {
setInventName(StringUtils.defaultIfEmpty(StringUtils.toString(map.get(FIELD_INVENT_NAME)), inventName)); setInventName(StringUtils.defaultIfEmpty(StringUtils.toString(map.get(FIELD_INVENT_NAME)), inventName));
setInventRecordId(NumberUtils.toLong(StringUtils.toString(map.get(FIELD_INVENT_RECORD_ID)), inventRecordId)); setInventRecordId(NumberUtils.toLong(StringUtils.toString(map.get(FIELD_INVENT_RECORD_ID)), inventRecordId));
setAmount(NumberUtils.toBigDecimal(StringUtils.toString(map.get(FIELD_AMOUNT)), amount)); setAmount(NumberUtils.toBigDecimal(StringUtils.toString(map.get(FIELD_AMOUNT)), amount));
setUnitWeight(NumberUtils.toBigDecimal(StringUtils.toString(map.get(FIELD_UNIT_WEIGHT)), unitWeight));
setWeight(NumberUtils.toBigDecimal(StringUtils.toString(map.get(FIELD_WEIGHT)), weight)); setWeight(NumberUtils.toBigDecimal(StringUtils.toString(map.get(FIELD_WEIGHT)), weight));
setRemark(StringUtils.defaultIfEmpty(StringUtils.toString(map.get(FIELD_REMARK)), remark)); setRemark(StringUtils.defaultIfEmpty(StringUtils.toString(map.get(FIELD_REMARK)), remark));
setKcId(NumberUtils.toLong(StringUtils.toString(map.get(FIELD_KC_ID)), kcId)); setKcId(NumberUtils.toLong(StringUtils.toString(map.get(FIELD_KC_ID)), kcId));
...@@ -641,6 +668,7 @@ public class HPKC002 extends DaoEPBase { ...@@ -641,6 +668,7 @@ public class HPKC002 extends DaoEPBase {
map.put(FIELD_INVENT_NAME, StringUtils.toString(inventName, eiMetadata.getMeta(FIELD_INVENT_NAME))); map.put(FIELD_INVENT_NAME, StringUtils.toString(inventName, eiMetadata.getMeta(FIELD_INVENT_NAME)));
map.put(FIELD_INVENT_RECORD_ID, StringUtils.toString(inventRecordId, eiMetadata.getMeta(FIELD_INVENT_RECORD_ID))); map.put(FIELD_INVENT_RECORD_ID, StringUtils.toString(inventRecordId, eiMetadata.getMeta(FIELD_INVENT_RECORD_ID)));
map.put(FIELD_AMOUNT, StringUtils.toString(amount, eiMetadata.getMeta(FIELD_AMOUNT))); map.put(FIELD_AMOUNT, StringUtils.toString(amount, eiMetadata.getMeta(FIELD_AMOUNT)));
map.put(FIELD_UNIT_WEIGHT, StringUtils.toString(unitWeight, eiMetadata.getMeta(FIELD_UNIT_WEIGHT)));
map.put(FIELD_WEIGHT, StringUtils.toString(weight, eiMetadata.getMeta(FIELD_WEIGHT))); map.put(FIELD_WEIGHT, StringUtils.toString(weight, eiMetadata.getMeta(FIELD_WEIGHT)));
map.put(FIELD_REMARK, StringUtils.toString(remark, eiMetadata.getMeta(FIELD_REMARK))); map.put(FIELD_REMARK, StringUtils.toString(remark, eiMetadata.getMeta(FIELD_REMARK)));
map.put(FIELD_KC_ID, StringUtils.toString(kcId, eiMetadata.getMeta(FIELD_KC_ID))); map.put(FIELD_KC_ID, StringUtils.toString(kcId, eiMetadata.getMeta(FIELD_KC_ID)));
......
...@@ -16,7 +16,7 @@ import com.baosight.iplat4j.core.util.StringUtils; ...@@ -16,7 +16,7 @@ import com.baosight.iplat4j.core.util.StringUtils;
* Copyrigth:Baosight Software LTD.co Copyright (c) 2019. <br> * Copyrigth:Baosight Software LTD.co Copyright (c) 2019. <br>
* *
* @version 1.0 * @version 1.0
* @history 2024-01-24 16:44:57 create * @history 2024-02-27 15:22:08 create
*/ */
public class HPKC005 extends DaoEPBase { public class HPKC005 extends DaoEPBase {
...@@ -34,13 +34,15 @@ public class HPKC005 extends DaoEPBase { ...@@ -34,13 +34,15 @@ public class HPKC005 extends DaoEPBase {
public static final String FIELD_INVENT_NAME = "inventName"; /* 存货名称*/ public static final String FIELD_INVENT_NAME = "inventName"; /* 存货名称*/
public static final String FIELD_INVENT_RECORD_ID = "inventRecordId"; /* 存货档案ID*/ public static final String FIELD_INVENT_RECORD_ID = "inventRecordId"; /* 存货档案ID*/
public static final String FIELD_BOOK_AMOUNT = "bookAmount"; /* 账面数量*/ public static final String FIELD_BOOK_AMOUNT = "bookAmount"; /* 账面数量*/
public static final String FIELD_BOOK_UNIT_WEIGHT = "bookUnitWeight";
public static final String FIELD_BOOK_WEIGHT = "bookWeight"; /* 账面重量*/ public static final String FIELD_BOOK_WEIGHT = "bookWeight"; /* 账面重量*/
public static final String FIELD_ENTITY_AMOUNT = "entityAmount"; /* 实物数量*/ public static final String FIELD_ENTITY_AMOUNT = "entityAmount"; /* 实物数量*/
public static final String FIELD_ENTITY_UNIT_WEIGHT = "entityUnitWeight";
public static final String FIELD_ENTITY_WEIGHT = "entityWeight"; /* 实物重量*/ public static final String FIELD_ENTITY_WEIGHT = "entityWeight"; /* 实物重量*/
public static final String FIELD_DIFF_AMOUNT = "diffAmount"; /* 差异数量*/ public static final String FIELD_DIFF_AMOUNT = "diffAmount"; /* 差异数量*/
public static final String FIELD_DIFF_WEIGHT = "diffWeight"; /* 差异重量*/ public static final String FIELD_DIFF_WEIGHT = "diffWeight"; /* 差异重量*/
public static final String FIELD_KC_ID = "kcId"; /* 库存ID*/ public static final String FIELD_KC_ID = "kcId"; /* 库存ID*/
public static final String FIELD_STATUS = "status"; /* 单据状态 0待提交 1已提交*/ public static final String FIELD_STATUS = "status"; /* 单据状态 0待审核 1已审核*/
public static final String FIELD_REMARK = "remark"; /* 备注*/ public static final String FIELD_REMARK = "remark"; /* 备注*/
public static final String FIELD_OLD_CHECK_NO = "oldCheckNo"; /* 原盘点单号*/ public static final String FIELD_OLD_CHECK_NO = "oldCheckNo"; /* 原盘点单号*/
public static final String FIELD_CREATED_BY = "createdBy"; /* 创建人*/ public static final String FIELD_CREATED_BY = "createdBy"; /* 创建人*/
...@@ -63,13 +65,15 @@ public class HPKC005 extends DaoEPBase { ...@@ -63,13 +65,15 @@ public class HPKC005 extends DaoEPBase {
public static final String COL_INVENT_NAME = "INVENT_NAME"; /* 存货名称*/ public static final String COL_INVENT_NAME = "INVENT_NAME"; /* 存货名称*/
public static final String COL_INVENT_RECORD_ID = "INVENT_RECORD_ID"; /* 存货档案ID*/ public static final String COL_INVENT_RECORD_ID = "INVENT_RECORD_ID"; /* 存货档案ID*/
public static final String COL_BOOK_AMOUNT = "BOOK_AMOUNT"; /* 账面数量*/ public static final String COL_BOOK_AMOUNT = "BOOK_AMOUNT"; /* 账面数量*/
public static final String COL_BOOK_UNIT_WEIGHT = "BOOK_UNIT_WEIGHT";
public static final String COL_BOOK_WEIGHT = "BOOK_WEIGHT"; /* 账面重量*/ public static final String COL_BOOK_WEIGHT = "BOOK_WEIGHT"; /* 账面重量*/
public static final String COL_ENTITY_AMOUNT = "ENTITY_AMOUNT"; /* 实物数量*/ public static final String COL_ENTITY_AMOUNT = "ENTITY_AMOUNT"; /* 实物数量*/
public static final String COL_ENTITY_UNIT_WEIGHT = "ENTITY_UNIT_WEIGHT";
public static final String COL_ENTITY_WEIGHT = "ENTITY_WEIGHT"; /* 实物重量*/ public static final String COL_ENTITY_WEIGHT = "ENTITY_WEIGHT"; /* 实物重量*/
public static final String COL_DIFF_AMOUNT = "DIFF_AMOUNT"; /* 差异数量*/ public static final String COL_DIFF_AMOUNT = "DIFF_AMOUNT"; /* 差异数量*/
public static final String COL_DIFF_WEIGHT = "DIFF_WEIGHT"; /* 差异重量*/ public static final String COL_DIFF_WEIGHT = "DIFF_WEIGHT"; /* 差异重量*/
public static final String COL_KC_ID = "KC_ID"; /* 库存ID*/ public static final String COL_KC_ID = "KC_ID"; /* 库存ID*/
public static final String COL_STATUS = "STATUS"; /* 单据状态 0待提交 1已提交*/ public static final String COL_STATUS = "STATUS"; /* 单据状态 0待审核 1已审核*/
public static final String COL_REMARK = "REMARK"; /* 备注*/ public static final String COL_REMARK = "REMARK"; /* 备注*/
public static final String COL_OLD_CHECK_NO = "OLD_CHECK_NO"; /* 原盘点单号*/ public static final String COL_OLD_CHECK_NO = "OLD_CHECK_NO"; /* 原盘点单号*/
public static final String COL_CREATED_BY = "CREATED_BY"; /* 创建人*/ public static final String COL_CREATED_BY = "CREATED_BY"; /* 创建人*/
...@@ -86,7 +90,7 @@ public class HPKC005 extends DaoEPBase { ...@@ -86,7 +90,7 @@ public class HPKC005 extends DaoEPBase {
public static final String UPDATE = "HPKC005.update"; public static final String UPDATE = "HPKC005.update";
public static final String DELETE = "HPKC005.delete"; public static final String DELETE = "HPKC005.delete";
private Long id = null; private Long id;
private String companyCode = " "; /* 企业编码 预留*/ private String companyCode = " "; /* 企业编码 预留*/
private String depCode = " "; /* 部门编码 预留*/ private String depCode = " "; /* 部门编码 预留*/
private String receiptDate = " "; /* 单据日期*/ private String receiptDate = " "; /* 单据日期*/
...@@ -96,15 +100,17 @@ public class HPKC005 extends DaoEPBase { ...@@ -96,15 +100,17 @@ public class HPKC005 extends DaoEPBase {
private String inventType = " "; /* 存货类型*/ private String inventType = " "; /* 存货类型*/
private String inventCode = " "; /* 存货编码*/ private String inventCode = " "; /* 存货编码*/
private String inventName = " "; /* 存货名称*/ private String inventName = " "; /* 存货名称*/
private Long inventRecordId = null; /* 存货档案ID*/ private Long inventRecordId; /* 存货档案ID*/
private BigDecimal bookAmount = new BigDecimal(0.00); /* 账面数量*/ private BigDecimal bookAmount = new BigDecimal(0.000); /* 账面数量*/
private BigDecimal bookWeight = new BigDecimal(0.00); /* 账面重量*/ private BigDecimal bookUnitWeight = new BigDecimal(0.000);
private BigDecimal entityAmount = new BigDecimal(0.00); /* 实物数量*/ private BigDecimal bookWeight = new BigDecimal(0.000); /* 账面重量*/
private BigDecimal entityWeight = new BigDecimal(0.00); /* 实物重量*/ private BigDecimal entityAmount = new BigDecimal(0.000); /* 实物数量*/
private BigDecimal diffAmount = new BigDecimal(0.00); /* 差异数量*/ private BigDecimal entityUnitWeight = new BigDecimal(0.000);
private BigDecimal diffWeight = new BigDecimal(0.00); /* 差异重量*/ private BigDecimal entityWeight = new BigDecimal(0.000); /* 实物重量*/
private Long kcId = null; /* 库存ID*/ private BigDecimal diffAmount = new BigDecimal(0.000); /* 差异数量*/
private Integer status = new Integer(0); /* 单据状态 0待提交 1已提交*/ private BigDecimal diffWeight = new BigDecimal(0.000); /* 差异重量*/
private Long kcId; /* 库存ID*/
private Integer status; /* 单据状态 0待审核 1已审核*/
private String remark = " "; /* 备注*/ private String remark = " "; /* 备注*/
private String oldCheckNo = " "; /* 原盘点单号*/ private String oldCheckNo = " "; /* 原盘点单号*/
private String createdBy = " "; /* 创建人*/ private String createdBy = " "; /* 创建人*/
...@@ -113,7 +119,7 @@ public class HPKC005 extends DaoEPBase { ...@@ -113,7 +119,7 @@ public class HPKC005 extends DaoEPBase {
private String updatedBy = " "; /* 更新人*/ private String updatedBy = " "; /* 更新人*/
private String updatedName = " "; /* 更新人名称*/ private String updatedName = " "; /* 更新人名称*/
private String updatedTime = " "; /* 更新时间*/ private String updatedTime = " "; /* 更新时间*/
private Integer deleteFlag = new Integer(0); /* 是否删除0.否1.是*/ private Integer deleteFlag; /* 是否删除0.否1.是*/
/** /**
* initialize the metadata. * initialize the metadata.
...@@ -168,43 +174,57 @@ public class HPKC005 extends DaoEPBase { ...@@ -168,43 +174,57 @@ public class HPKC005 extends DaoEPBase {
eiColumn = new EiColumn(FIELD_BOOK_AMOUNT); eiColumn = new EiColumn(FIELD_BOOK_AMOUNT);
eiColumn.setType("N"); eiColumn.setType("N");
eiColumn.setScaleLength(2); eiColumn.setScaleLength(3);
eiColumn.setFieldLength(10); eiColumn.setFieldLength(15);
eiColumn.setDescName("账面数量"); eiColumn.setDescName("账面数量");
eiMetadata.addMeta(eiColumn); eiMetadata.addMeta(eiColumn);
eiColumn = new EiColumn(FIELD_BOOK_UNIT_WEIGHT);
eiColumn.setType("N");
eiColumn.setScaleLength(3);
eiColumn.setFieldLength(15);
eiColumn.setDescName(" ");
eiMetadata.addMeta(eiColumn);
eiColumn = new EiColumn(FIELD_BOOK_WEIGHT); eiColumn = new EiColumn(FIELD_BOOK_WEIGHT);
eiColumn.setType("N"); eiColumn.setType("N");
eiColumn.setScaleLength(2); eiColumn.setScaleLength(3);
eiColumn.setFieldLength(10); eiColumn.setFieldLength(15);
eiColumn.setDescName("账面重量"); eiColumn.setDescName("账面重量");
eiMetadata.addMeta(eiColumn); eiMetadata.addMeta(eiColumn);
eiColumn = new EiColumn(FIELD_ENTITY_AMOUNT); eiColumn = new EiColumn(FIELD_ENTITY_AMOUNT);
eiColumn.setType("N"); eiColumn.setType("N");
eiColumn.setScaleLength(2); eiColumn.setScaleLength(3);
eiColumn.setFieldLength(10); eiColumn.setFieldLength(15);
eiColumn.setDescName("实物数量"); eiColumn.setDescName("实物数量");
eiMetadata.addMeta(eiColumn); eiMetadata.addMeta(eiColumn);
eiColumn = new EiColumn(FIELD_ENTITY_UNIT_WEIGHT);
eiColumn.setType("N");
eiColumn.setScaleLength(3);
eiColumn.setFieldLength(15);
eiColumn.setDescName(" ");
eiMetadata.addMeta(eiColumn);
eiColumn = new EiColumn(FIELD_ENTITY_WEIGHT); eiColumn = new EiColumn(FIELD_ENTITY_WEIGHT);
eiColumn.setType("N"); eiColumn.setType("N");
eiColumn.setScaleLength(2); eiColumn.setScaleLength(3);
eiColumn.setFieldLength(10); eiColumn.setFieldLength(15);
eiColumn.setDescName("实物重量"); eiColumn.setDescName("实物重量");
eiMetadata.addMeta(eiColumn); eiMetadata.addMeta(eiColumn);
eiColumn = new EiColumn(FIELD_DIFF_AMOUNT); eiColumn = new EiColumn(FIELD_DIFF_AMOUNT);
eiColumn.setType("N"); eiColumn.setType("N");
eiColumn.setScaleLength(2); eiColumn.setScaleLength(3);
eiColumn.setFieldLength(10); eiColumn.setFieldLength(15);
eiColumn.setDescName("差异数量"); eiColumn.setDescName("差异数量");
eiMetadata.addMeta(eiColumn); eiMetadata.addMeta(eiColumn);
eiColumn = new EiColumn(FIELD_DIFF_WEIGHT); eiColumn = new EiColumn(FIELD_DIFF_WEIGHT);
eiColumn.setType("N"); eiColumn.setType("N");
eiColumn.setScaleLength(2); eiColumn.setScaleLength(3);
eiColumn.setFieldLength(10); eiColumn.setFieldLength(15);
eiColumn.setDescName("差异重量"); eiColumn.setDescName("差异重量");
eiMetadata.addMeta(eiColumn); eiMetadata.addMeta(eiColumn);
...@@ -213,7 +233,7 @@ public class HPKC005 extends DaoEPBase { ...@@ -213,7 +233,7 @@ public class HPKC005 extends DaoEPBase {
eiMetadata.addMeta(eiColumn); eiMetadata.addMeta(eiColumn);
eiColumn = new EiColumn(FIELD_STATUS); eiColumn = new EiColumn(FIELD_STATUS);
eiColumn.setDescName("单据状态 0待提交 1已提交"); eiColumn.setDescName("单据状态 0待审核 1已审核");
eiMetadata.addMeta(eiColumn); eiMetadata.addMeta(eiColumn);
eiColumn = new EiColumn(FIELD_REMARK); eiColumn = new EiColumn(FIELD_REMARK);
...@@ -455,6 +475,22 @@ public class HPKC005 extends DaoEPBase { ...@@ -455,6 +475,22 @@ public class HPKC005 extends DaoEPBase {
this.bookAmount = bookAmount; this.bookAmount = bookAmount;
} }
/** /**
* get the bookUnitWeight .
* @return the bookUnitWeight
*/
public BigDecimal getBookUnitWeight() {
return this.bookUnitWeight;
}
/**
* set the bookUnitWeight .
*
* @param bookUnitWeight
*/
public void setBookUnitWeight(BigDecimal bookUnitWeight) {
this.bookUnitWeight = bookUnitWeight;
}
/**
* get the bookWeight - 账面重量. * get the bookWeight - 账面重量.
* @return the bookWeight * @return the bookWeight
*/ */
...@@ -487,6 +523,22 @@ public class HPKC005 extends DaoEPBase { ...@@ -487,6 +523,22 @@ public class HPKC005 extends DaoEPBase {
this.entityAmount = entityAmount; this.entityAmount = entityAmount;
} }
/** /**
* get the entityUnitWeight .
* @return the entityUnitWeight
*/
public BigDecimal getEntityUnitWeight() {
return this.entityUnitWeight;
}
/**
* set the entityUnitWeight .
*
* @param entityUnitWeight
*/
public void setEntityUnitWeight(BigDecimal entityUnitWeight) {
this.entityUnitWeight = entityUnitWeight;
}
/**
* get the entityWeight - 实物重量. * get the entityWeight - 实物重量.
* @return the entityWeight * @return the entityWeight
*/ */
...@@ -551,7 +603,7 @@ public class HPKC005 extends DaoEPBase { ...@@ -551,7 +603,7 @@ public class HPKC005 extends DaoEPBase {
this.kcId = kcId; this.kcId = kcId;
} }
/** /**
* get the status - 单据状态 0待提交 1已提交. * get the status - 单据状态 0待审核 1已审核.
* @return the status * @return the status
*/ */
public Integer getStatus() { public Integer getStatus() {
...@@ -559,9 +611,9 @@ public class HPKC005 extends DaoEPBase { ...@@ -559,9 +611,9 @@ public class HPKC005 extends DaoEPBase {
} }
/** /**
* set the status - 单据状态 0待提交 1已提交. * set the status - 单据状态 0待审核 1已审核.
* *
* @param status - 单据状态 0待提交 1已提交 * @param status - 单据状态 0待审核 1已审核
*/ */
public void setStatus(Integer status) { public void setStatus(Integer status) {
this.status = status; this.status = status;
...@@ -730,8 +782,10 @@ public class HPKC005 extends DaoEPBase { ...@@ -730,8 +782,10 @@ public class HPKC005 extends DaoEPBase {
setInventName(StringUtils.defaultIfEmpty(StringUtils.toString(map.get(FIELD_INVENT_NAME)), inventName)); setInventName(StringUtils.defaultIfEmpty(StringUtils.toString(map.get(FIELD_INVENT_NAME)), inventName));
setInventRecordId(NumberUtils.toLong(StringUtils.toString(map.get(FIELD_INVENT_RECORD_ID)), inventRecordId)); setInventRecordId(NumberUtils.toLong(StringUtils.toString(map.get(FIELD_INVENT_RECORD_ID)), inventRecordId));
setBookAmount(NumberUtils.toBigDecimal(StringUtils.toString(map.get(FIELD_BOOK_AMOUNT)), bookAmount)); setBookAmount(NumberUtils.toBigDecimal(StringUtils.toString(map.get(FIELD_BOOK_AMOUNT)), bookAmount));
setBookUnitWeight(NumberUtils.toBigDecimal(StringUtils.toString(map.get(FIELD_BOOK_UNIT_WEIGHT)), bookUnitWeight));
setBookWeight(NumberUtils.toBigDecimal(StringUtils.toString(map.get(FIELD_BOOK_WEIGHT)), bookWeight)); setBookWeight(NumberUtils.toBigDecimal(StringUtils.toString(map.get(FIELD_BOOK_WEIGHT)), bookWeight));
setEntityAmount(NumberUtils.toBigDecimal(StringUtils.toString(map.get(FIELD_ENTITY_AMOUNT)), entityAmount)); setEntityAmount(NumberUtils.toBigDecimal(StringUtils.toString(map.get(FIELD_ENTITY_AMOUNT)), entityAmount));
setEntityUnitWeight(NumberUtils.toBigDecimal(StringUtils.toString(map.get(FIELD_ENTITY_UNIT_WEIGHT)), entityUnitWeight));
setEntityWeight(NumberUtils.toBigDecimal(StringUtils.toString(map.get(FIELD_ENTITY_WEIGHT)), entityWeight)); setEntityWeight(NumberUtils.toBigDecimal(StringUtils.toString(map.get(FIELD_ENTITY_WEIGHT)), entityWeight));
setDiffAmount(NumberUtils.toBigDecimal(StringUtils.toString(map.get(FIELD_DIFF_AMOUNT)), diffAmount)); setDiffAmount(NumberUtils.toBigDecimal(StringUtils.toString(map.get(FIELD_DIFF_AMOUNT)), diffAmount));
setDiffWeight(NumberUtils.toBigDecimal(StringUtils.toString(map.get(FIELD_DIFF_WEIGHT)), diffWeight)); setDiffWeight(NumberUtils.toBigDecimal(StringUtils.toString(map.get(FIELD_DIFF_WEIGHT)), diffWeight));
...@@ -767,8 +821,10 @@ public class HPKC005 extends DaoEPBase { ...@@ -767,8 +821,10 @@ public class HPKC005 extends DaoEPBase {
map.put(FIELD_INVENT_NAME, StringUtils.toString(inventName, eiMetadata.getMeta(FIELD_INVENT_NAME))); map.put(FIELD_INVENT_NAME, StringUtils.toString(inventName, eiMetadata.getMeta(FIELD_INVENT_NAME)));
map.put(FIELD_INVENT_RECORD_ID, StringUtils.toString(inventRecordId, eiMetadata.getMeta(FIELD_INVENT_RECORD_ID))); map.put(FIELD_INVENT_RECORD_ID, StringUtils.toString(inventRecordId, eiMetadata.getMeta(FIELD_INVENT_RECORD_ID)));
map.put(FIELD_BOOK_AMOUNT, StringUtils.toString(bookAmount, eiMetadata.getMeta(FIELD_BOOK_AMOUNT))); map.put(FIELD_BOOK_AMOUNT, StringUtils.toString(bookAmount, eiMetadata.getMeta(FIELD_BOOK_AMOUNT)));
map.put(FIELD_BOOK_UNIT_WEIGHT, StringUtils.toString(bookUnitWeight, eiMetadata.getMeta(FIELD_BOOK_UNIT_WEIGHT)));
map.put(FIELD_BOOK_WEIGHT, StringUtils.toString(bookWeight, eiMetadata.getMeta(FIELD_BOOK_WEIGHT))); map.put(FIELD_BOOK_WEIGHT, StringUtils.toString(bookWeight, eiMetadata.getMeta(FIELD_BOOK_WEIGHT)));
map.put(FIELD_ENTITY_AMOUNT, StringUtils.toString(entityAmount, eiMetadata.getMeta(FIELD_ENTITY_AMOUNT))); map.put(FIELD_ENTITY_AMOUNT, StringUtils.toString(entityAmount, eiMetadata.getMeta(FIELD_ENTITY_AMOUNT)));
map.put(FIELD_ENTITY_UNIT_WEIGHT, StringUtils.toString(entityUnitWeight, eiMetadata.getMeta(FIELD_ENTITY_UNIT_WEIGHT)));
map.put(FIELD_ENTITY_WEIGHT, StringUtils.toString(entityWeight, eiMetadata.getMeta(FIELD_ENTITY_WEIGHT))); map.put(FIELD_ENTITY_WEIGHT, StringUtils.toString(entityWeight, eiMetadata.getMeta(FIELD_ENTITY_WEIGHT)));
map.put(FIELD_DIFF_AMOUNT, StringUtils.toString(diffAmount, eiMetadata.getMeta(FIELD_DIFF_AMOUNT))); map.put(FIELD_DIFF_AMOUNT, StringUtils.toString(diffAmount, eiMetadata.getMeta(FIELD_DIFF_AMOUNT)));
map.put(FIELD_DIFF_WEIGHT, StringUtils.toString(diffWeight, eiMetadata.getMeta(FIELD_DIFF_WEIGHT))); map.put(FIELD_DIFF_WEIGHT, StringUtils.toString(diffWeight, eiMetadata.getMeta(FIELD_DIFF_WEIGHT)));
......
...@@ -16,7 +16,7 @@ import com.baosight.iplat4j.core.util.StringUtils; ...@@ -16,7 +16,7 @@ import com.baosight.iplat4j.core.util.StringUtils;
* Copyrigth:Baosight Software LTD.co Copyright (c) 2019. <br> * Copyrigth:Baosight Software LTD.co Copyright (c) 2019. <br>
* *
* @version 1.0 * @version 1.0
* @history 2024-01-24 16:06:39 create * @history 2024-02-27 14:48:04 create
*/ */
public class HPKC006 extends DaoEPBase { public class HPKC006 extends DaoEPBase {
...@@ -29,11 +29,12 @@ public class HPKC006 extends DaoEPBase { ...@@ -29,11 +29,12 @@ public class HPKC006 extends DaoEPBase {
public static final String FIELD_OTHER_ENTER_NO = "otherEnterNo"; /* 其他入库单号*/ public static final String FIELD_OTHER_ENTER_NO = "otherEnterNo"; /* 其他入库单号*/
public static final String FIELD_WH_CODE = "whCode"; /* 仓库编码*/ public static final String FIELD_WH_CODE = "whCode"; /* 仓库编码*/
public static final String FIELD_WH_NAME = "whName"; /* 仓库名称*/ public static final String FIELD_WH_NAME = "whName"; /* 仓库名称*/
public static final String FIELD_INVENT_TYPE = "inventType"; /* 存货类型*/ public static final String FIELD_INVENT_TYPE = "inventType"; /* 物料类型*/
public static final String FIELD_INVENT_CODE = "inventCode"; /* 存货编码*/ public static final String FIELD_INVENT_CODE = "inventCode"; /* 物料编码*/
public static final String FIELD_INVENT_NAME = "inventName"; /* 存货名称*/ public static final String FIELD_INVENT_NAME = "inventName"; /* 物料名称*/
public static final String FIELD_INVENT_RECORD_ID = "inventRecordId"; /* 存货档案ID*/ public static final String FIELD_INVENT_RECORD_ID = "inventRecordId"; /* 规格*/
public static final String FIELD_AMOUNT = "amount"; /* 数量*/ public static final String FIELD_AMOUNT = "amount"; /* 数量*/
public static final String FIELD_UNIT_WEIGHT = "unitWeight"; /* 单重*/
public static final String FIELD_WEIGHT = "weight"; /* 重量*/ public static final String FIELD_WEIGHT = "weight"; /* 重量*/
public static final String FIELD_LENGTH = "length"; /* 长*/ public static final String FIELD_LENGTH = "length"; /* 长*/
public static final String FIELD_WIDTH = "width"; /* 宽*/ public static final String FIELD_WIDTH = "width"; /* 宽*/
...@@ -59,13 +60,14 @@ public class HPKC006 extends DaoEPBase { ...@@ -59,13 +60,14 @@ public class HPKC006 extends DaoEPBase {
public static final String COL_OTHER_ENTER_NO = "OTHER_ENTER_NO"; /* 其他入库单号*/ public static final String COL_OTHER_ENTER_NO = "OTHER_ENTER_NO"; /* 其他入库单号*/
public static final String COL_WH_CODE = "WH_CODE"; /* 仓库编码*/ public static final String COL_WH_CODE = "WH_CODE"; /* 仓库编码*/
public static final String COL_WH_NAME = "WH_NAME"; /* 仓库名称*/ public static final String COL_WH_NAME = "WH_NAME"; /* 仓库名称*/
public static final String COL_INVENT_TYPE = "INVENT_TYPE"; /* 存货类型*/ public static final String COL_INVENT_TYPE = "INVENT_TYPE"; /* 物料类型*/
public static final String COL_INVENT_CODE = "INVENT_CODE"; /* 存货编码*/ public static final String COL_INVENT_CODE = "INVENT_CODE"; /* 物料编码*/
public static final String COL_INVENT_NAME = "INVENT_NAME"; /* 存货名称*/ public static final String COL_INVENT_NAME = "INVENT_NAME"; /* 物料名称*/
public static final String COL_INVENT_RECORD_ID = "INVENT_RECORD_ID"; /* 规格*/ public static final String COL_INVENT_RECORD_ID = "INVENT_RECORD_ID"; /* 规格*/
public static final String COL_AMOUNT = "AMOUNT"; /* 数量*/ public static final String COL_AMOUNT = "AMOUNT"; /* 数量*/
public static final String COL_UNIT_WEIGHT = "UNIT_WEIGHT"; /* 单重*/
public static final String COL_WEIGHT = "WEIGHT"; /* 重量*/ public static final String COL_WEIGHT = "WEIGHT"; /* 重量*/
public static final String COL_STATUS = "STATUS"; /* 状态 0提交 1保存*/ public static final String COL_STATUS = "STATUS"; /* 状态 0审核 1保存*/
public static final String COL_REMARK = "REMARK"; /* 备注*/ public static final String COL_REMARK = "REMARK"; /* 备注*/
public static final String COL_OLD_ENTER_NO = "OLD_ENTER_NO"; /* 原入库单号*/ public static final String COL_OLD_ENTER_NO = "OLD_ENTER_NO"; /* 原入库单号*/
public static final String COL_CREATED_BY = "CREATED_BY"; /* 创建人*/ public static final String COL_CREATED_BY = "CREATED_BY"; /* 创建人*/
...@@ -82,7 +84,7 @@ public class HPKC006 extends DaoEPBase { ...@@ -82,7 +84,7 @@ public class HPKC006 extends DaoEPBase {
public static final String UPDATE = "HPKC006.update"; public static final String UPDATE = "HPKC006.update";
public static final String DELETE = "HPKC006.delete"; public static final String DELETE = "HPKC006.delete";
private Integer id = null; private Integer id;
private String companyCode = " "; /* 企业编码 预留*/ private String companyCode = " "; /* 企业编码 预留*/
private String depCode = " "; /* 部门编码 预留*/ private String depCode = " "; /* 部门编码 预留*/
private String receiptDate = " "; /* 单据日期*/ private String receiptDate = " "; /* 单据日期*/
...@@ -94,6 +96,7 @@ public class HPKC006 extends DaoEPBase { ...@@ -94,6 +96,7 @@ public class HPKC006 extends DaoEPBase {
private String inventName = " "; /* 存货名称*/ private String inventName = " "; /* 存货名称*/
private Long inventRecordId = null; /* 规格*/ private Long inventRecordId = null; /* 规格*/
private BigDecimal amount = new BigDecimal(0.00); /* 数量*/ private BigDecimal amount = new BigDecimal(0.00); /* 数量*/
private BigDecimal unitWeight = new BigDecimal(0.00); /* 单量*/
private BigDecimal weight = new BigDecimal(0.00); /* 重量*/ private BigDecimal weight = new BigDecimal(0.00); /* 重量*/
private Integer status = new Integer(0); /* 状态 0提交 1保存*/ private Integer status = new Integer(0); /* 状态 0提交 1保存*/
private BigDecimal length = new BigDecimal(0.00); /* 长*/ private BigDecimal length = new BigDecimal(0.00); /* 长*/
...@@ -110,7 +113,7 @@ public class HPKC006 extends DaoEPBase { ...@@ -110,7 +113,7 @@ public class HPKC006 extends DaoEPBase {
private String updatedBy = " "; /* 更新人*/ private String updatedBy = " "; /* 更新人*/
private String updatedName = " "; /* 更新人名称*/ private String updatedName = " "; /* 更新人名称*/
private String updatedTime = " "; /* 更新时间*/ private String updatedTime = " "; /* 更新时间*/
private Integer deleteFlag = new Integer(0); /* 是否删除0.否1.是*/ private Integer deleteFlag; /* 是否删除0.否1.是*/
/** /**
* initialize the metadata. * initialize the metadata.
...@@ -148,15 +151,15 @@ public class HPKC006 extends DaoEPBase { ...@@ -148,15 +151,15 @@ public class HPKC006 extends DaoEPBase {
eiMetadata.addMeta(eiColumn); eiMetadata.addMeta(eiColumn);
eiColumn = new EiColumn(FIELD_INVENT_TYPE); eiColumn = new EiColumn(FIELD_INVENT_TYPE);
eiColumn.setDescName("存货类型"); eiColumn.setDescName("物料类型");
eiMetadata.addMeta(eiColumn); eiMetadata.addMeta(eiColumn);
eiColumn = new EiColumn(FIELD_INVENT_CODE); eiColumn = new EiColumn(FIELD_INVENT_CODE);
eiColumn.setDescName("存货编码"); eiColumn.setDescName("物料编码");
eiMetadata.addMeta(eiColumn); eiMetadata.addMeta(eiColumn);
eiColumn = new EiColumn(FIELD_INVENT_NAME); eiColumn = new EiColumn(FIELD_INVENT_NAME);
eiColumn.setDescName("存货名称"); eiColumn.setDescName("物料名称");
eiMetadata.addMeta(eiColumn); eiMetadata.addMeta(eiColumn);
eiColumn = new EiColumn(FIELD_INVENT_RECORD_ID); eiColumn = new EiColumn(FIELD_INVENT_RECORD_ID);
...@@ -165,15 +168,22 @@ public class HPKC006 extends DaoEPBase { ...@@ -165,15 +168,22 @@ public class HPKC006 extends DaoEPBase {
eiColumn = new EiColumn(FIELD_AMOUNT); eiColumn = new EiColumn(FIELD_AMOUNT);
eiColumn.setType("N"); eiColumn.setType("N");
eiColumn.setScaleLength(2); eiColumn.setScaleLength(3);
eiColumn.setFieldLength(10); eiColumn.setFieldLength(15);
eiColumn.setDescName("数量"); eiColumn.setDescName("数量");
eiMetadata.addMeta(eiColumn); eiMetadata.addMeta(eiColumn);
eiColumn = new EiColumn(FIELD_UNIT_WEIGHT);
eiColumn.setType("N");
eiColumn.setScaleLength(3);
eiColumn.setFieldLength(15);
eiColumn.setDescName("单重");
eiMetadata.addMeta(eiColumn);
eiColumn = new EiColumn(FIELD_WEIGHT); eiColumn = new EiColumn(FIELD_WEIGHT);
eiColumn.setType("N"); eiColumn.setType("N");
eiColumn.setScaleLength(2); eiColumn.setScaleLength(3);
eiColumn.setFieldLength(10); eiColumn.setFieldLength(15);
eiColumn.setDescName("重量"); eiColumn.setDescName("重量");
eiMetadata.addMeta(eiColumn); eiMetadata.addMeta(eiColumn);
...@@ -214,7 +224,7 @@ public class HPKC006 extends DaoEPBase { ...@@ -214,7 +224,7 @@ public class HPKC006 extends DaoEPBase {
eiMetadata.addMeta(eiColumn); eiMetadata.addMeta(eiColumn);
eiColumn = new EiColumn(FIELD_STATUS); eiColumn = new EiColumn(FIELD_STATUS);
eiColumn.setDescName("状态 0提交 1保存"); eiColumn.setDescName("状态 0审核 1保存");
eiMetadata.addMeta(eiColumn); eiMetadata.addMeta(eiColumn);
eiColumn = new EiColumn(FIELD_REMARK); eiColumn = new EiColumn(FIELD_REMARK);
...@@ -376,7 +386,7 @@ public class HPKC006 extends DaoEPBase { ...@@ -376,7 +386,7 @@ public class HPKC006 extends DaoEPBase {
this.whName = whName; this.whName = whName;
} }
/** /**
* get the inventType - 存货类型. * get the inventType - 物料类型.
* @return the inventType * @return the inventType
*/ */
public String getInventType() { public String getInventType() {
...@@ -384,15 +394,15 @@ public class HPKC006 extends DaoEPBase { ...@@ -384,15 +394,15 @@ public class HPKC006 extends DaoEPBase {
} }
/** /**
* set the inventType - 存货类型. * set the inventType - 物料类型.
* *
* @param inventType - 存货类型 * @param inventType - 物料类型
*/ */
public void setInventType(String inventType) { public void setInventType(String inventType) {
this.inventType = inventType; this.inventType = inventType;
} }
/** /**
* get the inventCode - 存货编码. * get the inventCode - 物料编码.
* @return the inventCode * @return the inventCode
*/ */
public String getInventCode() { public String getInventCode() {
...@@ -400,15 +410,15 @@ public class HPKC006 extends DaoEPBase { ...@@ -400,15 +410,15 @@ public class HPKC006 extends DaoEPBase {
} }
/** /**
* set the inventCode - 存货编码. * set the inventCode - 物料编码.
* *
* @param inventCode - 存货编码 * @param inventCode - 物料编码
*/ */
public void setInventCode(String inventCode) { public void setInventCode(String inventCode) {
this.inventCode = inventCode; this.inventCode = inventCode;
} }
/** /**
* get the inventName - 存货名称. * get the inventName - 物料名称.
* @return the inventName * @return the inventName
*/ */
public String getInventName() { public String getInventName() {
...@@ -416,9 +426,9 @@ public class HPKC006 extends DaoEPBase { ...@@ -416,9 +426,9 @@ public class HPKC006 extends DaoEPBase {
} }
/** /**
* set the inventName - 存货名称. * set the inventName - 物料名称.
* *
* @param inventName - 存货名称 * @param inventName - 物料名称
*/ */
public void setInventName(String inventName) { public void setInventName(String inventName) {
this.inventName = inventName; this.inventName = inventName;
...@@ -456,6 +466,22 @@ public class HPKC006 extends DaoEPBase { ...@@ -456,6 +466,22 @@ public class HPKC006 extends DaoEPBase {
this.amount = amount; this.amount = amount;
} }
/** /**
* get the unitWeight - 单重.
* @return the unitWeight
*/
public BigDecimal getUnitWeight() {
return this.unitWeight;
}
/**
* set the unitWeight - 单重.
*
* @param unitWeight - 单重
*/
public void setUnitWeight(BigDecimal unitWeight) {
this.unitWeight = unitWeight;
}
/**
* get the weight - 重量. * get the weight - 重量.
* @return the weight * @return the weight
*/ */
...@@ -576,9 +602,9 @@ public class HPKC006 extends DaoEPBase { ...@@ -576,9 +602,9 @@ public class HPKC006 extends DaoEPBase {
} }
/** /**
* set the status - 状态 0提交 1保存. * set the status - 状态 0审核 1保存.
* *
* @param status - 状态 0提交 1保存 * @param status - 状态 0审核 1保存
*/ */
public void setStatus(Integer status) { public void setStatus(Integer status) {
this.status = status; this.status = status;
...@@ -747,6 +773,7 @@ public class HPKC006 extends DaoEPBase { ...@@ -747,6 +773,7 @@ public class HPKC006 extends DaoEPBase {
setInventName(StringUtils.defaultIfEmpty(StringUtils.toString(map.get(FIELD_INVENT_NAME)), inventName)); setInventName(StringUtils.defaultIfEmpty(StringUtils.toString(map.get(FIELD_INVENT_NAME)), inventName));
setInventRecordId(NumberUtils.toLong(StringUtils.toString(map.get(FIELD_INVENT_RECORD_ID)), inventRecordId)); setInventRecordId(NumberUtils.toLong(StringUtils.toString(map.get(FIELD_INVENT_RECORD_ID)), inventRecordId));
setAmount(NumberUtils.toBigDecimal(StringUtils.toString(map.get(FIELD_AMOUNT)), amount)); setAmount(NumberUtils.toBigDecimal(StringUtils.toString(map.get(FIELD_AMOUNT)), amount));
setUnitWeight(NumberUtils.toBigDecimal(StringUtils.toString(map.get(FIELD_UNIT_WEIGHT)), unitWeight));
setWeight(NumberUtils.toBigDecimal(StringUtils.toString(map.get(FIELD_WEIGHT)), weight)); setWeight(NumberUtils.toBigDecimal(StringUtils.toString(map.get(FIELD_WEIGHT)), weight));
setLength(NumberUtils.toBigDecimal(StringUtils.toString(map.get(FIELD_LENGTH)), length)); setLength(NumberUtils.toBigDecimal(StringUtils.toString(map.get(FIELD_LENGTH)), length));
setWidth(NumberUtils.toBigDecimal(StringUtils.toString(map.get(FIELD_WIDTH)), width)); setWidth(NumberUtils.toBigDecimal(StringUtils.toString(map.get(FIELD_WIDTH)), width));
...@@ -785,6 +812,7 @@ public class HPKC006 extends DaoEPBase { ...@@ -785,6 +812,7 @@ public class HPKC006 extends DaoEPBase {
map.put(FIELD_INVENT_NAME, StringUtils.toString(inventName, eiMetadata.getMeta(FIELD_INVENT_NAME))); map.put(FIELD_INVENT_NAME, StringUtils.toString(inventName, eiMetadata.getMeta(FIELD_INVENT_NAME)));
map.put(FIELD_INVENT_RECORD_ID, StringUtils.toString(inventRecordId, eiMetadata.getMeta(FIELD_INVENT_RECORD_ID))); map.put(FIELD_INVENT_RECORD_ID, StringUtils.toString(inventRecordId, eiMetadata.getMeta(FIELD_INVENT_RECORD_ID)));
map.put(FIELD_AMOUNT, StringUtils.toString(amount, eiMetadata.getMeta(FIELD_AMOUNT))); map.put(FIELD_AMOUNT, StringUtils.toString(amount, eiMetadata.getMeta(FIELD_AMOUNT)));
map.put(FIELD_UNIT_WEIGHT, StringUtils.toString(unitWeight, eiMetadata.getMeta(FIELD_UNIT_WEIGHT)));
map.put(FIELD_WEIGHT, StringUtils.toString(weight, eiMetadata.getMeta(FIELD_WEIGHT))); map.put(FIELD_WEIGHT, StringUtils.toString(weight, eiMetadata.getMeta(FIELD_WEIGHT)));
map.put(FIELD_LENGTH, StringUtils.toString(length, eiMetadata.getMeta(FIELD_LENGTH))); map.put(FIELD_LENGTH, StringUtils.toString(length, eiMetadata.getMeta(FIELD_LENGTH)));
map.put(FIELD_WIDTH, StringUtils.toString(width, eiMetadata.getMeta(FIELD_WIDTH))); map.put(FIELD_WIDTH, StringUtils.toString(width, eiMetadata.getMeta(FIELD_WIDTH)));
......
...@@ -16,7 +16,7 @@ import com.baosight.iplat4j.core.util.StringUtils; ...@@ -16,7 +16,7 @@ import com.baosight.iplat4j.core.util.StringUtils;
* Copyrigth:Baosight Software LTD.co Copyright (c) 2019. <br> * Copyrigth:Baosight Software LTD.co Copyright (c) 2019. <br>
* *
* @version 1.0 * @version 1.0
* @history 2024-01-24 15:34:45 create * @history 2024-02-27 14:48:08 create
*/ */
public class HPKC007 extends DaoEPBase { public class HPKC007 extends DaoEPBase {
...@@ -29,13 +29,14 @@ public class HPKC007 extends DaoEPBase { ...@@ -29,13 +29,14 @@ public class HPKC007 extends DaoEPBase {
public static final String FIELD_OTHER_OUTER_NO = "otherOuterNo"; /* 其他出库单号*/ public static final String FIELD_OTHER_OUTER_NO = "otherOuterNo"; /* 其他出库单号*/
public static final String FIELD_WH_CODE = "whCode"; /* 仓库编码*/ public static final String FIELD_WH_CODE = "whCode"; /* 仓库编码*/
public static final String FIELD_WH_NAME = "whName"; /* 仓库名称*/ public static final String FIELD_WH_NAME = "whName"; /* 仓库名称*/
public static final String FIELD_INVENT_TYPE = "inventType"; /* 存货类型*/ public static final String FIELD_INVENT_TYPE = "inventType"; /* 物料类型*/
public static final String FIELD_INVENT_CODE = "inventCode"; /* 存货编码*/ public static final String FIELD_INVENT_CODE = "inventCode"; /* 物料编码*/
public static final String FIELD_INVENT_NAME = "inventName"; /* 存货名称*/ public static final String FIELD_INVENT_NAME = "inventName"; /* 物料名称*/
public static final String FIELD_INVENT_RECORD_ID = "inventRecordId"; /* 规格ID*/ public static final String FIELD_INVENT_RECORD_ID = "inventRecordId"; /* 规格ID*/
public static final String FIELD_AMOUNT = "amount"; /* 数量*/ public static final String FIELD_AMOUNT = "amount"; /* 数量*/
public static final String FIELD_UNIT_WEIGHT = "unitWeight"; /* 单重*/
public static final String FIELD_WEIGHT = "weight"; /* 重量*/ public static final String FIELD_WEIGHT = "weight"; /* 重量*/
public static final String FIELD_STATUS = "status"; /* 状态 0提交 1保存*/ public static final String FIELD_STATUS = "status"; /* 状态 0审核 1保存*/
public static final String FIELD_KC_ID = "kcId"; /* 库存ID*/ public static final String FIELD_KC_ID = "kcId"; /* 库存ID*/
public static final String FIELD_REMARK = "remark"; /* 备注*/ public static final String FIELD_REMARK = "remark"; /* 备注*/
public static final String FIELD_OLD_OUTER_NO = "oldOuterNo"; /* 原出库单号*/ public static final String FIELD_OLD_OUTER_NO = "oldOuterNo"; /* 原出库单号*/
...@@ -54,13 +55,14 @@ public class HPKC007 extends DaoEPBase { ...@@ -54,13 +55,14 @@ public class HPKC007 extends DaoEPBase {
public static final String COL_OTHER_OUTER_NO = "OTHER_OUTER_NO"; /* 其他出库单号*/ public static final String COL_OTHER_OUTER_NO = "OTHER_OUTER_NO"; /* 其他出库单号*/
public static final String COL_WH_CODE = "WH_CODE"; /* 仓库编码*/ public static final String COL_WH_CODE = "WH_CODE"; /* 仓库编码*/
public static final String COL_WH_NAME = "WH_NAME"; /* 仓库名称*/ public static final String COL_WH_NAME = "WH_NAME"; /* 仓库名称*/
public static final String COL_INVENT_TYPE = "INVENT_TYPE"; /* 存货类型*/ public static final String COL_INVENT_TYPE = "INVENT_TYPE"; /* 物料类型*/
public static final String COL_INVENT_CODE = "INVENT_CODE"; /* 存货编码*/ public static final String COL_INVENT_CODE = "INVENT_CODE"; /* 物料编码*/
public static final String COL_INVENT_NAME = "INVENT_NAME"; /* 存货名称*/ public static final String COL_INVENT_NAME = "INVENT_NAME"; /* 物料名称*/
public static final String COL_INVENT_RECORD_ID = "INVENT_RECORD_ID"; /* 规格ID*/ public static final String COL_INVENT_RECORD_ID = "INVENT_RECORD_ID"; /* 规格ID*/
public static final String COL_AMOUNT = "AMOUNT"; /* 数量*/ public static final String COL_AMOUNT = "AMOUNT"; /* 数量*/
public static final String COL_UNIT_WEIGHT = "UNIT_WEIGHT"; /* 单重*/
public static final String COL_WEIGHT = "WEIGHT"; /* 重量*/ public static final String COL_WEIGHT = "WEIGHT"; /* 重量*/
public static final String COL_STATUS = "STATUS"; /* 状态 0提交 1保存*/ public static final String COL_STATUS = "STATUS"; /* 状态 0审核 1保存*/
public static final String COL_KC_ID = "KC_ID"; /* 库存ID*/ public static final String COL_KC_ID = "KC_ID"; /* 库存ID*/
public static final String COL_REMARK = "REMARK"; /* 备注*/ public static final String COL_REMARK = "REMARK"; /* 备注*/
public static final String COL_OLD_OUTER_NO = "OLD_OUTER_NO"; /* 原出库单号*/ public static final String COL_OLD_OUTER_NO = "OLD_OUTER_NO"; /* 原出库单号*/
...@@ -78,21 +80,22 @@ public class HPKC007 extends DaoEPBase { ...@@ -78,21 +80,22 @@ public class HPKC007 extends DaoEPBase {
public static final String UPDATE = "HPKC007.update"; public static final String UPDATE = "HPKC007.update";
public static final String DELETE = "HPKC007.delete"; public static final String DELETE = "HPKC007.delete";
private Integer id = null; private Integer id;
private String companyCode = " "; /* 企业编码 预留*/ private String companyCode = " "; /* 企业编码 预留*/
private String depCode = " "; /* 部门编码 预留*/ private String depCode = " "; /* 部门编码 预留*/
private String receiptDate = " "; /* 单据日期*/ private String receiptDate = " "; /* 单据日期*/
private String otherOuterNo = " "; /* 其他出库单号*/ private String otherOuterNo = " "; /* 其他出库单号*/
private String whCode = " "; /* 仓库编码*/ private String whCode = " "; /* 仓库编码*/
private String whName = " "; /* 仓库名称*/ private String whName = " "; /* 仓库名称*/
private String inventType = " "; /* 存货类型*/ private String inventType = " "; /* 物料类型*/
private String inventCode = " "; /* 存货编码*/ private String inventCode = " "; /* 物料编码*/
private String inventName = " "; /* 存货名称*/ private String inventName = " "; /* 物料名称*/
private Long inventRecordId = null; /* 规格ID*/ private Long inventRecordId; /* 规格ID*/
private BigDecimal amount = new BigDecimal(0.00); /* 数量*/ private BigDecimal amount = new BigDecimal(0.000); /* 数量*/
private BigDecimal weight = new BigDecimal(0.00); /* 重量*/ private BigDecimal unitWeight = new BigDecimal(0.000); /* 单重*/
private Integer status = 0; /* 状态 0提交 1保存*/ private BigDecimal weight = new BigDecimal(0.000); /* 重量*/
private Long kcId = null; /* 库存ID*/ private Integer status; /* 状态 0审核 1保存*/
private Long kcId; /* 库存ID*/
private String remark = " "; /* 备注*/ private String remark = " "; /* 备注*/
private String oldOuterNo = " "; /* 原出库单号*/ private String oldOuterNo = " "; /* 原出库单号*/
private String createdBy = " "; /* 创建人*/ private String createdBy = " "; /* 创建人*/
...@@ -101,7 +104,7 @@ public class HPKC007 extends DaoEPBase { ...@@ -101,7 +104,7 @@ public class HPKC007 extends DaoEPBase {
private String updatedBy = " "; /* 更新人*/ private String updatedBy = " "; /* 更新人*/
private String updatedName = " "; /* 更新人名称*/ private String updatedName = " "; /* 更新人名称*/
private String updatedTime = " "; /* 更新时间*/ private String updatedTime = " "; /* 更新时间*/
private Integer deleteFlag = 0; /* 是否删除0.否1.是*/ private Integer deleteFlag; /* 是否删除0.否1.是*/
/** /**
* initialize the metadata. * initialize the metadata.
...@@ -139,15 +142,15 @@ public class HPKC007 extends DaoEPBase { ...@@ -139,15 +142,15 @@ public class HPKC007 extends DaoEPBase {
eiMetadata.addMeta(eiColumn); eiMetadata.addMeta(eiColumn);
eiColumn = new EiColumn(FIELD_INVENT_TYPE); eiColumn = new EiColumn(FIELD_INVENT_TYPE);
eiColumn.setDescName("存货类型"); eiColumn.setDescName("物料类型");
eiMetadata.addMeta(eiColumn); eiMetadata.addMeta(eiColumn);
eiColumn = new EiColumn(FIELD_INVENT_CODE); eiColumn = new EiColumn(FIELD_INVENT_CODE);
eiColumn.setDescName("存货编码"); eiColumn.setDescName("物料编码");
eiMetadata.addMeta(eiColumn); eiMetadata.addMeta(eiColumn);
eiColumn = new EiColumn(FIELD_INVENT_NAME); eiColumn = new EiColumn(FIELD_INVENT_NAME);
eiColumn.setDescName("存货名称"); eiColumn.setDescName("物料名称");
eiMetadata.addMeta(eiColumn); eiMetadata.addMeta(eiColumn);
eiColumn = new EiColumn(FIELD_INVENT_RECORD_ID); eiColumn = new EiColumn(FIELD_INVENT_RECORD_ID);
...@@ -156,20 +159,27 @@ public class HPKC007 extends DaoEPBase { ...@@ -156,20 +159,27 @@ public class HPKC007 extends DaoEPBase {
eiColumn = new EiColumn(FIELD_AMOUNT); eiColumn = new EiColumn(FIELD_AMOUNT);
eiColumn.setType("N"); eiColumn.setType("N");
eiColumn.setScaleLength(2); eiColumn.setScaleLength(3);
eiColumn.setFieldLength(10); eiColumn.setFieldLength(15);
eiColumn.setDescName("数量"); eiColumn.setDescName("数量");
eiMetadata.addMeta(eiColumn); eiMetadata.addMeta(eiColumn);
eiColumn = new EiColumn(FIELD_UNIT_WEIGHT);
eiColumn.setType("N");
eiColumn.setScaleLength(3);
eiColumn.setFieldLength(15);
eiColumn.setDescName("单重");
eiMetadata.addMeta(eiColumn);
eiColumn = new EiColumn(FIELD_WEIGHT); eiColumn = new EiColumn(FIELD_WEIGHT);
eiColumn.setType("N"); eiColumn.setType("N");
eiColumn.setScaleLength(2); eiColumn.setScaleLength(3);
eiColumn.setFieldLength(10); eiColumn.setFieldLength(15);
eiColumn.setDescName("重量"); eiColumn.setDescName("重量");
eiMetadata.addMeta(eiColumn); eiMetadata.addMeta(eiColumn);
eiColumn = new EiColumn(FIELD_STATUS); eiColumn = new EiColumn(FIELD_STATUS);
eiColumn.setDescName("状态 0提交 1保存"); eiColumn.setDescName("状态 0审核 1保存");
eiMetadata.addMeta(eiColumn); eiMetadata.addMeta(eiColumn);
eiColumn = new EiColumn(FIELD_KC_ID); eiColumn = new EiColumn(FIELD_KC_ID);
...@@ -335,7 +345,7 @@ public class HPKC007 extends DaoEPBase { ...@@ -335,7 +345,7 @@ public class HPKC007 extends DaoEPBase {
this.whName = whName; this.whName = whName;
} }
/** /**
* get the inventType - 存货类型. * get the inventType - 物料类型.
* @return the inventType * @return the inventType
*/ */
public String getInventType() { public String getInventType() {
...@@ -343,15 +353,15 @@ public class HPKC007 extends DaoEPBase { ...@@ -343,15 +353,15 @@ public class HPKC007 extends DaoEPBase {
} }
/** /**
* set the inventType - 存货类型. * set the inventType - 物料类型.
* *
* @param inventType - 存货类型 * @param inventType - 物料类型
*/ */
public void setInventType(String inventType) { public void setInventType(String inventType) {
this.inventType = inventType; this.inventType = inventType;
} }
/** /**
* get the inventCode - 存货编码. * get the inventCode - 物料编码.
* @return the inventCode * @return the inventCode
*/ */
public String getInventCode() { public String getInventCode() {
...@@ -359,15 +369,15 @@ public class HPKC007 extends DaoEPBase { ...@@ -359,15 +369,15 @@ public class HPKC007 extends DaoEPBase {
} }
/** /**
* set the inventCode - 存货编码. * set the inventCode - 物料编码.
* *
* @param inventCode - 存货编码 * @param inventCode - 物料编码
*/ */
public void setInventCode(String inventCode) { public void setInventCode(String inventCode) {
this.inventCode = inventCode; this.inventCode = inventCode;
} }
/** /**
* get the inventName - 存货名称. * get the inventName - 物料名称.
* @return the inventName * @return the inventName
*/ */
public String getInventName() { public String getInventName() {
...@@ -375,9 +385,9 @@ public class HPKC007 extends DaoEPBase { ...@@ -375,9 +385,9 @@ public class HPKC007 extends DaoEPBase {
} }
/** /**
* set the inventName - 存货名称. * set the inventName - 物料名称.
* *
* @param inventName - 存货名称 * @param inventName - 物料名称
*/ */
public void setInventName(String inventName) { public void setInventName(String inventName) {
this.inventName = inventName; this.inventName = inventName;
...@@ -415,6 +425,22 @@ public class HPKC007 extends DaoEPBase { ...@@ -415,6 +425,22 @@ public class HPKC007 extends DaoEPBase {
this.amount = amount; this.amount = amount;
} }
/** /**
* get the unitWeight - 单重.
* @return the unitWeight
*/
public BigDecimal getUnitWeight() {
return this.unitWeight;
}
/**
* set the unitWeight - 单重.
*
* @param unitWeight - 单重
*/
public void setUnitWeight(BigDecimal unitWeight) {
this.unitWeight = unitWeight;
}
/**
* get the weight - 重量. * get the weight - 重量.
* @return the weight * @return the weight
*/ */
...@@ -431,7 +457,7 @@ public class HPKC007 extends DaoEPBase { ...@@ -431,7 +457,7 @@ public class HPKC007 extends DaoEPBase {
this.weight = weight; this.weight = weight;
} }
/** /**
* get the status - 状态 0提交 1保存. * get the status - 状态 0审核 1保存.
* @return the status * @return the status
*/ */
public Integer getStatus() { public Integer getStatus() {
...@@ -439,9 +465,9 @@ public class HPKC007 extends DaoEPBase { ...@@ -439,9 +465,9 @@ public class HPKC007 extends DaoEPBase {
} }
/** /**
* set the status - 状态 0提交 1保存. * set the status - 状态 0审核 1保存.
* *
* @param status - 状态 0提交 1保存 * @param status - 状态 0审核 1保存
*/ */
public void setStatus(Integer status) { public void setStatus(Integer status) {
this.status = status; this.status = status;
...@@ -626,6 +652,7 @@ public class HPKC007 extends DaoEPBase { ...@@ -626,6 +652,7 @@ public class HPKC007 extends DaoEPBase {
setInventName(StringUtils.defaultIfEmpty(StringUtils.toString(map.get(FIELD_INVENT_NAME)), inventName)); setInventName(StringUtils.defaultIfEmpty(StringUtils.toString(map.get(FIELD_INVENT_NAME)), inventName));
setInventRecordId(NumberUtils.toLong(StringUtils.toString(map.get(FIELD_INVENT_RECORD_ID)), inventRecordId)); setInventRecordId(NumberUtils.toLong(StringUtils.toString(map.get(FIELD_INVENT_RECORD_ID)), inventRecordId));
setAmount(NumberUtils.toBigDecimal(StringUtils.toString(map.get(FIELD_AMOUNT)), amount)); setAmount(NumberUtils.toBigDecimal(StringUtils.toString(map.get(FIELD_AMOUNT)), amount));
setUnitWeight(NumberUtils.toBigDecimal(StringUtils.toString(map.get(FIELD_UNIT_WEIGHT)), unitWeight));
setWeight(NumberUtils.toBigDecimal(StringUtils.toString(map.get(FIELD_WEIGHT)), weight)); setWeight(NumberUtils.toBigDecimal(StringUtils.toString(map.get(FIELD_WEIGHT)), weight));
setStatus(NumberUtils.toInteger(StringUtils.toString(map.get(FIELD_STATUS)), status)); setStatus(NumberUtils.toInteger(StringUtils.toString(map.get(FIELD_STATUS)), status));
setKcId(NumberUtils.toLong(StringUtils.toString(map.get(FIELD_KC_ID)), kcId)); setKcId(NumberUtils.toLong(StringUtils.toString(map.get(FIELD_KC_ID)), kcId));
...@@ -659,6 +686,7 @@ public class HPKC007 extends DaoEPBase { ...@@ -659,6 +686,7 @@ public class HPKC007 extends DaoEPBase {
map.put(FIELD_INVENT_NAME, StringUtils.toString(inventName, eiMetadata.getMeta(FIELD_INVENT_NAME))); map.put(FIELD_INVENT_NAME, StringUtils.toString(inventName, eiMetadata.getMeta(FIELD_INVENT_NAME)));
map.put(FIELD_INVENT_RECORD_ID, StringUtils.toString(inventRecordId, eiMetadata.getMeta(FIELD_INVENT_RECORD_ID))); map.put(FIELD_INVENT_RECORD_ID, StringUtils.toString(inventRecordId, eiMetadata.getMeta(FIELD_INVENT_RECORD_ID)));
map.put(FIELD_AMOUNT, StringUtils.toString(amount, eiMetadata.getMeta(FIELD_AMOUNT))); map.put(FIELD_AMOUNT, StringUtils.toString(amount, eiMetadata.getMeta(FIELD_AMOUNT)));
map.put(FIELD_UNIT_WEIGHT, StringUtils.toString(unitWeight, eiMetadata.getMeta(FIELD_UNIT_WEIGHT)));
map.put(FIELD_WEIGHT, StringUtils.toString(weight, eiMetadata.getMeta(FIELD_WEIGHT))); map.put(FIELD_WEIGHT, StringUtils.toString(weight, eiMetadata.getMeta(FIELD_WEIGHT)));
map.put(FIELD_STATUS, StringUtils.toString(status, eiMetadata.getMeta(FIELD_STATUS))); map.put(FIELD_STATUS, StringUtils.toString(status, eiMetadata.getMeta(FIELD_STATUS)));
map.put(FIELD_KC_ID, StringUtils.toString(kcId, eiMetadata.getMeta(FIELD_KC_ID))); map.put(FIELD_KC_ID, StringUtils.toString(kcId, eiMetadata.getMeta(FIELD_KC_ID)));
......
...@@ -16,7 +16,7 @@ import com.baosight.iplat4j.core.util.StringUtils; ...@@ -16,7 +16,7 @@ import com.baosight.iplat4j.core.util.StringUtils;
* Copyrigth:Baosight Software LTD.co Copyright (c) 2019. <br> * Copyrigth:Baosight Software LTD.co Copyright (c) 2019. <br>
* *
* @version 1.0 * @version 1.0
* @history 2024-01-25 17:57:24 create * @history 2024-02-27 14:11:00 create
*/ */
public class HPKC010 extends DaoEPBase { public class HPKC010 extends DaoEPBase {
...@@ -32,6 +32,7 @@ public class HPKC010 extends DaoEPBase { ...@@ -32,6 +32,7 @@ public class HPKC010 extends DaoEPBase {
public static final String FIELD_INVENT_NAME = "inventName"; /* 物料名称*/ public static final String FIELD_INVENT_NAME = "inventName"; /* 物料名称*/
public static final String FIELD_INVENT_RECORD_ID = "inventRecordId"; /* 存货档案ID*/ public static final String FIELD_INVENT_RECORD_ID = "inventRecordId"; /* 存货档案ID*/
public static final String FIELD_AMOUNT = "amount"; /* 数量*/ public static final String FIELD_AMOUNT = "amount"; /* 数量*/
public static final String FIELD_UNIT_WEIGHT = "unitWeight"; /* 单重*/
public static final String FIELD_WEIGHT = "weight"; /* 重量*/ public static final String FIELD_WEIGHT = "weight"; /* 重量*/
public static final String FIELD_CREATED_BY = "createdBy"; /* 创建人*/ public static final String FIELD_CREATED_BY = "createdBy"; /* 创建人*/
public static final String FIELD_CREATED_NAME = "createdName"; /* 创建人名称*/ public static final String FIELD_CREATED_NAME = "createdName"; /* 创建人名称*/
...@@ -51,6 +52,7 @@ public class HPKC010 extends DaoEPBase { ...@@ -51,6 +52,7 @@ public class HPKC010 extends DaoEPBase {
public static final String COL_INVENT_NAME = "INVENT_NAME"; /* 物料名称*/ public static final String COL_INVENT_NAME = "INVENT_NAME"; /* 物料名称*/
public static final String COL_INVENT_RECORD_ID = "INVENT_RECORD_ID"; /* 存货档案ID*/ public static final String COL_INVENT_RECORD_ID = "INVENT_RECORD_ID"; /* 存货档案ID*/
public static final String COL_AMOUNT = "AMOUNT"; /* 数量*/ public static final String COL_AMOUNT = "AMOUNT"; /* 数量*/
public static final String COL_UNIT_WEIGHT = "UNIT_WEIGHT"; /* 单重*/
public static final String COL_WEIGHT = "WEIGHT"; /* 重量*/ public static final String COL_WEIGHT = "WEIGHT"; /* 重量*/
public static final String COL_CREATED_BY = "CREATED_BY"; /* 创建人*/ public static final String COL_CREATED_BY = "CREATED_BY"; /* 创建人*/
public static final String COL_CREATED_NAME = "CREATED_NAME"; /* 创建人名称*/ public static final String COL_CREATED_NAME = "CREATED_NAME"; /* 创建人名称*/
...@@ -66,7 +68,7 @@ public class HPKC010 extends DaoEPBase { ...@@ -66,7 +68,7 @@ public class HPKC010 extends DaoEPBase {
public static final String UPDATE = "HPKC010.update"; public static final String UPDATE = "HPKC010.update";
public static final String DELETE = "HPKC010.delete"; public static final String DELETE = "HPKC010.delete";
private Long id = null; private Long id;
private String companyCode = " "; /* 企业编码*/ private String companyCode = " "; /* 企业编码*/
private String depCode = " "; /* 部门编码*/ private String depCode = " "; /* 部门编码*/
private String whCode = " "; /* 仓库编码*/ private String whCode = " "; /* 仓库编码*/
...@@ -74,16 +76,17 @@ public class HPKC010 extends DaoEPBase { ...@@ -74,16 +76,17 @@ public class HPKC010 extends DaoEPBase {
private String inventType = " "; /* 物料类型*/ private String inventType = " "; /* 物料类型*/
private String inventCode = " "; /* 物料编码*/ private String inventCode = " "; /* 物料编码*/
private String inventName = " "; /* 物料名称*/ private String inventName = " "; /* 物料名称*/
private Long inventRecordId = null; /* 存货档案ID*/ private Long inventRecordId = new Long(0); /* 存货档案ID*/
private BigDecimal amount = new BigDecimal("0"); /* 数量*/ private BigDecimal amount = new BigDecimal(0.000); /* 数量*/
private BigDecimal weight = new BigDecimal("0"); /* 重量*/ private BigDecimal unitWeight = new BigDecimal(0.000); /* 单重*/
private BigDecimal weight = new BigDecimal(0.000); /* 重量*/
private String createdBy = " "; /* 创建人*/ private String createdBy = " "; /* 创建人*/
private String createdName = " "; /* 创建人名称*/ private String createdName = " "; /* 创建人名称*/
private String createdTime = " "; /* 创建时间*/ private String createdTime = " "; /* 创建时间*/
private String updatedBy = " "; /* 更新人*/ private String updatedBy = " "; /* 更新人*/
private String updatedName = " "; /* 更新人名称*/ private String updatedName = " "; /* 更新人名称*/
private String updatedTime = " "; /* 更新时间*/ private String updatedTime = " "; /* 更新时间*/
private Integer version = null; /* 版本号*/ private Integer version; /* 版本号*/
/** /**
* initialize the metadata. * initialize the metadata.
...@@ -130,15 +133,22 @@ public class HPKC010 extends DaoEPBase { ...@@ -130,15 +133,22 @@ public class HPKC010 extends DaoEPBase {
eiColumn = new EiColumn(FIELD_AMOUNT); eiColumn = new EiColumn(FIELD_AMOUNT);
eiColumn.setType("N"); eiColumn.setType("N");
eiColumn.setScaleLength(0); eiColumn.setScaleLength(3);
eiColumn.setFieldLength(12); eiColumn.setFieldLength(15);
eiColumn.setDescName("数量"); eiColumn.setDescName("数量");
eiMetadata.addMeta(eiColumn); eiMetadata.addMeta(eiColumn);
eiColumn = new EiColumn(FIELD_UNIT_WEIGHT);
eiColumn.setType("N");
eiColumn.setScaleLength(3);
eiColumn.setFieldLength(15);
eiColumn.setDescName("单重");
eiMetadata.addMeta(eiColumn);
eiColumn = new EiColumn(FIELD_WEIGHT); eiColumn = new EiColumn(FIELD_WEIGHT);
eiColumn.setType("N"); eiColumn.setType("N");
eiColumn.setScaleLength(0); eiColumn.setScaleLength(3);
eiColumn.setFieldLength(12); eiColumn.setFieldLength(15);
eiColumn.setDescName("重量"); eiColumn.setDescName("重量");
eiMetadata.addMeta(eiColumn); eiMetadata.addMeta(eiColumn);
...@@ -341,6 +351,22 @@ public class HPKC010 extends DaoEPBase { ...@@ -341,6 +351,22 @@ public class HPKC010 extends DaoEPBase {
this.amount = amount; this.amount = amount;
} }
/** /**
* get the unitWeight - 单重.
* @return the unitWeight
*/
public BigDecimal getUnitWeight() {
return this.unitWeight;
}
/**
* set the unitWeight - 单重.
*
* @param unitWeight - 单重
*/
public void setUnitWeight(BigDecimal unitWeight) {
this.unitWeight = unitWeight;
}
/**
* get the weight - 重量. * get the weight - 重量.
* @return the weight * @return the weight
*/ */
...@@ -486,6 +512,7 @@ public class HPKC010 extends DaoEPBase { ...@@ -486,6 +512,7 @@ public class HPKC010 extends DaoEPBase {
setInventName(StringUtils.defaultIfEmpty(StringUtils.toString(map.get(FIELD_INVENT_NAME)), inventName)); setInventName(StringUtils.defaultIfEmpty(StringUtils.toString(map.get(FIELD_INVENT_NAME)), inventName));
setInventRecordId(NumberUtils.toLong(StringUtils.toString(map.get(FIELD_INVENT_RECORD_ID)), inventRecordId)); setInventRecordId(NumberUtils.toLong(StringUtils.toString(map.get(FIELD_INVENT_RECORD_ID)), inventRecordId));
setAmount(NumberUtils.toBigDecimal(StringUtils.toString(map.get(FIELD_AMOUNT)), amount)); setAmount(NumberUtils.toBigDecimal(StringUtils.toString(map.get(FIELD_AMOUNT)), amount));
setUnitWeight(NumberUtils.toBigDecimal(StringUtils.toString(map.get(FIELD_UNIT_WEIGHT)), unitWeight));
setWeight(NumberUtils.toBigDecimal(StringUtils.toString(map.get(FIELD_WEIGHT)), weight)); setWeight(NumberUtils.toBigDecimal(StringUtils.toString(map.get(FIELD_WEIGHT)), weight));
setCreatedBy(StringUtils.defaultIfEmpty(StringUtils.toString(map.get(FIELD_CREATED_BY)), createdBy)); setCreatedBy(StringUtils.defaultIfEmpty(StringUtils.toString(map.get(FIELD_CREATED_BY)), createdBy));
setCreatedName(StringUtils.defaultIfEmpty(StringUtils.toString(map.get(FIELD_CREATED_NAME)), createdName)); setCreatedName(StringUtils.defaultIfEmpty(StringUtils.toString(map.get(FIELD_CREATED_NAME)), createdName));
...@@ -513,6 +540,7 @@ public class HPKC010 extends DaoEPBase { ...@@ -513,6 +540,7 @@ public class HPKC010 extends DaoEPBase {
map.put(FIELD_INVENT_NAME, StringUtils.toString(inventName, eiMetadata.getMeta(FIELD_INVENT_NAME))); map.put(FIELD_INVENT_NAME, StringUtils.toString(inventName, eiMetadata.getMeta(FIELD_INVENT_NAME)));
map.put(FIELD_INVENT_RECORD_ID, StringUtils.toString(inventRecordId, eiMetadata.getMeta(FIELD_INVENT_RECORD_ID))); map.put(FIELD_INVENT_RECORD_ID, StringUtils.toString(inventRecordId, eiMetadata.getMeta(FIELD_INVENT_RECORD_ID)));
map.put(FIELD_AMOUNT, StringUtils.toString(amount, eiMetadata.getMeta(FIELD_AMOUNT))); map.put(FIELD_AMOUNT, StringUtils.toString(amount, eiMetadata.getMeta(FIELD_AMOUNT)));
map.put(FIELD_UNIT_WEIGHT, StringUtils.toString(unitWeight, eiMetadata.getMeta(FIELD_UNIT_WEIGHT)));
map.put(FIELD_WEIGHT, StringUtils.toString(weight, eiMetadata.getMeta(FIELD_WEIGHT))); map.put(FIELD_WEIGHT, StringUtils.toString(weight, eiMetadata.getMeta(FIELD_WEIGHT)));
map.put(FIELD_CREATED_BY, StringUtils.toString(createdBy, eiMetadata.getMeta(FIELD_CREATED_BY))); map.put(FIELD_CREATED_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_NAME, StringUtils.toString(createdName, eiMetadata.getMeta(FIELD_CREATED_NAME)));
......
...@@ -16,7 +16,7 @@ import com.baosight.iplat4j.core.util.StringUtils; ...@@ -16,7 +16,7 @@ import com.baosight.iplat4j.core.util.StringUtils;
* Copyrigth:Baosight Software LTD.co Copyright (c) 2019. <br> * Copyrigth:Baosight Software LTD.co Copyright (c) 2019. <br>
* *
* @version 1.0 * @version 1.0
* @history 2024-01-25 18:41:22 create * @history 2024-02-27 14:11:04 create
*/ */
public class HPKC010A extends DaoEPBase { public class HPKC010A extends DaoEPBase {
...@@ -33,6 +33,7 @@ public class HPKC010A extends DaoEPBase { ...@@ -33,6 +33,7 @@ public class HPKC010A extends DaoEPBase {
public static final String FIELD_INVENT_NAME = "inventName"; /* 物料名称*/ public static final String FIELD_INVENT_NAME = "inventName"; /* 物料名称*/
public static final String FIELD_INVENT_RECORD_ID = "inventRecordId"; /* 存货档案ID*/ public static final String FIELD_INVENT_RECORD_ID = "inventRecordId"; /* 存货档案ID*/
public static final String FIELD_AMOUNT = "amount"; /* 数量*/ public static final String FIELD_AMOUNT = "amount"; /* 数量*/
public static final String FIELD_UNIT_WEIGHT = "unitWeight"; /* 单重*/
public static final String FIELD_WEIGHT = "weight"; /* 重量*/ public static final String FIELD_WEIGHT = "weight"; /* 重量*/
public static final String FIELD_CREATED_BY = "createdBy"; /* 创建人*/ public static final String FIELD_CREATED_BY = "createdBy"; /* 创建人*/
public static final String FIELD_CREATED_NAME = "createdName"; /* 创建人名称*/ public static final String FIELD_CREATED_NAME = "createdName"; /* 创建人名称*/
...@@ -53,6 +54,7 @@ public class HPKC010A extends DaoEPBase { ...@@ -53,6 +54,7 @@ public class HPKC010A extends DaoEPBase {
public static final String COL_INVENT_NAME = "INVENT_NAME"; /* 物料名称*/ public static final String COL_INVENT_NAME = "INVENT_NAME"; /* 物料名称*/
public static final String COL_INVENT_RECORD_ID = "INVENT_RECORD_ID"; /* 存货档案ID*/ public static final String COL_INVENT_RECORD_ID = "INVENT_RECORD_ID"; /* 存货档案ID*/
public static final String COL_AMOUNT = "AMOUNT"; /* 数量*/ public static final String COL_AMOUNT = "AMOUNT"; /* 数量*/
public static final String COL_UNIT_WEIGHT = "UNIT_WEIGHT"; /* 单重*/
public static final String COL_WEIGHT = "WEIGHT"; /* 重量*/ public static final String COL_WEIGHT = "WEIGHT"; /* 重量*/
public static final String COL_CREATED_BY = "CREATED_BY"; /* 创建人*/ public static final String COL_CREATED_BY = "CREATED_BY"; /* 创建人*/
public static final String COL_CREATED_NAME = "CREATED_NAME"; /* 创建人名称*/ public static final String COL_CREATED_NAME = "CREATED_NAME"; /* 创建人名称*/
...@@ -68,7 +70,7 @@ public class HPKC010A extends DaoEPBase { ...@@ -68,7 +70,7 @@ public class HPKC010A extends DaoEPBase {
public static final String UPDATE = "HPKC010A.update"; public static final String UPDATE = "HPKC010A.update";
public static final String DELETE = "HPKC010A.delete"; public static final String DELETE = "HPKC010A.delete";
private Long id = null; private Long id;
private String companyCode = " "; /* 企业编码*/ private String companyCode = " "; /* 企业编码*/
private String depCode = " "; /* 部门编码*/ private String depCode = " "; /* 部门编码*/
private String dateProc = " "; /* 日期*/ private String dateProc = " "; /* 日期*/
...@@ -77,16 +79,17 @@ public class HPKC010A extends DaoEPBase { ...@@ -77,16 +79,17 @@ public class HPKC010A extends DaoEPBase {
private String inventType = " "; /* 物料类型*/ private String inventType = " "; /* 物料类型*/
private String inventCode = " "; /* 物料编码*/ private String inventCode = " "; /* 物料编码*/
private String inventName = " "; /* 物料名称*/ private String inventName = " "; /* 物料名称*/
private Long inventRecordId = null; /* 存货档案ID*/ private Long inventRecordId; /* 存货档案ID*/
private BigDecimal amount = new BigDecimal("0"); /* 数量*/ private BigDecimal amount = new BigDecimal(0.000); /* 数量*/
private BigDecimal weight = new BigDecimal("0"); /* 重量*/ private BigDecimal unitWeight = new BigDecimal(0.000); /* 单重*/
private BigDecimal weight = new BigDecimal(0.000); /* 重量*/
private String createdBy = " "; /* 创建人*/ private String createdBy = " "; /* 创建人*/
private String createdName = " "; /* 创建人名称*/ private String createdName = " "; /* 创建人名称*/
private String createdTime = " "; /* 创建时间*/ private String createdTime = " "; /* 创建时间*/
private String updatedBy = " "; /* 更新人*/ private String updatedBy = " "; /* 更新人*/
private String updatedName = " "; /* 更新人名称*/ private String updatedName = " "; /* 更新人名称*/
private String updatedTime = " "; /* 更新时间*/ private String updatedTime = " "; /* 更新时间*/
private Integer version = null; /* 版本号*/ private Integer version; /* 版本号*/
/** /**
* initialize the metadata. * initialize the metadata.
...@@ -137,15 +140,22 @@ public class HPKC010A extends DaoEPBase { ...@@ -137,15 +140,22 @@ public class HPKC010A extends DaoEPBase {
eiColumn = new EiColumn(FIELD_AMOUNT); eiColumn = new EiColumn(FIELD_AMOUNT);
eiColumn.setType("N"); eiColumn.setType("N");
eiColumn.setScaleLength(0); eiColumn.setScaleLength(3);
eiColumn.setFieldLength(12); eiColumn.setFieldLength(15);
eiColumn.setDescName("数量"); eiColumn.setDescName("数量");
eiMetadata.addMeta(eiColumn); eiMetadata.addMeta(eiColumn);
eiColumn = new EiColumn(FIELD_UNIT_WEIGHT);
eiColumn.setType("N");
eiColumn.setScaleLength(3);
eiColumn.setFieldLength(15);
eiColumn.setDescName("单重");
eiMetadata.addMeta(eiColumn);
eiColumn = new EiColumn(FIELD_WEIGHT); eiColumn = new EiColumn(FIELD_WEIGHT);
eiColumn.setType("N"); eiColumn.setType("N");
eiColumn.setScaleLength(0); eiColumn.setScaleLength(3);
eiColumn.setFieldLength(12); eiColumn.setFieldLength(15);
eiColumn.setDescName("重量"); eiColumn.setDescName("重量");
eiMetadata.addMeta(eiColumn); eiMetadata.addMeta(eiColumn);
...@@ -364,6 +374,22 @@ public class HPKC010A extends DaoEPBase { ...@@ -364,6 +374,22 @@ public class HPKC010A extends DaoEPBase {
this.amount = amount; this.amount = amount;
} }
/** /**
* get the unitWeight - 单重.
* @return the unitWeight
*/
public BigDecimal getUnitWeight() {
return this.unitWeight;
}
/**
* set the unitWeight - 单重.
*
* @param unitWeight - 单重
*/
public void setUnitWeight(BigDecimal unitWeight) {
this.unitWeight = unitWeight;
}
/**
* get the weight - 重量. * get the weight - 重量.
* @return the weight * @return the weight
*/ */
...@@ -510,6 +536,7 @@ public class HPKC010A extends DaoEPBase { ...@@ -510,6 +536,7 @@ public class HPKC010A extends DaoEPBase {
setInventName(StringUtils.defaultIfEmpty(StringUtils.toString(map.get(FIELD_INVENT_NAME)), inventName)); setInventName(StringUtils.defaultIfEmpty(StringUtils.toString(map.get(FIELD_INVENT_NAME)), inventName));
setInventRecordId(NumberUtils.toLong(StringUtils.toString(map.get(FIELD_INVENT_RECORD_ID)), inventRecordId)); setInventRecordId(NumberUtils.toLong(StringUtils.toString(map.get(FIELD_INVENT_RECORD_ID)), inventRecordId));
setAmount(NumberUtils.toBigDecimal(StringUtils.toString(map.get(FIELD_AMOUNT)), amount)); setAmount(NumberUtils.toBigDecimal(StringUtils.toString(map.get(FIELD_AMOUNT)), amount));
setUnitWeight(NumberUtils.toBigDecimal(StringUtils.toString(map.get(FIELD_UNIT_WEIGHT)), unitWeight));
setWeight(NumberUtils.toBigDecimal(StringUtils.toString(map.get(FIELD_WEIGHT)), weight)); setWeight(NumberUtils.toBigDecimal(StringUtils.toString(map.get(FIELD_WEIGHT)), weight));
setCreatedBy(StringUtils.defaultIfEmpty(StringUtils.toString(map.get(FIELD_CREATED_BY)), createdBy)); setCreatedBy(StringUtils.defaultIfEmpty(StringUtils.toString(map.get(FIELD_CREATED_BY)), createdBy));
setCreatedName(StringUtils.defaultIfEmpty(StringUtils.toString(map.get(FIELD_CREATED_NAME)), createdName)); setCreatedName(StringUtils.defaultIfEmpty(StringUtils.toString(map.get(FIELD_CREATED_NAME)), createdName));
...@@ -538,6 +565,7 @@ public class HPKC010A extends DaoEPBase { ...@@ -538,6 +565,7 @@ public class HPKC010A extends DaoEPBase {
map.put(FIELD_INVENT_NAME, StringUtils.toString(inventName, eiMetadata.getMeta(FIELD_INVENT_NAME))); map.put(FIELD_INVENT_NAME, StringUtils.toString(inventName, eiMetadata.getMeta(FIELD_INVENT_NAME)));
map.put(FIELD_INVENT_RECORD_ID, StringUtils.toString(inventRecordId, eiMetadata.getMeta(FIELD_INVENT_RECORD_ID))); map.put(FIELD_INVENT_RECORD_ID, StringUtils.toString(inventRecordId, eiMetadata.getMeta(FIELD_INVENT_RECORD_ID)));
map.put(FIELD_AMOUNT, StringUtils.toString(amount, eiMetadata.getMeta(FIELD_AMOUNT))); map.put(FIELD_AMOUNT, StringUtils.toString(amount, eiMetadata.getMeta(FIELD_AMOUNT)));
map.put(FIELD_UNIT_WEIGHT, StringUtils.toString(unitWeight, eiMetadata.getMeta(FIELD_UNIT_WEIGHT)));
map.put(FIELD_WEIGHT, StringUtils.toString(weight, eiMetadata.getMeta(FIELD_WEIGHT))); map.put(FIELD_WEIGHT, StringUtils.toString(weight, eiMetadata.getMeta(FIELD_WEIGHT)));
map.put(FIELD_CREATED_BY, StringUtils.toString(createdBy, eiMetadata.getMeta(FIELD_CREATED_BY))); map.put(FIELD_CREATED_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_NAME, StringUtils.toString(createdName, eiMetadata.getMeta(FIELD_CREATED_NAME)));
......
package com.baosight.hpjx.hp.kc.domain;
import com.baosight.iplat4j.core.data.DaoEPBase;
import com.baosight.iplat4j.core.ei.EiColumn;
import com.baosight.iplat4j.core.util.NumberUtils;
import com.baosight.iplat4j.core.util.StringUtils;
import java.math.BigDecimal;
import java.util.HashMap;
import java.util.Map;
/**
* Project: <br>
* Title:THpkc010.java <br>
* Description: <br>
*
* Copyrigth:Baosight Software LTD.co Copyright (c) 2019. <br>
*
* @version 1.0
* @history 2024-01-25 17:57:24 create
*/
public class HPKC012 extends HPKC010 {
private static final long serialVersionUID = 1L;
public static final String FIELD_WARN_NUM = "warnNum"; /* 预警数量*/
public static final String COL_WARN_NUM = "WARN_NUM"; /* 预警数量*/
public static final String QUERY = "HPKC012.query";
private BigDecimal warnNum = new BigDecimal("0"); /* 预警数量*/
/**
* initialize the metadata.
*/
public void initMetaData() {
EiColumn eiColumn;
eiColumn = new EiColumn(FIELD_WARN_NUM);
eiColumn.setType("N");
eiColumn.setScaleLength(0);
eiColumn.setFieldLength(12);
eiColumn.setDescName("预警数量");
eiMetadata.addMeta(eiColumn);
}
/**
* the constructor.
*/
public HPKC012() {
super.initMetaData();
initMetaData();
}
/**
* get the warnNum - 预警数量.
* @return the warnNum
*/
public BigDecimal getWarnNum() {
return this.warnNum;
}
/**
* set the warnNum - 预警数量.
*
* @param warnNum - 预警数量
*/
public void setWarnNum(BigDecimal warnNum) {
this.warnNum = warnNum;
}
/**
* get the value from Map.
*
* @param map - source data map
*/
@Override
public void fromMap(Map map) {
super.fromMap(map);
setWarnNum(NumberUtils.toBigDecimal(StringUtils.toString(map.get(FIELD_WARN_NUM)), warnNum));
}
/**
* set the value to Map.
*/
@Override
public Map toMap() {
Map map = super.toMap();
map.put(FIELD_WARN_NUM, StringUtils.toString(warnNum, eiMetadata.getMeta(FIELD_WARN_NUM)));
return map;
}
}
...@@ -35,7 +35,6 @@ import java.util.Map; ...@@ -35,7 +35,6 @@ import java.util.Map;
*/ */
public class ServiceHPKC001 extends ServiceBase { public class ServiceHPKC001 extends ServiceBase {
// 指定存货类型 // 指定存货类型
private static final Integer[] DEFAULT_INVENT_CODE = {InventTypeEnum.RAW.getCode(), private static final Integer[] DEFAULT_INVENT_CODE = {InventTypeEnum.RAW.getCode(),
InventTypeEnum.CONSUMABLE.getCode()}; InventTypeEnum.CONSUMABLE.getCode()};
...@@ -46,7 +45,7 @@ public class ServiceHPKC001 extends ServiceBase { ...@@ -46,7 +45,7 @@ public class ServiceHPKC001 extends ServiceBase {
* @param inInfo * @param inInfo
* @return * @return
*/ */
@OperationLogAnnotation(operModul = "采购入库单",operType = "查询",operDesc = "初始化") @OperationLogAnnotation(operModul = "采购入库单", operType = "查询", operDesc = "初始化")
public EiInfo initLoad(EiInfo inInfo) { public EiInfo initLoad(EiInfo inInfo) {
try { try {
Map queryMap = new HashMap(); Map queryMap = new HashMap();
...@@ -68,7 +67,7 @@ public class ServiceHPKC001 extends ServiceBase { ...@@ -68,7 +67,7 @@ public class ServiceHPKC001 extends ServiceBase {
* @param inInfo * @param inInfo
* @return * @return
*/ */
@OperationLogAnnotation(operModul = "采购入库单",operType = "查询",operDesc = "查询") @OperationLogAnnotation(operModul = "采购入库单", operType = "查询", operDesc = "查询")
@Override @Override
public EiInfo query(EiInfo inInfo) { public EiInfo query(EiInfo inInfo) {
try { try {
...@@ -92,17 +91,33 @@ public class ServiceHPKC001 extends ServiceBase { ...@@ -92,17 +91,33 @@ public class ServiceHPKC001 extends ServiceBase {
* @param inInfo * @param inInfo
* @return * @return
*/ */
@OperationLogAnnotation(operModul = "采购入库单",operType = "插入",operDesc = "插入")
@Override @Override
@OperationLogAnnotation(operModul = "采购入库单", operType = "插入", operDesc = "插入")
public EiInfo insert(EiInfo inInfo) { public EiInfo insert(EiInfo inInfo) {
try { try {
List<Map> resultRows = inInfo.getBlock(EiConstant.resultBlock).getRows(); List<Map> resultRows = inInfo.getBlock(EiConstant.resultBlock).getRows();
// 数据校验 // 数据校验
this.checkSaveData(resultRows); this.checkSaveData(resultRows);
// 数据写入 // 数据写入
for (int i = 0; i < resultRows.size(); i++) { this.insertData(resultRows);
inInfo = this.query(inInfo);
inInfo.setStatus(EiConstant.STATUS_DEFAULT);
inInfo.setMsg("操作成功!本次对[" + resultRows.size() + "]条数据新增成功!");
} catch (Exception e) {
LogUtils.setDetailMsg(inInfo, e, "新增失败");
}
return inInfo;
}
/**
* 写入数据
*
* @param resultRows
*/
private void insertData(List<Map> resultRows) {
for (Map resultRow : resultRows) {
HPKC001 fKc001 = new HPKC001(); HPKC001 fKc001 = new HPKC001();
fKc001.fromMap(resultRows.get(i)); fKc001.fromMap(resultRow);
// 设置基础信息 // 设置基础信息
this.setBaseInfo(fKc001); this.setBaseInfo(fKc001);
// 生成入库单号 // 生成入库单号
...@@ -110,15 +125,8 @@ public class ServiceHPKC001 extends ServiceBase { ...@@ -110,15 +125,8 @@ public class ServiceHPKC001 extends ServiceBase {
DaoUtils.insert(HPKC001.INSERT, fKc001); DaoUtils.insert(HPKC001.INSERT, fKc001);
// 修改库存 // 修改库存
HPKCTools.updateStock(fKc001.getWhCode(), fKc001.getInventRecordId(), fKc001.getAmount(), HPKCTools.updateStock(fKc001.getWhCode(), fKc001.getInventRecordId(), fKc001.getAmount(),
fKc001.getWeight()); fKc001.getUnitWeight(), fKc001.getWeight());
} }
inInfo = this.query(inInfo);
inInfo.setStatus(EiConstant.STATUS_DEFAULT);
inInfo.setMsg("操作成功!本次对[" + resultRows.size() + "]条数据新增成功!");
} catch (Exception e) {
LogUtils.setDetailMsg(inInfo, e, "新增失败");
}
return inInfo;
} }
/** /**
...@@ -127,7 +135,7 @@ public class ServiceHPKC001 extends ServiceBase { ...@@ -127,7 +135,7 @@ public class ServiceHPKC001 extends ServiceBase {
* @param inInfo * @param inInfo
* @return * @return
*/ */
@OperationLogAnnotation(operModul = "采购入库单",operType = "修改",operDesc = "修改") @OperationLogAnnotation(operModul = "采购入库单", operType = "修改", operDesc = "修改")
public EiInfo update(EiInfo inInfo) { public EiInfo update(EiInfo inInfo) {
try { try {
List<Map> resultRows = inInfo.getBlock(EiConstant.resultBlock).getRows(); List<Map> resultRows = inInfo.getBlock(EiConstant.resultBlock).getRows();
...@@ -139,19 +147,8 @@ public class ServiceHPKC001 extends ServiceBase { ...@@ -139,19 +147,8 @@ public class ServiceHPKC001 extends ServiceBase {
HPKCTools.HpKc001.lock(otherEnterNos); HPKCTools.HpKc001.lock(otherEnterNos);
// 查询数据库记录 // 查询数据库记录
Map<String, HPKC001> mapKc001 = HPKCTools.HpKc001.map(otherEnterNos); Map<String, HPKC001> mapKc001 = HPKCTools.HpKc001.map(otherEnterNos);
for (int i = 0; i < resultRows.size(); i++) { // 保存数据
HPKC001 fKc001 = new HPKC001(); this.saveData(resultRows, mapKc001);
fKc001.fromMap(resultRows.get(i));
// 设置基础信息
this.setBaseInfo(fKc001);
DaoUtils.update(HPKC001.UPDATE, fKc001);
// 计算差异数量与重量
HPKC001 dbKc001 = mapKc001.get(fKc001.getPurchaseNo());
BigDecimal diffAmount = fKc001.getAmount().subtract(dbKc001.getAmount());
BigDecimal diffWeight = fKc001.getWeight().subtract(dbKc001.getWeight());
// 修改库存
HPKCTools.updateStock(fKc001.getWhCode(), fKc001.getInventRecordId(), diffAmount, diffWeight);
}
inInfo = this.query(inInfo); inInfo = this.query(inInfo);
inInfo.setStatus(EiConstant.STATUS_SUCCESS); inInfo.setStatus(EiConstant.STATUS_SUCCESS);
inInfo.setMsg("操作成功!本次对[" + resultRows.size() + "]条数据修改成功!"); inInfo.setMsg("操作成功!本次对[" + resultRows.size() + "]条数据修改成功!");
...@@ -166,7 +163,6 @@ public class ServiceHPKC001 extends ServiceBase { ...@@ -166,7 +163,6 @@ public class ServiceHPKC001 extends ServiceBase {
* *
* @param resultRows * @param resultRows
*/ */
@OperationLogAnnotation(operModul = "采购入库单",operType = "校验",operDesc = "校验保存的数据")
private void checkSaveData(List<Map> resultRows) { private void checkSaveData(List<Map> resultRows) {
for (int i = 0; i < resultRows.size(); i++) { for (int i = 0; i < resultRows.size(); i++) {
HPKC001 fKc001 = new HPKC001(); HPKC001 fKc001 = new HPKC001();
...@@ -180,11 +176,33 @@ public class ServiceHPKC001 extends ServiceBase { ...@@ -180,11 +176,33 @@ public class ServiceHPKC001 extends ServiceBase {
} }
/** /**
* 保存数据
*
* @param resultRows
* @param mapKc001
*/
private void saveData(List<Map> resultRows, Map<String, HPKC001> mapKc001) {
for (Map resultRow : resultRows) {
HPKC001 fKc001 = new HPKC001();
fKc001.fromMap(resultRow);
// 设置基础信息
this.setBaseInfo(fKc001);
DaoUtils.update(HPKC001.UPDATE, fKc001);
// 计算差异数量与重量
HPKC001 dbKc001 = mapKc001.get(fKc001.getPurchaseNo());
BigDecimal diffAmount = fKc001.getAmount().subtract(dbKc001.getAmount());
BigDecimal diffWeight = fKc001.getWeight().subtract(dbKc001.getWeight());
// 修改库存
HPKCTools.updateStock(fKc001.getWhCode(), fKc001.getInventRecordId(), diffAmount, fKc001.getUnitWeight(),
diffWeight);
}
}
/**
* 设置基础信息 * 设置基础信息
* *
* @param fKc001 * @param fKc001
*/ */
@OperationLogAnnotation(operModul = "采购入库单",operType = "设置",operDesc = "设置基础信息")
private void setBaseInfo(HPKC001 fKc001) { private void setBaseInfo(HPKC001 fKc001) {
// 去除日期字符串中的- // 去除日期字符串中的-
fKc001.setReceiptDate(StringUtil.removeHorizontalLine(fKc001.getReceiptDate())); fKc001.setReceiptDate(StringUtil.removeHorizontalLine(fKc001.getReceiptDate()));
...@@ -192,6 +210,10 @@ public class ServiceHPKC001 extends ServiceBase { ...@@ -192,6 +210,10 @@ public class ServiceHPKC001 extends ServiceBase {
fKc001.setWhName(HPPZTools.HpPz007.getByCode(fKc001.getWhCode()).getWhName()); fKc001.setWhName(HPPZTools.HpPz007.getByCode(fKc001.getWhCode()).getWhName());
// 存货名称 // 存货名称
fKc001.setInventName(HPPZTools.HpPz004.getByCode(fKc001.getInventCode()).getInventName()); fKc001.setInventName(HPPZTools.HpPz004.getByCode(fKc001.getInventCode()).getInventName());
// 根据规格计算单重
fKc001.setUnitWeight(HPPZTools.HpPz006.calcUnitWeight(fKc001.getInventRecordId()));
// 计算总重
fKc001.setWeight(fKc001.getAmount().multiply(fKc001.getUnitWeight()));
} }
/** /**
...@@ -200,7 +222,7 @@ public class ServiceHPKC001 extends ServiceBase { ...@@ -200,7 +222,7 @@ public class ServiceHPKC001 extends ServiceBase {
* @param inInfo * @param inInfo
* @return * @return
*/ */
@OperationLogAnnotation(operModul = "采购入库单",operType = "删除",operDesc = "删除") @OperationLogAnnotation(operModul = "采购入库单", operType = "删除", operDesc = "删除")
public EiInfo delete(EiInfo inInfo) { public EiInfo delete(EiInfo inInfo) {
try { try {
List<Map> resultRows = inInfo.getBlock(EiConstant.resultBlock).getRows(); List<Map> resultRows = inInfo.getBlock(EiConstant.resultBlock).getRows();
...@@ -210,9 +232,27 @@ public class ServiceHPKC001 extends ServiceBase { ...@@ -210,9 +232,27 @@ public class ServiceHPKC001 extends ServiceBase {
HPKCTools.HpKc001.lock(otherEnterNos); HPKCTools.HpKc001.lock(otherEnterNos);
// 查询数据库记录 // 查询数据库记录
Map<String, HPKC001> mapKc001 = HPKCTools.HpKc001.map(otherEnterNos); Map<String, HPKC001> mapKc001 = HPKCTools.HpKc001.map(otherEnterNos);
for (int i = 0; i < resultRows.size(); i++) { // 删除数据
this.deleteData(resultRows, mapKc001);
inInfo = this.query(inInfo);
inInfo.setStatus(EiConstant.STATUS_DEFAULT);
inInfo.setMsg("操作成功!本次对[" + resultRows.size() + "]条数据删除成功!");
} catch (Exception e) {
LogUtils.setDetailMsg(inInfo, e, "删除失败");
}
return inInfo;
}
/**
* 删除数据
*
* @param resultRows
* @param mapKc001
*/
private void deleteData(List<Map> resultRows, Map<String, HPKC001> mapKc001) {
for (Map resultRow : resultRows) {
HPKC001 fKc001 = new HPKC001(); HPKC001 fKc001 = new HPKC001();
fKc001.fromMap(resultRows.get(i)); fKc001.fromMap(resultRow);
DaoUtils.update(HPKC001.DELETE, fKc001); DaoUtils.update(HPKC001.DELETE, fKc001);
// 生成红冲记录 // 生成红冲记录
HPKC001 dbKc001 = mapKc001.get(fKc001.getPurchaseNo()); HPKC001 dbKc001 = mapKc001.get(fKc001.getPurchaseNo());
...@@ -225,15 +265,8 @@ public class ServiceHPKC001 extends ServiceBase { ...@@ -225,15 +265,8 @@ public class ServiceHPKC001 extends ServiceBase {
DaoUtils.insert(HPKC001.INSERT, newKc006); DaoUtils.insert(HPKC001.INSERT, newKc006);
// 修改库存 // 修改库存
HPKCTools.updateStock(dbKc001.getWhCode(), dbKc001.getInventRecordId(), dbKc001.getAmount().negate(), HPKCTools.updateStock(dbKc001.getWhCode(), dbKc001.getInventRecordId(), dbKc001.getAmount().negate(),
dbKc001.getWeight().negate()); dbKc001.getUnitWeight(), dbKc001.getWeight().negate());
} }
inInfo = this.query(inInfo);
inInfo.setStatus(EiConstant.STATUS_DEFAULT);
inInfo.setMsg("操作成功!本次对[" + resultRows.size() + "]条数据删除成功!");
} catch (Exception e) {
LogUtils.setDetailMsg(inInfo, e, "删除失败");
}
return inInfo;
} }
} }
...@@ -63,8 +63,8 @@ public class ServiceHPKC002 extends ServiceBase { ...@@ -63,8 +63,8 @@ public class ServiceHPKC002 extends ServiceBase {
* @param inInfo * @param inInfo
* @return * @return
*/ */
@OperationLogAnnotation(operModul = "生产领料单",operType = "查询",operDesc = "查询")
@Override @Override
@OperationLogAnnotation(operModul = "生产领料单",operType = "查询",operDesc = "查询")
public EiInfo query(EiInfo inInfo) { public EiInfo query(EiInfo inInfo) {
try { try {
Map queryRow = EiInfoUtils.getFirstRow(inInfo); Map queryRow = EiInfoUtils.getFirstRow(inInfo);
...@@ -79,7 +79,6 @@ public class ServiceHPKC002 extends ServiceBase { ...@@ -79,7 +79,6 @@ public class ServiceHPKC002 extends ServiceBase {
return inInfo; return inInfo;
} }
/** /**
* 删除操作 * 删除操作
* *
...@@ -111,7 +110,7 @@ public class ServiceHPKC002 extends ServiceBase { ...@@ -111,7 +110,7 @@ public class ServiceHPKC002 extends ServiceBase {
DaoUtils.insert(HPKC002.INSERT, newKc002); DaoUtils.insert(HPKC002.INSERT, newKc002);
// 修改库存 // 修改库存
HPKCTools.updateStock(dbKc002.getWhCode(), dbKc002.getInventRecordId(), HPKCTools.updateStock(dbKc002.getWhCode(), dbKc002.getInventRecordId(),
dbKc002.getAmount().negate(), dbKc002.getWeight().negate()); dbKc002.getAmount().negate(), dbKc002.getUnitWeight(), dbKc002.getWeight().negate());
} }
inInfo = this.query(inInfo); inInfo = this.query(inInfo);
inInfo.setStatus(EiConstant.STATUS_DEFAULT); inInfo.setStatus(EiConstant.STATUS_DEFAULT);
......
...@@ -46,8 +46,8 @@ public class ServiceHPKC002A extends ServiceEPBase { ...@@ -46,8 +46,8 @@ public class ServiceHPKC002A extends ServiceEPBase {
* @param inInfo * @param inInfo
* @return * @return
*/ */
@OperationLogAnnotation(operModul = "库存查询",operType = "查询",operDesc = "生产领料单-库存查询-初始化")
@Override @Override
@OperationLogAnnotation(operModul = "库存查询", operType = "查询", operDesc = "生产领料单-库存查询-初始化")
public EiInfo initLoad(EiInfo inInfo) { public EiInfo initLoad(EiInfo inInfo) {
try { try {
Map queryMap = new HashMap(); Map queryMap = new HashMap();
...@@ -69,8 +69,8 @@ public class ServiceHPKC002A extends ServiceEPBase { ...@@ -69,8 +69,8 @@ public class ServiceHPKC002A extends ServiceEPBase {
* @param inInfo * @param inInfo
* @return * @return
*/ */
@OperationLogAnnotation(operModul = "库存查询",operType = "查询",operDesc = "生产领料单-库存查询-查询")
@Override @Override
@OperationLogAnnotation(operModul = "库存查询", operType = "查询", operDesc = "生产领料单-库存查询-查询")
public EiInfo query(EiInfo inInfo) { public EiInfo query(EiInfo inInfo) {
try { try {
Map queryRow = EiInfoUtils.getFirstRow(inInfo); Map queryRow = EiInfoUtils.getFirstRow(inInfo);
...@@ -99,6 +99,22 @@ public class ServiceHPKC002A extends ServiceEPBase { ...@@ -99,6 +99,22 @@ public class ServiceHPKC002A extends ServiceEPBase {
// 获取库存信息 // 获取库存信息
Map<Long, HPKC010> dbKc010Map = HPKCTools.HpKc010.map(ids); Map<Long, HPKC010> dbKc010Map = HPKCTools.HpKc010.map(ids);
// 状态校验 // 状态校验
this.checkData(resultRows, dbKc010Map);
// 生成销售库单
this.saveData(resultRows, dbKc010Map);
} catch (Exception e) {
LogUtils.setMsg(inInfo, e, "生成领料单失败");
}
return inInfo;
}
/**
* 数据校验
*
* @param resultRows
* @param dbKc010Map
*/
private void checkData(List<Map> resultRows, Map<Long, HPKC010> dbKc010Map) {
for (Map row : resultRows) { for (Map row : resultRows) {
Long id = MapUtils.getLong(row, "id"); Long id = MapUtils.getLong(row, "id");
HPKC010 dbKc010 = dbKc010Map.get(id); HPKC010 dbKc010 = dbKc010Map.get(id);
...@@ -107,14 +123,18 @@ public class ServiceHPKC002A extends ServiceEPBase { ...@@ -107,14 +123,18 @@ public class ServiceHPKC002A extends ServiceEPBase {
BigDecimal applyAmount = MapUtils.getBigDecimal(row, "applyAmount"); BigDecimal applyAmount = MapUtils.getBigDecimal(row, "applyAmount");
AssertUtils.isGt(applyAmount, dbKc010.getAmount(), AssertUtils.isGt(applyAmount, dbKc010.getAmount(),
"库存号[" + id + "]可用数量不足!"); "库存号[" + id + "]可用数量不足!");
BigDecimal applyWeight = MapUtils.getBigDecimal(row, "applyWeight");
AssertUtils.isGt(applyWeight, dbKc010.getWeight(),
"库存号[" + id + "]可用重量不足!");
} }
// 生成销售库单 }
/**
* 保存数据
*
* @param resultRows
* @param dbKc010Map
*/
private void saveData(List<Map> resultRows, Map<Long, HPKC010> dbKc010Map) {
for (Map row : resultRows) { for (Map row : resultRows) {
BigDecimal applyAmount = MapUtils.getBigDecimal(row, "applyAmount"); BigDecimal applyAmount = MapUtils.getBigDecimal(row, "applyAmount");
BigDecimal applyWeight = MapUtils.getBigDecimal(row, "applyWeight");
String applyRemark = MapUtils.getString(row, "applyRemark"); String applyRemark = MapUtils.getString(row, "applyRemark");
Long kcId = MapUtils.getLong(row, "id"); Long kcId = MapUtils.getLong(row, "id");
HPKC010 dbKc010 = dbKc010Map.get(kcId); HPKC010 dbKc010 = dbKc010Map.get(kcId);
...@@ -122,19 +142,14 @@ public class ServiceHPKC002A extends ServiceEPBase { ...@@ -122,19 +142,14 @@ public class ServiceHPKC002A extends ServiceEPBase {
newKc002.setReqNo(SequenceGenerator.getNextSequence(HPConstant.SequenceId.HPKC002_NUMBER)); newKc002.setReqNo(SequenceGenerator.getNextSequence(HPConstant.SequenceId.HPKC002_NUMBER));
newKc002.setReceiptDate(DateUtils.shortDate()); newKc002.setReceiptDate(DateUtils.shortDate());
newKc002.setAmount(applyAmount); newKc002.setAmount(applyAmount);
newKc002.setWeight(applyWeight); newKc002.setWeight(dbKc010.getUnitWeight().multiply(applyAmount));
newKc002.setRemark(applyRemark); newKc002.setRemark(applyRemark);
newKc002.setKcId(kcId); newKc002.setKcId(kcId);
newKc002.setDeleteFlag(CommonConstant.YesNo.NO_0); newKc002.setDeleteFlag(CommonConstant.YesNo.NO_0);
DaoUtils.insert(HPKC002.INSERT, newKc002); DaoUtils.insert(HPKC002.INSERT, newKc002);
// 修改库存数量 // 修改库存数量
HPKCTools.updateStock(newKc002.getWhCode(), newKc002.getInventRecordId(), HPKCTools.updateStock(newKc002.getWhCode(), newKc002.getInventRecordId(),
newKc002.getAmount().negate(), newKc002.getWeight().negate()); newKc002.getAmount().negate(), dbKc010.getUnitWeight(), newKc002.getWeight().negate());
} }
} catch (Exception e) {
LogUtils.setDetailMsg(inInfo, e, "生成领料单失败");
}
return inInfo;
} }
} }
...@@ -23,6 +23,7 @@ import com.baosight.iplat4j.core.service.impl.ServiceBase; ...@@ -23,6 +23,7 @@ import com.baosight.iplat4j.core.service.impl.ServiceBase;
import com.baosight.iplat4j.ed.util.SequenceGenerator; import com.baosight.iplat4j.ed.util.SequenceGenerator;
import org.apache.commons.collections.MapUtils; import org.apache.commons.collections.MapUtils;
import java.math.BigDecimal;
import java.util.Arrays; import java.util.Arrays;
import java.util.List; import java.util.List;
import java.util.Map; import java.util.Map;
...@@ -41,10 +42,11 @@ public class ServiceHPKC005 extends ServiceBase { ...@@ -41,10 +42,11 @@ public class ServiceHPKC005 extends ServiceBase {
* @param inInfo * @param inInfo
* @return * @return
*/ */
@OperationLogAnnotation(operModul = "库存盘点单",operType = "查询",operDesc = "初始化") @Override
@OperationLogAnnotation(operModul = "库存盘点单", operType = "查询", operDesc = "初始化")
public EiInfo initLoad(EiInfo inInfo) { public EiInfo initLoad(EiInfo inInfo) {
try { try {
CommonMethod.initBlock(inInfo, Arrays.asList(DdynamicEnum.WH_RECORD_BLOCK_ID), null); CommonMethod.initBlock(inInfo, Arrays.asList(DdynamicEnum.WH_RECORD_BLOCK_ID), null, false);
CommonMethod.initBlock(inInfo, Arrays.asList(DdynamicEnum.INVENT_NAME_BLOCK_ID), null); CommonMethod.initBlock(inInfo, Arrays.asList(DdynamicEnum.INVENT_NAME_BLOCK_ID), null);
CommonMethod.initBlock(inInfo, Arrays.asList(DdynamicEnum.INVENT_SPEC_BLOCK_ID), null); CommonMethod.initBlock(inInfo, Arrays.asList(DdynamicEnum.INVENT_SPEC_BLOCK_ID), null);
CommonMethod.initBlock(inInfo, Arrays.asList(DdynamicEnum.SPEC_NAME_BLOCK_ID), null, false); CommonMethod.initBlock(inInfo, Arrays.asList(DdynamicEnum.SPEC_NAME_BLOCK_ID), null, false);
...@@ -61,8 +63,8 @@ public class ServiceHPKC005 extends ServiceBase { ...@@ -61,8 +63,8 @@ public class ServiceHPKC005 extends ServiceBase {
* @param inInfo * @param inInfo
* @return * @return
*/ */
@OperationLogAnnotation(operModul = "库存盘点单",operType = "查询",operDesc = "查询")
@Override @Override
@OperationLogAnnotation(operModul = "库存盘点单", operType = "查询", operDesc = "查询")
public EiInfo query(EiInfo inInfo) { public EiInfo query(EiInfo inInfo) {
try { try {
Map queryRow = EiInfoUtils.getFirstRow(inInfo); Map queryRow = EiInfoUtils.getFirstRow(inInfo);
...@@ -84,11 +86,10 @@ public class ServiceHPKC005 extends ServiceBase { ...@@ -84,11 +86,10 @@ public class ServiceHPKC005 extends ServiceBase {
* @param inInfo * @param inInfo
* @return * @return
*/ */
@OperationLogAnnotation(operModul = "库存盘点单",operType = "新增",operDesc = "新增")
@Override @Override
@OperationLogAnnotation(operModul = "库存盘点单", operType = "新增", operDesc = "新增")
public EiInfo insert(EiInfo inInfo) { public EiInfo insert(EiInfo inInfo) {
try { try {
CommonMethod.creatorInfo(inInfo, EiConstant.resultBlock);
List<Map> resultRows = inInfo.getBlock(EiConstant.resultBlock).getRows(); List<Map> resultRows = inInfo.getBlock(EiConstant.resultBlock).getRows();
for (int i = 0; i < resultRows.size(); i++) { for (int i = 0; i < resultRows.size(); i++) {
HPKC005 fKc005 = new HPKC005(); HPKC005 fKc005 = new HPKC005();
...@@ -112,32 +113,6 @@ public class ServiceHPKC005 extends ServiceBase { ...@@ -112,32 +113,6 @@ public class ServiceHPKC005 extends ServiceBase {
} }
/** /**
* 修改操作
*
* @param inInfo
* @return
*/
@OperationLogAnnotation(operModul = "库存盘点单",operType = "修改",operDesc = "修改")
public EiInfo update(EiInfo inInfo) {
try {
List<Map> resultRows = inInfo.getBlock(EiConstant.resultBlock).getRows();
for (int i = 0; i < resultRows.size(); i++) {
HPKC005 fKc005 = new HPKC005();
fKc005.fromMap(resultRows.get(i));
// 设置基础信息
this.setBaseInfo(fKc005);
DaoUtils.update(HPKC005.UPDATE, fKc005);
}
inInfo = this.query(inInfo);
inInfo.setStatus(EiConstant.STATUS_SUCCESS);
inInfo.setMsg("修改成功!");
} catch (PlatException e) {
LogUtils.setDetailMsg(inInfo, e, "修改失败");
}
return inInfo;
}
/**
* 设置基础信息 * 设置基础信息
* *
* @param fKc005 * @param fKc005
...@@ -150,6 +125,13 @@ public class ServiceHPKC005 extends ServiceBase { ...@@ -150,6 +125,13 @@ public class ServiceHPKC005 extends ServiceBase {
fKc005.setWhName(HPPZTools.HpPz007.getByCode(fKc005.getWhCode()).getWhName()); fKc005.setWhName(HPPZTools.HpPz007.getByCode(fKc005.getWhCode()).getWhName());
// 存货名称 // 存货名称
fKc005.setInventName(HPPZTools.HpPz004.getByCode(fKc005.getInventCode()).getInventName()); fKc005.setInventName(HPPZTools.HpPz004.getByCode(fKc005.getInventCode()).getInventName());
// 根据规格计算账面单重
BigDecimal unitWeight = HPPZTools.HpPz006.calcUnitWeight(fKc005.getInventRecordId());
fKc005.setBookUnitWeight(unitWeight);
fKc005.setEntityUnitWeight(unitWeight);
// 计算总重
fKc005.setBookWeight(fKc005.getBookAmount().multiply(unitWeight));
fKc005.setEntityWeight(fKc005.getEntityAmount().multiply(unitWeight));
// 差异数量 // 差异数量
fKc005.setDiffAmount(fKc005.getEntityAmount().subtract(fKc005.getBookAmount())); fKc005.setDiffAmount(fKc005.getEntityAmount().subtract(fKc005.getBookAmount()));
// 差异重量 // 差异重量
...@@ -172,6 +154,24 @@ public class ServiceHPKC005 extends ServiceBase { ...@@ -172,6 +154,24 @@ public class ServiceHPKC005 extends ServiceBase {
HPKCTools.HpKc005.lock(checkNos); HPKCTools.HpKc005.lock(checkNos);
// 查询数据库记录 // 查询数据库记录
Map<String, HPKC005> mapKc005 = HPKCTools.HpKc005.map(checkNos); Map<String, HPKC005> mapKc005 = HPKCTools.HpKc005.map(checkNos);
// 删除数据
this.deleteData(resultRows, mapKc005);
inInfo = this.query(inInfo);
inInfo.setStatus(EiConstant.STATUS_DEFAULT);
inInfo.setMsg("操作成功!本次对[" + resultRows.size() + "]条数据删除成功!");
} catch (Exception e) {
LogUtils.setDetailMsg(inInfo, e, "删除失败");
}
return inInfo;
}
/**
* 删除数据
*
* @param resultRows
* @param mapKc005
*/
private void deleteData(List<Map> resultRows, Map<String, HPKC005> mapKc005) {
for (int i = 0; i < resultRows.size(); i++) { for (int i = 0; i < resultRows.size(); i++) {
HPKC005 fKc005 = new HPKC005(); HPKC005 fKc005 = new HPKC005();
fKc005.fromMap(resultRows.get(i)); fKc005.fromMap(resultRows.get(i));
...@@ -190,13 +190,6 @@ public class ServiceHPKC005 extends ServiceBase { ...@@ -190,13 +190,6 @@ public class ServiceHPKC005 extends ServiceBase {
HPKCTools.updateStock(newKc005.getWhCode(), newKc005.getInventRecordId(), HPKCTools.updateStock(newKc005.getWhCode(), newKc005.getInventRecordId(),
newKc005.getDiffAmount(), newKc005.getDiffWeight()); newKc005.getDiffAmount(), newKc005.getDiffWeight());
} }
inInfo = this.query(inInfo);
inInfo.setStatus(EiConstant.STATUS_DEFAULT);
inInfo.setMsg("操作成功!本次对[" + resultRows.size() + "]条数据删除成功!");
} catch (Exception e) {
LogUtils.setDetailMsg(inInfo, e, "删除失败");
}
return inInfo;
} }
} }
...@@ -2,6 +2,7 @@ package com.baosight.hpjx.hp.kc.service; ...@@ -2,6 +2,7 @@ package com.baosight.hpjx.hp.kc.service;
import com.baosight.hpjx.aspect.annotation.OperationLogAnnotation; import com.baosight.hpjx.aspect.annotation.OperationLogAnnotation;
import com.baosight.hpjx.common.DdynamicEnum; import com.baosight.hpjx.common.DdynamicEnum;
import com.baosight.hpjx.core.constant.CommonConstant;
import com.baosight.hpjx.core.dao.DaoUtils; import com.baosight.hpjx.core.dao.DaoUtils;
import com.baosight.hpjx.hp.constant.HPConstant; import com.baosight.hpjx.hp.constant.HPConstant;
import com.baosight.hpjx.hp.kc.domain.HPKC005; import com.baosight.hpjx.hp.kc.domain.HPKC005;
...@@ -39,8 +40,8 @@ public class ServiceHPKC005A extends ServiceEPBase { ...@@ -39,8 +40,8 @@ public class ServiceHPKC005A extends ServiceEPBase {
* @param inInfo * @param inInfo
* @return * @return
*/ */
@OperationLogAnnotation(operModul = "库存查询",operType = "查询",operDesc = "初始化")
@Override @Override
@OperationLogAnnotation(operModul = "库存查询", operType = "查询", operDesc = "初始化")
public EiInfo initLoad(EiInfo inInfo) { public EiInfo initLoad(EiInfo inInfo) {
try { try {
CommonMethod.initBlock(inInfo, Arrays.asList(DdynamicEnum.WH_RECORD_BLOCK_ID), null); CommonMethod.initBlock(inInfo, Arrays.asList(DdynamicEnum.WH_RECORD_BLOCK_ID), null);
...@@ -60,8 +61,8 @@ public class ServiceHPKC005A extends ServiceEPBase { ...@@ -60,8 +61,8 @@ public class ServiceHPKC005A extends ServiceEPBase {
* @param inInfo * @param inInfo
* @return * @return
*/ */
@OperationLogAnnotation(operModul = "库存查询",operType = "查询",operDesc = "库存盘点单-库存查询-查询")
@Override @Override
@OperationLogAnnotation(operModul = "库存查询", operType = "查询", operDesc = "库存盘点单-库存查询-查询")
public EiInfo query(EiInfo inInfo) { public EiInfo query(EiInfo inInfo) {
try { try {
Map queryRow = EiInfoUtils.getFirstRow(inInfo); Map queryRow = EiInfoUtils.getFirstRow(inInfo);
...@@ -89,6 +90,22 @@ public class ServiceHPKC005A extends ServiceEPBase { ...@@ -89,6 +90,22 @@ public class ServiceHPKC005A extends ServiceEPBase {
// 获取库存信息 // 获取库存信息
Map<Long, HPKC010> dbKc010Map = HPKCTools.HpKc010.map(ids); Map<Long, HPKC010> dbKc010Map = HPKCTools.HpKc010.map(ids);
// 状态校验 // 状态校验
this.checkData(resultRows, dbKc010Map);
// 生成盘点单
this.saveData(resultRows, dbKc010Map);
} catch (Exception e) {
LogUtils.setDetailMsg(inInfo, e, "生成盘点单失败");
}
return inInfo;
}
/**
* 校验数据
*
* @param resultRows
* @param dbKc010Map
*/
private void checkData(List<Map> resultRows, Map<Long, HPKC010> dbKc010Map) {
for (Map row : resultRows) { for (Map row : resultRows) {
Long id = MapUtils.getLong(row, "id"); Long id = MapUtils.getLong(row, "id");
HPKC010 dbKc010 = dbKc010Map.get(id); HPKC010 dbKc010 = dbKc010Map.get(id);
...@@ -96,13 +113,18 @@ public class ServiceHPKC005A extends ServiceEPBase { ...@@ -96,13 +113,18 @@ public class ServiceHPKC005A extends ServiceEPBase {
// 校验数量 // 校验数量
BigDecimal entityAmount = MapUtils.getBigDecimal(row, "entityAmount"); BigDecimal entityAmount = MapUtils.getBigDecimal(row, "entityAmount");
AssertUtils.isGt(BigDecimal.ZERO, entityAmount, "库存号[" + id + "]实物数量不能小于0!"); AssertUtils.isGt(BigDecimal.ZERO, entityAmount, "库存号[" + id + "]实物数量不能小于0!");
BigDecimal entityWeight = MapUtils.getBigDecimal(row, "entityWeight");
AssertUtils.isGt(BigDecimal.ZERO, entityWeight, "库存号[" + id + "]实物重量不能小于0!");
} }
// 生成盘点单 }
/**
* 保存数据
*
* @param resultRows
* @param dbKc010Map
*/
private void saveData(List<Map> resultRows, Map<Long, HPKC010> dbKc010Map) {
for (Map row : resultRows) { for (Map row : resultRows) {
BigDecimal entityAmount = MapUtils.getBigDecimal(row, "entityAmount"); BigDecimal entityAmount = MapUtils.getBigDecimal(row, "entityAmount");
BigDecimal entityWeight = MapUtils.getBigDecimal(row, "entityWeight");
String entityRemark = MapUtils.getString(row, "entityRemark"); String entityRemark = MapUtils.getString(row, "entityRemark");
Long kcId = MapUtils.getLong(row, "id"); Long kcId = MapUtils.getLong(row, "id");
HPKC010 dbKc010 = dbKc010Map.get(kcId); HPKC010 dbKc010 = dbKc010Map.get(kcId);
...@@ -111,22 +133,18 @@ public class ServiceHPKC005A extends ServiceEPBase { ...@@ -111,22 +133,18 @@ public class ServiceHPKC005A extends ServiceEPBase {
newKc005.setCheckNo(SequenceGenerator.getNextSequence(HPConstant.SequenceId.CHECK_NO)); newKc005.setCheckNo(SequenceGenerator.getNextSequence(HPConstant.SequenceId.CHECK_NO));
newKc005.setReceiptDate(DateUtils.shortDate()); newKc005.setReceiptDate(DateUtils.shortDate());
newKc005.setEntityAmount(entityAmount); newKc005.setEntityAmount(entityAmount);
newKc005.setEntityWeight(entityWeight); newKc005.setEntityWeight(dbKc010.getUnitWeight().multiply(entityAmount));
newKc005.setBookAmount(dbKc010.getAmount()); newKc005.setBookAmount(dbKc010.getAmount());
newKc005.setBookWeight(dbKc010.getWeight()); newKc005.setBookWeight(dbKc010.getWeight());
newKc005.setDiffAmount(entityAmount.subtract(dbKc010.getAmount())); newKc005.setDiffAmount(entityAmount.subtract(dbKc010.getAmount()));
newKc005.setDiffWeight(entityWeight.subtract(dbKc010.getWeight())); newKc005.setDiffWeight(newKc005.getEntityWeight().subtract(dbKc010.getWeight()));
newKc005.setKcId(kcId); newKc005.setKcId(kcId);
newKc005.setRemark(entityRemark); newKc005.setRemark(entityRemark);
newKc005.setDeleteFlag(CommonConstant.YesNo.NO_0);
DaoUtils.insert(HPKC005.INSERT, newKc005); DaoUtils.insert(HPKC005.INSERT, newKc005);
// 修改库存数量 // 修改库存数量
HPKCTools.updateStock(newKc005.getWhCode(), newKc005.getInventRecordId(), HPKCTools.updateStock(newKc005.getWhCode(), newKc005.getInventRecordId(),
newKc005.getDiffAmount(), newKc005.getDiffWeight()); newKc005.getDiffAmount(), newKc005.getDiffWeight());
} }
} catch (Exception e) {
LogUtils.setDetailMsg(inInfo, e, "生成盘点单失败");
} }
return inInfo;
}
} }
...@@ -72,8 +72,8 @@ public class ServiceHPKC006 extends ServiceBase { ...@@ -72,8 +72,8 @@ public class ServiceHPKC006 extends ServiceBase {
* @param inInfo * @param inInfo
* @return * @return
*/ */
@OperationLogAnnotation(operModul = "其他入库单",operType = "查询",operDesc = "查询")
@Override @Override
@OperationLogAnnotation(operModul = "其他入库单", operType = "查询", operDesc = "查询")
public EiInfo query(EiInfo inInfo) { public EiInfo query(EiInfo inInfo) {
try { try {
Map queryRow = EiInfoUtils.getFirstRow(inInfo); Map queryRow = EiInfoUtils.getFirstRow(inInfo);
...@@ -96,8 +96,8 @@ public class ServiceHPKC006 extends ServiceBase { ...@@ -96,8 +96,8 @@ public class ServiceHPKC006 extends ServiceBase {
* @param inInfo * @param inInfo
* @return * @return
*/ */
@OperationLogAnnotation(operModul = "其他入库单",operType = "新增",operDesc = "新增")
@Override @Override
@OperationLogAnnotation(operModul = "其他入库单", operType = "新增", operDesc = "新增")
public EiInfo insert(EiInfo inInfo) { public EiInfo insert(EiInfo inInfo) {
try { try {
List<Map> resultRows = inInfo.getBlock(EiConstant.resultBlock).getRows(); List<Map> resultRows = inInfo.getBlock(EiConstant.resultBlock).getRows();
...@@ -111,7 +111,7 @@ public class ServiceHPKC006 extends ServiceBase { ...@@ -111,7 +111,7 @@ public class ServiceHPKC006 extends ServiceBase {
this.setBaseInfo(fKc006); this.setBaseInfo(fKc006);
// 生成入库单号 // 生成入库单号
fKc006.setOtherEnterNo(SequenceGenerator.getNextSequence(HPConstant.SequenceId.OTHER_ENTER_NO)); fKc006.setOtherEnterNo(SequenceGenerator.getNextSequence(HPConstant.SequenceId.OTHER_ENTER_NO));
HPPZ006 hppz006= HPPZTools.checkAndSavePZ06( HPPZ006 hppz006 = HPPZTools.checkAndSavePZ06(
Integer.parseInt(resultRows.get(i).get("inventType").toString()), Integer.parseInt(resultRows.get(i).get("inventType").toString()),
resultRows.get(i).get("inventName").toString(), resultRows.get(i).get("inventName").toString(),
NumberUtils.toBigDecimal(resultRows.get(i).get("length")), NumberUtils.toBigDecimal(resultRows.get(i).get("length")),
...@@ -121,6 +121,10 @@ public class ServiceHPKC006 extends ServiceBase { ...@@ -121,6 +121,10 @@ public class ServiceHPKC006 extends ServiceBase {
resultRows.get(i).get("material").toString(), resultRows.get(i).get("material").toString(),
resultRows.get(i).get("unit").toString() resultRows.get(i).get("unit").toString()
); );
// 根据规格计算单重
fKc006.setUnitWeight(HPPZTools.HpPz006.calcUnitWeight(hppz006.getId()));
// 计算总重
fKc006.setWeight(fKc006.getAmount().multiply(fKc006.getUnitWeight()));
fKc006.setInventRecordId(hppz006.getId()); fKc006.setInventRecordId(hppz006.getId());
fKc006.setInventCode(hppz006.getInventCode()); fKc006.setInventCode(hppz006.getInventCode());
DaoUtils.insert(HPKC006.INSERT, fKc006); DaoUtils.insert(HPKC006.INSERT, fKc006);
...@@ -138,46 +142,6 @@ public class ServiceHPKC006 extends ServiceBase { ...@@ -138,46 +142,6 @@ public class ServiceHPKC006 extends ServiceBase {
} }
/** /**
* 修改操作
*
* @param inInfo
* @return
*/
@OperationLogAnnotation(operModul = "其他入库单",operType = "修改",operDesc = "修改")
public EiInfo update(EiInfo inInfo) {
try {
List<Map> resultRows = inInfo.getBlock(EiConstant.resultBlock).getRows();
// 数据校验
this.checkSaveData(resultRows);
// 入库单号
List<String> otherEnterNos = ObjectUtils.listKey(resultRows, "otherEnterNo");
// 锁记录
HPKCTools.HpKc006.lock(otherEnterNos);
// 查询数据库记录
Map<String, HPKC006> mapKc006 = HPKCTools.HpKc006.map(otherEnterNos);
for (int i = 0; i < resultRows.size(); i++) {
HPKC006 fKc006 = new HPKC006();
fKc006.fromMap(resultRows.get(i));
// 设置基础信息
this.setBaseInfo(fKc006);
DaoUtils.update(HPKC006.UPDATE, fKc006);
// 计算差异数量与重量
HPKC006 dbKc006 = mapKc006.get(fKc006.getOtherEnterNo());
BigDecimal diffAmount = fKc006.getAmount().subtract(dbKc006.getAmount());
BigDecimal diffWeight = fKc006.getWeight().subtract(dbKc006.getWeight());
// 修改库存
HPKCTools.updateStock(fKc006.getWhCode(), fKc006.getInventRecordId(), diffAmount, diffWeight);
}
inInfo = this.query(inInfo);
inInfo.setStatus(EiConstant.STATUS_SUCCESS);
inInfo.setMsg("操作成功!本次对[" + resultRows.size() + "]条数据修改成功!");
} catch (PlatException e) {
LogUtils.setDetailMsg(inInfo, e, "修改失败");
}
return inInfo;
}
/**
* 校验保存的数据 * 校验保存的数据
* *
* @param resultRows * @param resultRows
......
...@@ -3,6 +3,7 @@ package com.baosight.hpjx.hp.kc.service; ...@@ -3,6 +3,7 @@ package com.baosight.hpjx.hp.kc.service;
import com.baosight.hpjx.aspect.annotation.OperationLogAnnotation; import com.baosight.hpjx.aspect.annotation.OperationLogAnnotation;
import com.baosight.hpjx.common.DdynamicEnum; import com.baosight.hpjx.common.DdynamicEnum;
import com.baosight.hpjx.common.InventTypeEnum; import com.baosight.hpjx.common.InventTypeEnum;
import com.baosight.hpjx.core.constant.CommonConstant;
import com.baosight.hpjx.core.dao.DaoUtils; import com.baosight.hpjx.core.dao.DaoUtils;
import com.baosight.hpjx.hp.constant.HPConstant; import com.baosight.hpjx.hp.constant.HPConstant;
import com.baosight.hpjx.hp.kc.domain.HPKC007; import com.baosight.hpjx.hp.kc.domain.HPKC007;
...@@ -45,8 +46,8 @@ public class ServiceHPKC007A extends ServiceEPBase { ...@@ -45,8 +46,8 @@ public class ServiceHPKC007A extends ServiceEPBase {
* @param inInfo * @param inInfo
* @return * @return
*/ */
@OperationLogAnnotation(operModul = "库存查询",operType = "查询",operDesc = "其他出库单-库存查询-初始化")
@Override @Override
@OperationLogAnnotation(operModul = "库存查询", operType = "查询", operDesc = "其他出库单-库存查询-初始化")
public EiInfo initLoad(EiInfo inInfo) { public EiInfo initLoad(EiInfo inInfo) {
try { try {
Map queryMap = new HashMap(); Map queryMap = new HashMap();
...@@ -68,8 +69,8 @@ public class ServiceHPKC007A extends ServiceEPBase { ...@@ -68,8 +69,8 @@ public class ServiceHPKC007A extends ServiceEPBase {
* @param inInfo * @param inInfo
* @return * @return
*/ */
@OperationLogAnnotation(operModul = "库存查询",operType = "查询",operDesc = "其他出库单-库存查询-查询")
@Override @Override
@OperationLogAnnotation(operModul = "库存查询", operType = "查询", operDesc = "其他出库单-库存查询-查询")
public EiInfo query(EiInfo inInfo) { public EiInfo query(EiInfo inInfo) {
try { try {
Map queryRow = EiInfoUtils.getFirstRow(inInfo); Map queryRow = EiInfoUtils.getFirstRow(inInfo);
...@@ -98,6 +99,22 @@ public class ServiceHPKC007A extends ServiceEPBase { ...@@ -98,6 +99,22 @@ public class ServiceHPKC007A extends ServiceEPBase {
// 获取库存信息 // 获取库存信息
Map<Long, HPKC010> dbKc010Map = HPKCTools.HpKc010.map(ids); Map<Long, HPKC010> dbKc010Map = HPKCTools.HpKc010.map(ids);
// 状态校验 // 状态校验
this.checkData(resultRows, dbKc010Map);
// 生成出库单
this.saveData(resultRows, dbKc010Map);
} catch (Exception e) {
LogUtils.setDetailMsg(inInfo, e, "生成出库单失败");
}
return inInfo;
}
/**
* 校验数据
*
* @param resultRows
* @param dbKc010Map
*/
private void checkData(List<Map> resultRows, Map<Long, HPKC010> dbKc010Map) {
for (Map row : resultRows) { for (Map row : resultRows) {
Long id = MapUtils.getLong(row, "id"); Long id = MapUtils.getLong(row, "id");
HPKC010 dbKc010 = dbKc010Map.get(id); HPKC010 dbKc010 = dbKc010Map.get(id);
...@@ -106,14 +123,18 @@ public class ServiceHPKC007A extends ServiceEPBase { ...@@ -106,14 +123,18 @@ public class ServiceHPKC007A extends ServiceEPBase {
BigDecimal applyAmount = MapUtils.getBigDecimal(row, "applyAmount"); BigDecimal applyAmount = MapUtils.getBigDecimal(row, "applyAmount");
AssertUtils.isGt(applyAmount, dbKc010.getAmount(), AssertUtils.isGt(applyAmount, dbKc010.getAmount(),
"库存号[" + id + "]可用数量不足!"); "库存号[" + id + "]可用数量不足!");
BigDecimal applyWeight = MapUtils.getBigDecimal(row, "applyWeight");
AssertUtils.isGt(applyWeight, dbKc010.getWeight(),
"库存号[" + id + "]可用重量不足!");
} }
// 生成出库单 }
/**
* 保存数据
*
* @param resultRows
* @param dbKc010Map
*/
private void saveData(List<Map> resultRows, Map<Long, HPKC010> dbKc010Map) {
for (Map row : resultRows) { for (Map row : resultRows) {
BigDecimal applyAmount = MapUtils.getBigDecimal(row, "applyAmount"); BigDecimal applyAmount = MapUtils.getBigDecimal(row, "applyAmount");
BigDecimal applyWeight = MapUtils.getBigDecimal(row, "applyWeight");
String applyRemark = MapUtils.getString(row, "applyRemark"); String applyRemark = MapUtils.getString(row, "applyRemark");
Long kcId = MapUtils.getLong(row, "id"); Long kcId = MapUtils.getLong(row, "id");
HPKC010 dbKc010 = dbKc010Map.get(kcId); HPKC010 dbKc010 = dbKc010Map.get(kcId);
...@@ -121,18 +142,15 @@ public class ServiceHPKC007A extends ServiceEPBase { ...@@ -121,18 +142,15 @@ public class ServiceHPKC007A extends ServiceEPBase {
kc007.setOtherOuterNo(SequenceGenerator.getNextSequence(HPConstant.SequenceId.OTHER_OUTER_NO)); kc007.setOtherOuterNo(SequenceGenerator.getNextSequence(HPConstant.SequenceId.OTHER_OUTER_NO));
kc007.setReceiptDate(DateUtils.shortDate()); kc007.setReceiptDate(DateUtils.shortDate());
kc007.setAmount(applyAmount); kc007.setAmount(applyAmount);
kc007.setWeight(applyWeight); kc007.setWeight(dbKc010.getUnitWeight().multiply(applyAmount));
kc007.setKcId(kcId); kc007.setKcId(kcId);
kc007.setRemark(applyRemark); kc007.setRemark(applyRemark);
kc007.setDeleteFlag(CommonConstant.YesNo.NO_0);
DaoUtils.insert(HPKC007.INSERT, kc007); DaoUtils.insert(HPKC007.INSERT, kc007);
// 修改库存数量 // 修改库存数量
HPKCTools.updateStock(kc007.getWhCode(), kc007.getInventRecordId(), kc007.getAmount().negate(), HPKCTools.updateStock(kc007.getWhCode(), kc007.getInventRecordId(), kc007.getAmount().negate(),
kc007.getWeight().negate()); kc007.getWeight().negate());
} }
} catch (Exception e) {
LogUtils.setDetailMsg(inInfo, e, "生成出库单失败");
}
return inInfo;
} }
} }
...@@ -2,6 +2,7 @@ package com.baosight.hpjx.hp.kc.service; ...@@ -2,6 +2,7 @@ package com.baosight.hpjx.hp.kc.service;
import com.baosight.hpjx.aspect.annotation.OperationLogAnnotation; import com.baosight.hpjx.aspect.annotation.OperationLogAnnotation;
import com.baosight.hpjx.common.DdynamicEnum; import com.baosight.hpjx.common.DdynamicEnum;
import com.baosight.hpjx.common.InventTypeEnum;
import com.baosight.hpjx.core.dao.DaoUtils; import com.baosight.hpjx.core.dao.DaoUtils;
import com.baosight.hpjx.core.security.UserSessionUtils; import com.baosight.hpjx.core.security.UserSessionUtils;
import com.baosight.hpjx.hp.kc.domain.HPKC010; import com.baosight.hpjx.hp.kc.domain.HPKC010;
...@@ -28,35 +29,39 @@ import java.util.Map; ...@@ -28,35 +29,39 @@ import java.util.Map;
import java.util.Objects; import java.util.Objects;
/** /**
*
* @author:wwl * @author:wwl
* @date:2024/1/23,10:51 * @date:2024/1/23,10:51
*/ */
public class ServiceHPKC010 extends ServiceBase { public class ServiceHPKC010 extends ServiceBase {
// 指定存货类型
private static final Integer[] DEFAULT_INVENT_CODE = {InventTypeEnum.RAW.getCode(),
InventTypeEnum.CONSUMABLE.getCode(), InventTypeEnum.WASTE.getCode()};
/** /**
* 画面初始化 * 画面初始化
* *
* @param inInfo * @param inInfo
* @return * @return
*/ */
@OperationLogAnnotation(operModul = "实时库存管理",operType = "查询",operDesc = "初始化") @Override
@OperationLogAnnotation(operModul = "实时库存管理", operType = "查询", operDesc = "初始化")
public EiInfo initLoad(EiInfo inInfo) { public EiInfo initLoad(EiInfo inInfo) {
HPKC010 HPKC010 = new HPKC010(); inInfo.getBlock(EiConstant.resultBlock).addBlockMeta(new HPKC010().eiMetadata);
EiInfo outInfo = super.initLoad(inInfo, HPKC010); Map queryMap = new HashMap();
outInfo.getBlock(EiConstant.resultBlock).getRows().clear(); queryMap.put("inventCodes", DEFAULT_INVENT_CODE);
CommonMethod.initBlock(outInfo, Arrays.asList(DdynamicEnum.WH_RECORD_BLOCK_ID), null); CommonMethod.initBlock(inInfo, Arrays.asList(DdynamicEnum.WH_RECORD_BLOCK_ID), queryMap);
CommonMethod.initBlock(outInfo, Arrays.asList(DdynamicEnum.MATERIAL_RECORD_BLOCK_ID), null); CommonMethod.initBlock(inInfo, Arrays.asList(DdynamicEnum.MATERIAL_RECORD_BLOCK_ID), queryMap);
CommonMethod.initBlock(outInfo, Arrays.asList(DdynamicEnum.INVENT_SPEC_BLOCK_ID), null); CommonMethod.initBlock(inInfo, Arrays.asList(DdynamicEnum.INVENT_SPEC_BLOCK_ID), queryMap);
CommonMethod.initBlock(outInfo, Arrays.asList(DdynamicEnum.SPEC_NAME_BLOCK_ID), null, false); CommonMethod.initBlock(inInfo, Arrays.asList(DdynamicEnum.SPEC_NAME_BLOCK_ID), queryMap, false);
return outInfo; return inInfo;
} }
/** /**
* 查询操作. * 查询操作.
*/ */
@OperationLogAnnotation(operModul = "实时库存管理",operType = "查询",operDesc = "查询")
@Override @Override
@OperationLogAnnotation(operModul = "实时库存管理", operType = "查询", operDesc = "查询")
public EiInfo query(EiInfo inInfo) { public EiInfo query(EiInfo inInfo) {
try { try {
inInfo = super.query(inInfo, "HPKC010.query", new HPKC010()); inInfo = super.query(inInfo, "HPKC010.query", new HPKC010());
...@@ -95,36 +100,38 @@ public class ServiceHPKC010 extends ServiceBase { ...@@ -95,36 +100,38 @@ public class ServiceHPKC010 extends ServiceBase {
* @param inInfo * @param inInfo
* @return * @return
*/ */
@OperationLogAnnotation(operModul = "实时库存管理",operType = "修改",operDesc = "更新库存") @OperationLogAnnotation(operModul = "实时库存管理", operType = "修改", operDesc = "更新库存")
public EiInfo updateStock(EiInfo inInfo){ public EiInfo updateStock(EiInfo inInfo) {
String whCode = inInfo.getString("whCode"); String whCode = inInfo.getString("whCode");
Long inventRecordId = Long.parseLong(inInfo.getString("inventRecordId")); Long inventRecordId = Long.parseLong(inInfo.getString("inventRecordId"));
BigDecimal amount = new BigDecimal(inInfo.getString("amount")); BigDecimal amount = new BigDecimal(inInfo.getString("amount"));
BigDecimal weight = new BigDecimal(inInfo.getString("weight")); BigDecimal weight = new BigDecimal(inInfo.getString("weight"));
String unitWeightStr = inInfo.getString("unitWeight");
BigDecimal unitWeight = unitWeightStr == null ? BigDecimal.ZERO : new BigDecimal(unitWeightStr);
String companyCode = UserSessionUtils.getCompanyCode(); String companyCode = UserSessionUtils.getCompanyCode();
try { try {
checkUpdateStockParam(companyCode,whCode,inventRecordId,amount,weight); checkUpdateStockParam(companyCode, whCode, inventRecordId, amount, weight);
HPKC010 newObj = generatorBaseInfo(companyCode,whCode,inventRecordId,amount,weight); HPKC010 newObj = generatorBaseInfo(companyCode, whCode, inventRecordId, amount, unitWeight, weight);
List<Map> list = dao.query("HPKC010.queryByCondition",new HashMap<String,Object>(){{ List<Map> list = dao.query("HPKC010.queryByCondition", new HashMap<String, Object>() {{
put("companyCode",companyCode); put("companyCode", companyCode);
put("whCode",whCode); put("whCode", whCode);
put("inventRecordId",inventRecordId); put("inventRecordId", inventRecordId);
}}); }});
if(CollectionUtils.isEmpty(list)){ if (CollectionUtils.isEmpty(list)) {
//新增 //新增
if(amount.compareTo(BigDecimal.ZERO)<0 if (amount.compareTo(BigDecimal.ZERO) < 0
||weight.compareTo(BigDecimal.ZERO)<0){ || weight.compareTo(BigDecimal.ZERO) < 0) {
throw new PlatException("当前库存为空,库存变更数量与重量不能小于等于0!"); throw new PlatException("当前库存为空,库存变更数量与重量不能小于等于0!");
} }
generatorBaseInfo(newObj); generatorBaseInfo(newObj);
DaoUtils.insert("HPKC010.insert",newObj); DaoUtils.insert("HPKC010.insert", newObj);
}else{ } else {
//修改 //修改
HPKC010 oldObj = new HPKC010(); HPKC010 oldObj = new HPKC010();
oldObj.fromMap(list.get(0)); oldObj.fromMap(list.get(0));
BigDecimal afterAmout = oldObj.getAmount().add(amount); BigDecimal afterAmout = oldObj.getAmount().add(amount);
BigDecimal afterWeight = oldObj.getWeight().add(weight); BigDecimal afterWeight = oldObj.getWeight().add(weight);
if(afterAmout.compareTo(BigDecimal.ZERO)<0||afterWeight.compareTo(BigDecimal.ZERO)<0){ if (afterAmout.compareTo(BigDecimal.ZERO) < 0 || afterWeight.compareTo(BigDecimal.ZERO) < 0) {
throw new PlatException("库存更新失败,出库数量与重量不能大于当前库存!"); throw new PlatException("库存更新失败,出库数量与重量不能大于当前库存!");
} }
oldObj.setAmount(afterAmout); oldObj.setAmount(afterAmout);
...@@ -147,6 +154,7 @@ public class ServiceHPKC010 extends ServiceBase { ...@@ -147,6 +154,7 @@ public class ServiceHPKC010 extends ServiceBase {
/** /**
* 生成库存对象 * 生成库存对象
*
* @param companyCode * @param companyCode
* @param whCode * @param whCode
* @param inventRecordId * @param inventRecordId
...@@ -154,13 +162,14 @@ public class ServiceHPKC010 extends ServiceBase { ...@@ -154,13 +162,14 @@ public class ServiceHPKC010 extends ServiceBase {
* @param weight * @param weight
* @reutrn HPKC010 * @reutrn HPKC010
*/ */
private HPKC010 generatorBaseInfo(String companyCode, String whCode, Long inventRecordId, BigDecimal amout,
private HPKC010 generatorBaseInfo(String companyCode, String whCode, Long inventRecordId, BigDecimal amout, BigDecimal weight) { BigDecimal unitWeight, BigDecimal weight) {
HPKC010 hpkc010 = new HPKC010(); HPKC010 hpkc010 = new HPKC010();
hpkc010.setCompanyCode(companyCode); hpkc010.setCompanyCode(companyCode);
hpkc010.setWhCode(whCode); hpkc010.setWhCode(whCode);
hpkc010.setInventRecordId(inventRecordId); hpkc010.setInventRecordId(inventRecordId);
hpkc010.setAmount(amout); hpkc010.setAmount(amout);
hpkc010.setUnitWeight(unitWeight);
hpkc010.setWeight(weight); hpkc010.setWeight(weight);
String userId = UserSession.getLoginName(); String userId = UserSession.getLoginName();
String userName = UserSession.getLoginCName(); String userName = UserSession.getLoginCName();
...@@ -173,6 +182,7 @@ public class ServiceHPKC010 extends ServiceBase { ...@@ -173,6 +182,7 @@ public class ServiceHPKC010 extends ServiceBase {
hpkc010.setUpdatedTime(time); hpkc010.setUpdatedTime(time);
return hpkc010; return hpkc010;
} }
@OperationLogAnnotation(operModul = "实时库存管理",operType = "设置",operDesc = "生成库存对象") @OperationLogAnnotation(operModul = "实时库存管理",operType = "设置",operDesc = "生成库存对象")
private void generatorBaseInfo(HPKC010 hpkc010) { private void generatorBaseInfo(HPKC010 hpkc010) {
String whName = ""; String whName = "";
......
package com.baosight.hpjx.hp.kc.service;
import com.baosight.hpjx.aspect.annotation.OperationLogAnnotation;
import com.baosight.hpjx.common.DdynamicEnum;
import com.baosight.hpjx.common.InventTypeEnum;
import com.baosight.hpjx.hp.kc.domain.HPKC012;
import com.baosight.hpjx.util.CommonMethod;
import com.baosight.hpjx.util.EiInfoUtils;
import com.baosight.hpjx.util.LogUtils;
import com.baosight.iplat4j.core.ei.EiConstant;
import com.baosight.iplat4j.core.ei.EiInfo;
import com.baosight.iplat4j.core.exception.PlatException;
import com.baosight.iplat4j.core.service.impl.ServiceBase;
import java.util.Arrays;
import java.util.HashMap;
import java.util.Map;
/**
* @author YK
* @date 2024年01月09日 10:18
*/
public class ServiceHPKC012 extends ServiceBase {
// 指定存货类型
private static final Integer[] DEFAULT_INVENT_CODE = {InventTypeEnum.RAW.getCode(),
InventTypeEnum.CONSUMABLE.getCode()};
/**
* 画面初始化
*
* @param inInfo
* @return
*/
@Override
@OperationLogAnnotation(operModul = "库存预警查询", operType = "查询", operDesc = "初始化")
public EiInfo initLoad(EiInfo inInfo) {
try {
Map queryMap = new HashMap();
queryMap.put("inventTypes", DEFAULT_INVENT_CODE);
CommonMethod.initBlock(inInfo, Arrays.asList(DdynamicEnum.WH_RECORD_BLOCK_ID), queryMap);
CommonMethod.initBlock(inInfo, Arrays.asList(DdynamicEnum.INVENT_NAME_BLOCK_ID), queryMap);
CommonMethod.initBlock(inInfo, Arrays.asList(DdynamicEnum.SPEC_NAME_BLOCK_ID), queryMap);
inInfo.addBlock(EiConstant.resultBlock).addBlockMeta(new HPKC012().eiMetadata);
} catch (PlatException e) {
LogUtils.setDetailMsg(inInfo, e, "初始化失败");
}
return inInfo;
}
/**
* 查询操作
*
* @param inInfo
* @return
*/
@Override
@OperationLogAnnotation(operModul = "库存预警查询", operType = "查询", operDesc = "查询")
public EiInfo query(EiInfo inInfo) {
try {
Map queryRow = EiInfoUtils.getFirstRow(inInfo);
queryRow.put("inventTypes", DEFAULT_INVENT_CODE);
inInfo = super.query(inInfo, HPKC012.QUERY, new HPKC012());
} catch (Exception e) {
LogUtils.setDetailMsg(inInfo, e, "查询失败");
}
return inInfo;
}
}
...@@ -13,7 +13,6 @@ ...@@ -13,7 +13,6 @@
UPDATED_NAME as "updatedName", <!-- 更新人名称 --> UPDATED_NAME as "updatedName", <!-- 更新人名称 -->
UPDATED_TIME as "updatedTime", <!-- 更新时间 --> UPDATED_TIME as "updatedTime", <!-- 更新时间 -->
PURCHASE_NO as "purchaseNo", <!-- 采购单号 --> PURCHASE_NO as "purchaseNo", <!-- 采购单号 -->
OLD_PURCHASE_NO as "oldPurchaseNo", <!-- 原采购单号 -->
RECEIPT_DATE as "receiptDate", <!-- 单据日期 --> RECEIPT_DATE as "receiptDate", <!-- 单据日期 -->
WH_CODE as "whCode", <!-- 仓库编码 --> WH_CODE as "whCode", <!-- 仓库编码 -->
WH_NAME as "whName", <!-- 仓库名称 --> WH_NAME as "whName", <!-- 仓库名称 -->
...@@ -22,8 +21,10 @@ ...@@ -22,8 +21,10 @@
INVENT_NAME as "inventName", <!-- 存货名称 --> INVENT_NAME as "inventName", <!-- 存货名称 -->
INVENT_RECORD_ID as "inventRecordId", <!-- 存货档案ID --> INVENT_RECORD_ID as "inventRecordId", <!-- 存货档案ID -->
AMOUNT as "amount", <!-- 数量 --> AMOUNT as "amount", <!-- 数量 -->
UNIT_WEIGHT as "unitWeight", <!-- 单重 -->
WEIGHT as "weight", <!-- 重量 --> WEIGHT as "weight", <!-- 重量 -->
REMARK as "remark", <!-- 备注 --> REMARK as "remark", <!-- 备注 -->
OLD_PURCHASE_NO as "oldPurchaseNo", <!-- 原采购单号 -->
DELETE_FLAG as "deleteFlag" <!-- 是否删除0.否1.是 --> DELETE_FLAG as "deleteFlag" <!-- 是否删除0.否1.是 -->
</sql> </sql>
...@@ -113,20 +114,24 @@ ...@@ -113,20 +114,24 @@
</isNotEmpty> </isNotEmpty>
</sql> </sql>
<select id="query" parameterClass="java.util.HashMap" <sql id="order">
resultClass="com.baosight.hpjx.hp.kc.domain.HPKC001">
SELECT <include refid="column"/>
FROM hpjx.t_hpkc001 WHERE 1=1
<include refid="condition"/>
<include refid="customCondition"/>
<dynamic prepend="ORDER BY"> <dynamic prepend="ORDER BY">
<isNotEmpty property="orderBy"> <isNotEmpty property="order">
$orderBy$ $order$
</isNotEmpty> </isNotEmpty>
<isEmpty property="orderBy"> <isEmpty property="order">
ID asc ID DESC
</isEmpty> </isEmpty>
</dynamic> </dynamic>
</sql>
<select id="query" parameterClass="java.util.HashMap" resultClass="com.baosight.hpjx.hp.kc.domain.HPKC001">
SELECT
<include refid="column"/>
FROM hpjx.t_hpkc001 WHERE 1=1
<include refid="condition"/>
<include refid="customCondition"/>
<include refid="order"/>
</select> </select>
<select id="count" resultClass="int"> <select id="count" resultClass="int">
...@@ -152,13 +157,14 @@ ...@@ -152,13 +157,14 @@
INVENT_NAME, <!-- 存货名称 --> INVENT_NAME, <!-- 存货名称 -->
INVENT_RECORD_ID, <!-- 存货档案ID --> INVENT_RECORD_ID, <!-- 存货档案ID -->
AMOUNT, <!-- 数量 --> AMOUNT, <!-- 数量 -->
UNIT_WEIGHT, <!-- 单重 -->
WEIGHT, <!-- 重量 --> WEIGHT, <!-- 重量 -->
REMARK, <!-- 备注 --> REMARK, <!-- 备注 -->
DELETE_FLAG <!-- 是否删除0.否1.是 --> DELETE_FLAG <!-- 是否删除0.否1.是 -->
) VALUES ( ) VALUES (
#companyCode#, #depCode#, #createdBy#, #createdName#, #createdTime#, #companyCode#, #depCode#, #createdBy#, #createdName#, #createdTime#,
#purchaseNo#,#oldPurchaseNo#, #receiptDate#, #whCode#, #whName#, #inventType#, #purchaseNo#,#oldPurchaseNo#, #receiptDate#, #whCode#, #whName#, #inventType#,
#inventCode#, #inventName#, #inventRecordId#, #amount#, #weight#, #inventCode#, #inventName#, #inventRecordId#, #amount#, #unitWeight#, #weight#,
#remark#, #deleteFlag# #remark#, #deleteFlag#
) )
</insert> </insert>
...@@ -174,25 +180,6 @@ ...@@ -174,25 +180,6 @@
WHERE ID = #id# WHERE ID = #id#
</update> </update>
<update id="update">
UPDATE hpjx.t_hpkc001
SET
UPDATED_BY = #updatedBy#, <!-- 更新人 -->
UPDATED_NAME = #updatedName#, <!-- 更新人名称 -->
UPDATED_TIME = #updatedTime#, <!-- 更新时间 -->
RECEIPT_DATE = #receiptDate#, <!-- 单据日期 -->
WH_CODE = #whCode#, <!-- 仓库编码 -->
WH_NAME = #whName#, <!-- 仓库名称 -->
INVENT_TYPE = #inventType#, <!-- 存货类型 -->
INVENT_CODE = #inventCode#, <!-- 存货编码 -->
INVENT_NAME = #inventName#, <!-- 存货名称 -->
INVENT_RECORD_ID = #inventRecordId#, <!-- 存货档案ID -->
AMOUNT = #amount#, <!-- 数量 -->
WEIGHT = #weight#, <!-- 重量 -->
REMARK = #remark# <!-- 备注 -->
WHERE ID = #id#
</update>
<!-- 统计库存 --> <!-- 统计库存 -->
<select id="statDate" resultClass="com.baosight.hpjx.hp.kc.domain.HPKC001"> <select id="statDate" resultClass="com.baosight.hpjx.hp.kc.domain.HPKC001">
SELECT SELECT
......
...@@ -21,6 +21,7 @@ ...@@ -21,6 +21,7 @@
INVENT_NAME as "inventName", <!-- 存货名称 --> INVENT_NAME as "inventName", <!-- 存货名称 -->
INVENT_RECORD_ID as "inventRecordId", <!-- 存货档案ID --> INVENT_RECORD_ID as "inventRecordId", <!-- 存货档案ID -->
AMOUNT as "amount", <!-- 数量 --> AMOUNT as "amount", <!-- 数量 -->
UNIT_WEIGHT as "unitWeight", <!-- 单重 -->
WEIGHT as "weight", <!-- 重量 --> WEIGHT as "weight", <!-- 重量 -->
REMARK as "remark", <!-- 备注 --> REMARK as "remark", <!-- 备注 -->
KC_ID as "kcId", <!-- 库存ID --> KC_ID as "kcId", <!-- 库存ID -->
...@@ -114,7 +115,7 @@ ...@@ -114,7 +115,7 @@
<sql id="order"> <sql id="order">
<dynamic prepend="ORDER BY"> <dynamic prepend="ORDER BY">
<isNotEmpty property="order"> <isNotEmpty property="order">
$orderBy$ $order$
</isNotEmpty> </isNotEmpty>
<isEmpty property="order"> <isEmpty property="order">
ID asc ID asc
...@@ -152,6 +153,7 @@ ...@@ -152,6 +153,7 @@
INVENT_NAME, <!-- 存货名称 --> INVENT_NAME, <!-- 存货名称 -->
INVENT_RECORD_ID, <!-- 存货档案ID --> INVENT_RECORD_ID, <!-- 存货档案ID -->
AMOUNT, <!-- 数量 --> AMOUNT, <!-- 数量 -->
UNIT_WEIGHT, <!-- 单重 -->
WEIGHT, <!-- 重量 --> WEIGHT, <!-- 重量 -->
REMARK, <!-- 备注 --> REMARK, <!-- 备注 -->
KC_ID, <!-- 库存ID --> KC_ID, <!-- 库存ID -->
...@@ -160,7 +162,7 @@ ...@@ -160,7 +162,7 @@
) VALUES ( ) VALUES (
#companyCode#, #depCode#, #createdBy#, #createdName#, #createdTime#, #companyCode#, #depCode#, #createdBy#, #createdName#, #createdTime#,
#reqNo#, #receiptDate#, #whCode#, #whName#, #inventType#, #inventCode#, #reqNo#, #receiptDate#, #whCode#, #whName#, #inventType#, #inventCode#,
#inventName#, #inventRecordId#, #amount#, #weight#, #remark#, #kcId#, #inventName#, #inventRecordId#, #amount#, #unitWeight#, #weight#, #remark#, #kcId#,
#oldReqNo#, #deleteFlag# #oldReqNo#, #deleteFlag#
) )
</insert> </insert>
......
...@@ -15,13 +15,8 @@ ...@@ -15,13 +15,8 @@
A.INVENT_NAME as "inventName", <!-- 存货名称 --> A.INVENT_NAME as "inventName", <!-- 存货名称 -->
A.INVENT_RECORD_ID as "inventRecordId", <!-- 规格 --> A.INVENT_RECORD_ID as "inventRecordId", <!-- 规格 -->
A.AMOUNT as "amount", <!-- 数量 --> A.AMOUNT as "amount", <!-- 数量 -->
A.UNIT_WEIGHT as "unitWeight", <!-- 单重 -->
A.WEIGHT as "weight", <!-- 重量 --> A.WEIGHT as "weight", <!-- 重量 -->
B.LENGTH as "length",
B.WIDTH as "width",
B.THICK as "thick",
B.MATERIAL as "material",
B.COEFFICIENT as "coefficient",
B.UNIT AS "unit",
A.STATUS as "status", <!-- 状态 0提交 1保存 --> A.STATUS as "status", <!-- 状态 0提交 1保存 -->
A.REMARK as "remark", <!-- 备注 --> A.REMARK as "remark", <!-- 备注 -->
A.OLD_ENTER_NO as "oldEnterNo", <!-- 原入库单号 --> A.OLD_ENTER_NO as "oldEnterNo", <!-- 原入库单号 -->
...@@ -30,61 +25,67 @@ ...@@ -30,61 +25,67 @@
A.CREATED_TIME as "createdTime", <!-- 创建时间 --> A.CREATED_TIME as "createdTime", <!-- 创建时间 -->
A.UPDATED_BY as "updatedBy", <!-- 更新人 --> A.UPDATED_BY as "updatedBy", <!-- 更新人 -->
A.UPDATED_NAME as "updatedName", <!-- 更新人名称 --> A.UPDATED_NAME as "updatedName", <!-- 更新人名称 -->
A.UPDATED_TIME as "updatedTime" <!-- 更新时间 --> A.UPDATED_TIME as "updatedTime", <!-- 更新时间 -->
B.LENGTH as "length",
B.WIDTH as "width",
B.THICK as "thick",
B.MATERIAL as "material",
B.COEFFICIENT as "coefficient",
B.UNIT AS "unit"
</sql> </sql>
<sql id="condition"> <sql id="condition">
<isNotEmpty prepend=" AND " property="id"> <isNotEmpty prepend=" AND " property="id">
ID = #id# A.ID = #id#
</isNotEmpty> </isNotEmpty>
<isNotEmpty prepend=" AND " property="companyCode"> <isNotEmpty prepend=" AND " property="companyCode">
COMPANY_CODE = #companyCode# A.COMPANY_CODE = #companyCode#
</isNotEmpty> </isNotEmpty>
<isNotEmpty prepend=" AND " property="depCode"> <isNotEmpty prepend=" AND " property="depCode">
DEP_CODE = #depCode# A.DEP_CODE = #depCode#
</isNotEmpty> </isNotEmpty>
<isNotEmpty prepend=" AND " property="receiptDate"> <isNotEmpty prepend=" AND " property="receiptDate">
RECEIPT_DATE = #receiptDate# A.RECEIPT_DATE = #receiptDate#
</isNotEmpty> </isNotEmpty>
<isNotEmpty prepend=" AND " property="otherEnterNo"> <isNotEmpty prepend=" AND " property="otherEnterNo">
OTHER_ENTER_NO = #otherEnterNo# A.OTHER_ENTER_NO = #otherEnterNo#
</isNotEmpty> </isNotEmpty>
<isNotEmpty prepend=" AND " property="whCode"> <isNotEmpty prepend=" AND " property="whCode">
WH_CODE = #whCode# A.WH_CODE = #whCode#
</isNotEmpty> </isNotEmpty>
<isNotEmpty prepend=" AND " property="whName"> <isNotEmpty prepend=" AND " property="whName">
WH_NAME = #whName# A.WH_NAME = #whName#
</isNotEmpty> </isNotEmpty>
<isNotEmpty prepend=" AND " property="inventType"> <isNotEmpty prepend=" AND " property="inventType">
INVENT_TYPE = #inventType# A.INVENT_TYPE = #inventType#
</isNotEmpty> </isNotEmpty>
<isNotEmpty prepend=" AND " property="inventCode"> <isNotEmpty prepend=" AND " property="inventCode">
INVENT_CODE = #inventCode# A.INVENT_CODE = #inventCode#
</isNotEmpty> </isNotEmpty>
<isNotEmpty prepend=" AND " property="inventName"> <isNotEmpty prepend=" AND " property="inventName">
INVENT_NAME = #inventName# A.INVENT_NAME = #inventName#
</isNotEmpty> </isNotEmpty>
<isNotEmpty prepend=" AND " property="inventRecordId"> <isNotEmpty prepend=" AND " property="inventRecordId">
INVENT_RECORD_ID = #inventRecordId# A.INVENT_RECORD_ID = #inventRecordId#
</isNotEmpty> </isNotEmpty>
<isNotEmpty prepend=" AND " property="deleteFlag"> <isNotEmpty prepend=" AND " property="deleteFlag">
DELETE_FLAG = #deleteFlag# A.DELETE_FLAG = #deleteFlag#
</isNotEmpty> </isNotEmpty>
</sql> </sql>
<sql id="customCondition"> <sql id="customCondition">
<isNotEmpty prepend=" AND " property="otherEnterNos"> <isNotEmpty prepend=" AND " property="otherEnterNos">
OTHER_ENTER_NO IN <iterate close=")" open="(" conjunction="," property="otherEnterNos">#otherEnterNos[]#</iterate> A.OTHER_ENTER_NO IN <iterate close=")" open="(" conjunction="," property="otherEnterNos">#otherEnterNos[]#</iterate>
</isNotEmpty> </isNotEmpty>
<isNotEmpty prepend=" AND " property="inventTypes"> <isNotEmpty prepend=" AND " property="inventTypes">
INVENT_TYPE IN <iterate close=")" open="(" conjunction="," property="inventTypes">#inventTypes[]#</iterate> A.INVENT_TYPE IN <iterate close=")" open="(" conjunction="," property="inventTypes">#inventTypes[]#</iterate>
</isNotEmpty> </isNotEmpty>
<isNotEmpty prepend=" AND " property="spec"> <isNotEmpty prepend=" AND " property="spec">
<isEqual property="spec" compareValue="无规格"> <isEqual property="spec" compareValue="无规格">
INVENT_RECORD_ID IN (SELECT ID FROM ${hpjxSchema}.T_HPPZ006 WHERE SPEC = '') A.INVENT_RECORD_ID IN (SELECT ID FROM ${hpjxSchema}.T_HPPZ006 WHERE SPEC = '')
</isEqual> </isEqual>
<isNotEqual property="spec" compareValue="无规格"> <isNotEqual property="spec" compareValue="无规格">
INVENT_RECORD_ID IN (SELECT ID FROM ${hpjxSchema}.T_HPPZ006 WHERE SPEC = #spec#) A.INVENT_RECORD_ID IN (SELECT ID FROM ${hpjxSchema}.T_HPPZ006 WHERE SPEC = #spec#)
</isNotEqual> </isNotEqual>
</isNotEmpty> </isNotEmpty>
<isNotEmpty prepend=" AND " property="createdDateFrom"> <isNotEmpty prepend=" AND " property="createdDateFrom">
...@@ -109,72 +110,16 @@ ...@@ -109,72 +110,16 @@
<select id="query" parameterClass="java.util.HashMap" resultClass="com.baosight.hpjx.hp.kc.domain.HPKC006"> <select id="query" parameterClass="java.util.HashMap" resultClass="com.baosight.hpjx.hp.kc.domain.HPKC006">
SELECT SELECT
<include refid="column"/> <include refid="column"/>
FROM hpjx.t_hpkc006 A FROM HPJX.T_HPKC006 A
LEFT JOIN hpjx.t_hppz006 B ON A.INVENT_RECORD_ID = B.ID LEFT JOIN HPJX.T_HPPZ006 B ON A.INVENT_RECORD_ID = B.ID
WHERE 1=1 WHERE 1=1
<isNotEmpty prepend=" AND " property="id"> <include refid="condition"/>
A.ID = #id# <include refid="customCondition"/>
</isNotEmpty>
<isNotEmpty prepend=" AND " property="companyCode">
A.COMPANY_CODE = #companyCode#
</isNotEmpty>
<isNotEmpty prepend=" AND " property="depCode">
A.DEP_CODE = #depCode#
</isNotEmpty>
<isNotEmpty prepend=" AND " property="receiptDate">
A.RECEIPT_DATE = #receiptDate#
</isNotEmpty>
<isNotEmpty prepend=" AND " property="otherEnterNo">
A.OTHER_ENTER_NO = #otherEnterNo#
</isNotEmpty>
<isNotEmpty prepend=" AND " property="whCode">
A.WH_CODE = #whCode#
</isNotEmpty>
<isNotEmpty prepend=" AND " property="whName">
A.WH_NAME = #whName#
</isNotEmpty>
<isNotEmpty prepend=" AND " property="inventType">
A.INVENT_TYPE = #inventType#
</isNotEmpty>
<isNotEmpty prepend=" AND " property="inventCode">
A.INVENT_CODE = #inventCode#
</isNotEmpty>
<isNotEmpty prepend=" AND " property="inventName">
A.INVENT_NAME = #inventName#
</isNotEmpty>
<isNotEmpty prepend=" AND " property="inventRecordId">
A.INVENT_RECORD_ID = #inventRecordId#
</isNotEmpty>
<isNotEmpty prepend=" AND " property="deleteFlag">
A.DELETE_FLAG = #deleteFlag#
</isNotEmpty>
<isNotEmpty prepend=" AND " property="otherEnterNos">
A.OTHER_ENTER_NO IN <iterate close=")" open="(" conjunction="," property="otherEnterNos">#otherEnterNos[]#</iterate>
</isNotEmpty>
<isNotEmpty prepend=" AND " property="inventTypes">
A.INVENT_TYPE IN <iterate close=")" open="(" conjunction="," property="inventTypes">#inventTypes[]#</iterate>
</isNotEmpty>
<isNotEmpty prepend=" AND " property="spec">
<isEqual property="spec" compareValue="无规格">
A.INVENT_RECORD_ID IN (SELECT ID FROM ${hpjxSchema}.T_HPPZ006 WHERE SPEC = '')
</isEqual>
<isNotEqual property="spec" compareValue="无规格">
A.INVENT_RECORD_ID IN (SELECT ID FROM ${hpjxSchema}.T_HPPZ006 WHERE SPEC = #spec#)
</isNotEqual>
</isNotEmpty>
<isNotEmpty prepend=" AND " property="createdDateFrom">
A.CREATED_TIME &gt;= CONCAT(REPLACE(#createdDateFrom#, '-', ''), '000000')
</isNotEmpty>
<isNotEmpty prepend=" AND " property="createdDateTo">
A.CREATED_TIME &lt;= CONCAT(REPLACE(#createdDateTo#, '-', ''), '235959')
</isNotEmpty>
<!--<include refid="condition"/>-->
<!--<include refid="customCondition"/>-->
<include refid="order"/> <include refid="order"/>
</select> </select>
<select id="count" resultClass="int"> <select id="count" resultClass="int">
SELECT COUNT(*) FROM hpjx.t_hpkc006 WHERE 1=1 SELECT COUNT(*) FROM hpjx.t_hpkc006 A WHERE 1=1
<include refid="condition"/> <include refid="condition"/>
<include refid="customCondition"/> <include refid="customCondition"/>
</select> </select>
...@@ -184,7 +129,7 @@ ...@@ -184,7 +129,7 @@
SELECT SELECT
COALESCE(SUM(AMOUNT), 0) AS "amount", <!-- 数量 --> COALESCE(SUM(AMOUNT), 0) AS "amount", <!-- 数量 -->
COALESCE(SUM(WEIGHT), 0) AS "weight" <!-- 重量 --> COALESCE(SUM(WEIGHT), 0) AS "weight" <!-- 重量 -->
FROM ${hpjxSchema}.T_HPKC006 FROM ${hpjxSchema}.T_HPKC006 A
WHERE 1=1 WHERE 1=1
<include refid="condition"/> <include refid="condition"/>
<include refid="customCondition"/> <include refid="customCondition"/>
...@@ -203,6 +148,7 @@ ...@@ -203,6 +148,7 @@
INVENT_NAME, <!-- 存货名称 --> INVENT_NAME, <!-- 存货名称 -->
INVENT_RECORD_ID, <!-- 规格 --> INVENT_RECORD_ID, <!-- 规格 -->
AMOUNT, <!-- 数量 --> AMOUNT, <!-- 数量 -->
UNIT_WEIGHT, <!-- 重量 -->
WEIGHT, <!-- 重量 --> WEIGHT, <!-- 重量 -->
REMARK, <!-- 备注 --> REMARK, <!-- 备注 -->
OLD_ENTER_NO, <!-- 原入库单号 --> OLD_ENTER_NO, <!-- 原入库单号 -->
...@@ -212,7 +158,7 @@ ...@@ -212,7 +158,7 @@
DELETE_FLAG DELETE_FLAG
) VALUES ( ) VALUES (
#companyCode#, #depCode#, #receiptDate#, #otherEnterNo#, #whCode#, #whName#, #companyCode#, #depCode#, #receiptDate#, #otherEnterNo#, #whCode#, #whName#,
#inventType#, #inventCode#, #inventName#, #inventRecordId#, #amount#, #weight#, #inventType#, #inventCode#, #inventName#, #inventRecordId#, #amount#, #unitWeight#, #weight#,
#remark#, #oldEnterNo#, #createdBy#, #createdName#, #createdTime#, #deleteFlag# #remark#, #oldEnterNo#, #createdBy#, #createdName#, #createdTime#, #deleteFlag#
) )
</insert> </insert>
...@@ -222,25 +168,6 @@ ...@@ -222,25 +168,6 @@
UPDATE hpjx.t_hpkc006 SET DELETE_FLAG = 1 WHERE ID = #id# UPDATE hpjx.t_hpkc006 SET DELETE_FLAG = 1 WHERE ID = #id#
</delete> </delete>
<update id="update">
UPDATE ${hpjxSchema}.T_HPKC006
SET
RECEIPT_DATE = #receiptDate#, <!-- 单据日期 -->
WH_CODE = #whCode#, <!-- 仓库编码 -->
WH_NAME = #whName#, <!-- 仓库名称 -->
INVENT_TYPE = #inventType#, <!-- 存货类型 -->
INVENT_CODE = #inventCode#, <!-- 存货编码 -->
INVENT_NAME = #inventName#, <!-- 存货名称 -->
INVENT_RECORD_ID = #inventRecordId#, <!-- 规格 -->
AMOUNT = #amount#, <!-- 数量 -->
WEIGHT = #weight#, <!-- 重量 -->
REMARK = #remark#, <!-- 备注 -->
UPDATED_BY = #updatedBy#, <!-- 更新人 -->
UPDATED_NAME = #updatedName#, <!-- 更新人名称 -->
UPDATED_TIME = #updatedTime# <!-- 更新时间 -->
WHERE ID = #id#
</update>
<!-- 行锁 --> <!-- 行锁 -->
<update id="lock"> <update id="lock">
UPDATE ${hpjxSchema}.T_HPKC006 UPDATE ${hpjxSchema}.T_HPKC006
......
...@@ -15,6 +15,7 @@ ...@@ -15,6 +15,7 @@
INVENT_NAME as "inventName", <!-- 存货名称 --> INVENT_NAME as "inventName", <!-- 存货名称 -->
INVENT_RECORD_ID as "inventRecordId", <!-- 规格 --> INVENT_RECORD_ID as "inventRecordId", <!-- 规格 -->
AMOUNT as "amount", <!-- 数量 --> AMOUNT as "amount", <!-- 数量 -->
UNIT_WEIGHT as "unitWeight", <!-- 单重 -->
WEIGHT as "weight", <!-- 重量 --> WEIGHT as "weight", <!-- 重量 -->
STATUS as "status", <!-- 状态 0提交 1保存 --> STATUS as "status", <!-- 状态 0提交 1保存 -->
KC_ID as "kcId", <!-- 库存ID --> KC_ID as "kcId", <!-- 库存ID -->
...@@ -80,10 +81,10 @@ ...@@ -80,10 +81,10 @@
</isNotEqual> </isNotEqual>
</isNotEmpty> </isNotEmpty>
<isNotEmpty prepend=" AND " property="createdDateFrom"> <isNotEmpty prepend=" AND " property="createdDateFrom">
A.CREATED_TIME &gt;= CONCAT(REPLACE(#createdDateFrom#, '-', ''), '000000') CREATED_TIME &gt;= CONCAT(REPLACE(#createdDateFrom#, '-', ''), '000000')
</isNotEmpty> </isNotEmpty>
<isNotEmpty prepend=" AND " property="createdDateTo"> <isNotEmpty prepend=" AND " property="createdDateTo">
A.CREATED_TIME &lt;= CONCAT(REPLACE(#createdDateTo#, '-', ''), '235959') CREATED_TIME &lt;= CONCAT(REPLACE(#createdDateTo#, '-', ''), '235959')
</isNotEmpty> </isNotEmpty>
</sql> </sql>
...@@ -139,6 +140,7 @@ ...@@ -139,6 +140,7 @@
INVENT_NAME, <!-- 存货名称 --> INVENT_NAME, <!-- 存货名称 -->
INVENT_RECORD_ID, <!-- 规格 --> INVENT_RECORD_ID, <!-- 规格 -->
AMOUNT, <!-- 数量 --> AMOUNT, <!-- 数量 -->
UNIT_WEIGHT, <!-- 单重 -->
WEIGHT, <!-- 重量 --> WEIGHT, <!-- 重量 -->
KC_ID, <!-- 库存ID --> KC_ID, <!-- 库存ID -->
REMARK, <!-- 备注 --> REMARK, <!-- 备注 -->
...@@ -149,7 +151,7 @@ ...@@ -149,7 +151,7 @@
DELETE_FLAG DELETE_FLAG
) VALUES ( ) VALUES (
#companyCode#, #depCode#, #receiptDate#, #otherOuterNo#, #whCode#, #whName#, #companyCode#, #depCode#, #receiptDate#, #otherOuterNo#, #whCode#, #whName#,
#inventType#, #inventCode#, #inventName#, #inventRecordId#, #amount#, #weight#, #inventType#, #inventCode#, #inventName#, #inventRecordId#, #amount#, #unitWeight#, #weight#,
#kcId#, #remark#, #oldOuterNo#, #createdBy#, #createdName#, #createdTime#, #deleteFlag# #kcId#, #remark#, #oldOuterNo#, #createdBy#, #createdName#, #createdTime#, #deleteFlag#
) )
</insert> </insert>
...@@ -159,19 +161,6 @@ ...@@ -159,19 +161,6 @@
UPDATE hpjx.t_hpkc007 SET DELETE_FLAG = 1 WHERE ID = #id# UPDATE hpjx.t_hpkc007 SET DELETE_FLAG = 1 WHERE ID = #id#
</delete> </delete>
<update id="update">
UPDATE ${hpjxSchema}.T_HPKC007
SET
RECEIPT_DATE = #receiptDate#, <!-- 单据日期 -->
AMOUNT = #amount#, <!-- 数量 -->
WEIGHT = #weight#, <!-- 重量 -->
REMARK = #remark#, <!-- 备注 -->
UPDATED_BY = #updatedBy#, <!-- 更新人 -->
UPDATED_NAME = #updatedName#, <!-- 更新人名称 -->
UPDATED_TIME = #updatedTime# <!-- 更新时间 -->
WHERE ID = #id#
</update>
<!-- 行锁 --> <!-- 行锁 -->
<update id="lock"> <update id="lock">
UPDATE ${hpjxSchema}.T_HPKC007 UPDATE ${hpjxSchema}.T_HPKC007
......
...@@ -13,6 +13,7 @@ ...@@ -13,6 +13,7 @@
INVENT_NAME as "inventName", <!-- 物料名称 --> INVENT_NAME as "inventName", <!-- 物料名称 -->
INVENT_RECORD_ID as "inventRecordId", <!-- 存货档案ID --> INVENT_RECORD_ID as "inventRecordId", <!-- 存货档案ID -->
AMOUNT as "amount", <!-- 数量 --> AMOUNT as "amount", <!-- 数量 -->
UNIT_WEIGHT as "unitWeight", <!-- 单重 -->
WEIGHT as "weight", <!-- 重量 --> WEIGHT as "weight", <!-- 重量 -->
CREATED_BY as "createdBy", <!-- 创建人 --> CREATED_BY as "createdBy", <!-- 创建人 -->
CREATED_NAME as "createdName", <!-- 创建人名称 --> CREATED_NAME as "createdName", <!-- 创建人名称 -->
...@@ -125,6 +126,7 @@ ...@@ -125,6 +126,7 @@
INVENT_NAME, <!-- 存货名称 --> INVENT_NAME, <!-- 存货名称 -->
INVENT_RECORD_ID, <!-- 存货档案ID --> INVENT_RECORD_ID, <!-- 存货档案ID -->
AMOUNT, <!-- 数量 --> AMOUNT, <!-- 数量 -->
UNIT_WEIGHT, <!-- 单重 -->
WEIGHT, <!-- 重量 --> WEIGHT, <!-- 重量 -->
CREATED_BY, <!-- 创建人 --> CREATED_BY, <!-- 创建人 -->
CREATED_NAME, <!-- 创建人 --> CREATED_NAME, <!-- 创建人 -->
...@@ -135,13 +137,12 @@ ...@@ -135,13 +137,12 @@
VERSION VERSION
) VALUES ( ) VALUES (
#companyCode#, #depCode#, #whCode#, #whName#, #inventType#, #companyCode#, #depCode#, #whCode#, #whName#, #inventType#,
#inventCode#, #inventName#, #inventRecordId#, #amount#, #weight#, #inventCode#, #inventName#, #inventRecordId#, #amount#, #unitWeight#, #weight#,
#createdBy#, #createdName#, #createdTime#, #updatedBy#, #updatedName#, #createdBy#, #createdName#, #createdTime#, #updatedBy#, #updatedName#,
#updatedTime#, #version# #updatedTime#, #version#
) )
</insert> </insert>
<update id="updateStock"> <update id="updateStock">
UPDATE hpjx.T_HPKC010 UPDATE hpjx.T_HPKC010
SET SET
......
...@@ -14,6 +14,7 @@ ...@@ -14,6 +14,7 @@
INVENT_NAME as "inventName", <!-- 物料名称 --> INVENT_NAME as "inventName", <!-- 物料名称 -->
INVENT_RECORD_ID as "inventRecordId", <!-- 存货档案ID --> INVENT_RECORD_ID as "inventRecordId", <!-- 存货档案ID -->
AMOUNT as "amount", <!-- 数量 --> AMOUNT as "amount", <!-- 数量 -->
UNIT_WEIGHT as "unitWeight", <!-- 单重 -->
WEIGHT as "weight", <!-- 重量 --> WEIGHT as "weight", <!-- 重量 -->
CREATED_BY as "createdBy", <!-- 创建人 --> CREATED_BY as "createdBy", <!-- 创建人 -->
CREATED_NAME as "createdName", <!-- 创建人名称 --> CREATED_NAME as "createdName", <!-- 创建人名称 -->
...@@ -118,13 +119,13 @@ ...@@ -118,13 +119,13 @@
<insert id="backup"> <insert id="backup">
INSERT INTO ${hpjxSchema}.T_HPKC010A ( INSERT INTO ${hpjxSchema}.T_HPKC010A (
COMPANY_CODE, DEP_CODE, DATE_PROC, WH_CODE, WH_NAME, INVENT_TYPE, COMPANY_CODE, DEP_CODE, DATE_PROC, WH_CODE, WH_NAME, INVENT_TYPE,
INVENT_CODE, INVENT_NAME, INVENT_RECORD_ID, AMOUNT, WEIGHT, INVENT_CODE, INVENT_NAME, INVENT_RECORD_ID, AMOUNT, UNIT_WEIGHT, WEIGHT,
CREATED_BY, CREATED_NAME, CREATED_TIME, UPDATED_BY, UPDATED_NAME, CREATED_BY, CREATED_NAME, CREATED_TIME, UPDATED_BY, UPDATED_NAME,
UPDATED_TIME, VERSION UPDATED_TIME, VERSION
) )
SELECT SELECT
COMPANY_CODE, DEP_CODE, #dateProc#, WH_CODE, WH_NAME, INVENT_TYPE, COMPANY_CODE, DEP_CODE, #dateProc#, WH_CODE, WH_NAME, INVENT_TYPE,
INVENT_CODE, INVENT_NAME, INVENT_RECORD_ID, AMOUNT, WEIGHT, INVENT_CODE, INVENT_NAME, INVENT_RECORD_ID, AMOUNT, UNIT_WEIGHT, WEIGHT,
CREATED_BY, CREATED_NAME, CREATED_TIME, UPDATED_BY, UPDATED_NAME, CREATED_BY, CREATED_NAME, CREATED_TIME, UPDATED_BY, UPDATED_NAME,
UPDATED_TIME, VERSION UPDATED_TIME, VERSION
FROM ${hpjxSchema}.T_HPKC010 FROM ${hpjxSchema}.T_HPKC010
......
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE sqlMap PUBLIC "-//iBATIS.com//DTD SQL Map 2.0//EN" "http://www.ibatis.com/dtd/sql-map-2.dtd">
<sqlMap namespace="HPKC012">
<sql id="column">
A.ID as "id",
A.COMPANY_CODE as "companyCode", <!-- 企业编码 -->
A.DEP_CODE as "depCode", <!-- 部门编码 -->
A.WH_CODE as "whCode", <!-- 仓库编码 -->
A.WH_NAME as "whName", <!-- 仓库名称 -->
A.INVENT_TYPE as "inventType", <!-- 物料类型 -->
A.INVENT_CODE as "inventCode", <!-- 物料编码 -->
A.INVENT_NAME as "inventName", <!-- 物料名称 -->
A.INVENT_RECORD_ID as "inventRecordId", <!-- 存货档案ID -->
A.AMOUNT as "amount", <!-- 数量 -->
A.WEIGHT as "weight", <!-- 重量 -->
A.CREATED_BY as "createdBy", <!-- 创建人 -->
A.CREATED_NAME as "createdName", <!-- 创建人名称 -->
A.CREATED_TIME as "createdTime", <!-- 创建时间 -->
A.UPDATED_BY as "updatedBy", <!-- 更新人 -->
A.UPDATED_NAME as "updatedName", <!-- 更新人名称 -->
A.UPDATED_TIME as "updatedTime", <!-- 更新时间 -->
A.VERSION as "version", <!-- 版本号 -->
B.WARN_NUM as warnNum <!-- 预警值 -->
</sql>
<sql id="condition">
<isNotEmpty prepend=" AND " property="inventRecordId">
A.INVENT_RECORD_ID = #inventRecordId#
</isNotEmpty>
<isNotEmpty prepend=" AND " property="companyCode">
A.COMPANY_CODE = #companyCode#
</isNotEmpty>
<isNotEmpty prepend=" AND " property="whCode">
A.WH_CODE = #whCode#
</isNotEmpty>
<isNotEmpty prepend=" AND " property="whName">
A.WH_NAME LIKE '%' || #whName# || '%'
</isNotEmpty>
<isNotEmpty prepend=" AND " property="inventType">
A.INVENT_TYPE = #inventType#
</isNotEmpty>
<isNotEmpty prepend=" AND " property="inventCode">
A.INVENT_CODE = #inventCode#
</isNotEmpty>
<isNotEmpty prepend=" AND " property="inventName">
A.INVENT_NAME = #inventName#
</isNotEmpty>
</sql>
<sql id="customCondition">
<isNotEmpty prepend=" AND " property="inventTypes">
A.INVENT_TYPE IN <iterate close=")" open="(" conjunction="," property="inventTypes">#inventTypes[]#</iterate>
</isNotEmpty>
<isNotEmpty prepend=" AND " property="spec">
<isEqual property="spec" compareValue="无规格">
A.INVENT_RECORD_ID IN (SELECT ID FROM ${hpjxSchema}.T_HPPZ006 WHERE SPEC = '')
</isEqual>
<isNotEqual property="spec" compareValue="无规格">
A.INVENT_RECORD_ID IN (SELECT ID FROM ${hpjxSchema}.T_HPPZ006 WHERE SPEC = #spec#)
</isNotEqual>
</isNotEmpty>
</sql>
<sql id="order">
<dynamic prepend="ORDER BY">
<isNotEmpty property="order">
$order$
</isNotEmpty>
<isEmpty property="order">
A.ID DESC
</isEmpty>
</dynamic>
</sql>
<select id="query" resultClass="com.baosight.hpjx.hp.kc.domain.HPKC012">
SELECT <include refid="column"/>
FROM hpjx.T_HPKC010 A
INNER JOIN hpjx.T_HPPZ012 B ON A.INVENT_RECORD_ID = B.INVENT_RECORD_ID
WHERE 1=1
AND A.AMOUNT &lt;= B.WARN_NUM
<include refid="condition"/>
<include refid="customCondition"/>
<include refid="order"/>
</select>
<select id="count" resultClass="int">
SELECT COUNT(*) FROM hpjx.T_HPKC012
WHERE 1=1
<include refid="condition"/>
<include refid="customCondition"/>
</select>
</sqlMap>
...@@ -3,7 +3,15 @@ package com.baosight.hpjx.hp.kc.tools; ...@@ -3,7 +3,15 @@ package com.baosight.hpjx.hp.kc.tools;
import com.baosight.hpjx.core.dao.DaoBase; import com.baosight.hpjx.core.dao.DaoBase;
import com.baosight.hpjx.core.dao.DaoUtils; import com.baosight.hpjx.core.dao.DaoUtils;
import com.baosight.hpjx.hp.constant.HPSqlConstant; import com.baosight.hpjx.hp.constant.HPSqlConstant;
import com.baosight.hpjx.hp.kc.domain.*; import com.baosight.hpjx.hp.kc.domain.HPKC001;
import com.baosight.hpjx.hp.kc.domain.HPKC002;
import com.baosight.hpjx.hp.kc.domain.HPKC003;
import com.baosight.hpjx.hp.kc.domain.HPKC004;
import com.baosight.hpjx.hp.kc.domain.HPKC005;
import com.baosight.hpjx.hp.kc.domain.HPKC006;
import com.baosight.hpjx.hp.kc.domain.HPKC007;
import com.baosight.hpjx.hp.kc.domain.HPKC010;
import com.baosight.hpjx.hp.kc.domain.HPKC011;
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;
...@@ -433,12 +441,24 @@ public class HPKCTools { ...@@ -433,12 +441,24 @@ public class HPKCTools {
} }
/** /**
* HPKC010公共DAO方法定义 * 更新库存
*
* @param whCode
* @param inventRecordId
* @param amount
* @param weight
*/
public static void updateStock(String whCode, Long inventRecordId, BigDecimal amount, BigDecimal weight) {
updateStock(whCode, inventRecordId, amount, BigDecimal.ZERO, weight);
}
/**
* HPKC011公共DAO方法定义
* *
* @author:songx * @author:songx
* @date:2024/1/31,16:42 * @date:2024/1/31,16:42
*/ */
public static class HpKc010 { public static class HpKc011 {
/** /**
* 查询库存信息 * 查询库存信息
...@@ -446,13 +466,13 @@ public class HPKCTools { ...@@ -446,13 +466,13 @@ public class HPKCTools {
* @param ids * @param ids
* @return * @return
*/ */
public static List<HPKC010> list(List<Long> ids) { public static List<HPKC011> list(List<Long> ids) {
if (CollectionUtils.isEmpty(ids)) { if (CollectionUtils.isEmpty(ids)) {
return null; return null;
} }
Map queryMap = new HashMap(); Map queryMap = new HashMap();
queryMap.put("ids", ids); queryMap.put("ids", ids);
return DaoBase.getInstance().query(HPKC010.QUERY, queryMap); return DaoBase.getInstance().query(HPKC011.QUERY, queryMap);
} }
/** /**
...@@ -461,12 +481,12 @@ public class HPKCTools { ...@@ -461,12 +481,12 @@ public class HPKCTools {
* @param ids * @param ids
* @return * @return
*/ */
public static Map<Long, HPKC010> map(List<Long> ids) { public static Map<Long, HPKC011> map(List<Long> ids) {
List<HPKC010> results = list(ids); List<HPKC011> results = list(ids);
if (CollectionUtils.isEmpty(results)) { if (CollectionUtils.isEmpty(results)) {
return null; return null;
} }
return results.stream().collect(Collectors.toMap(HPKC010::getId, item -> item)); return results.stream().collect(Collectors.toMap(HPKC011::getId, item -> item));
} }
/** /**
...@@ -481,18 +501,61 @@ public class HPKCTools { ...@@ -481,18 +501,61 @@ public class HPKCTools {
} }
Map queryMap = new HashMap(); Map queryMap = new HashMap();
queryMap.put("ids", ids); queryMap.put("ids", ids);
DaoBase.getInstance().update(HPSqlConstant.HPKC010.LOCK, queryMap); DaoBase.getInstance().update(HPSqlConstant.HPKC011.LOCK, queryMap);
} }
} }
/** /**
* HPKC011公共DAO方法定义 * 更新库存
*
* @param whCode
* @param inventRecordId
* @param amount
* @param unitWeight
* @param weight
*/
public static void updateStock(String whCode, Long inventRecordId, BigDecimal amount, BigDecimal unitWeight,
BigDecimal weight) {
if (amount.compareTo(BigDecimal.ZERO) == 0) {
throw new PlatException("入库数量不能为空");
}
EiInfo inInfo = new EiInfo();
inInfo.set("whCode", whCode);
inInfo.set("inventRecordId", inventRecordId);
inInfo.set("amount", amount);
inInfo.set("unitWeight", unitWeight);
inInfo.set("weight", weight);
inInfo.set(EiConstant.serviceName, "HPKC010");
inInfo.set(EiConstant.methodName, "updateStock");
EiInfo outInfo = XLocalManager.call(inInfo);
if (outInfo.getStatus() < 0) {
throw new PlatException("跟新库存失败:" + outInfo.getMsg());
}
}
/**
* HPKC010公共DAO方法定义
* *
* @author:songx * @author:songx
* @date:2024/1/31,16:42 * @date:2024/1/31,16:42
*/ */
public static class HpKc011 { public static class HpKc010 {
/**
* 查询
*
* @param inventRecordId
* @return
*/
public static List<HPKC010> listBySpec(Long inventRecordId) {
if (inventRecordId != null) {
return null;
}
Map queryMap = new HashMap();
queryMap.put("inventRecordId", inventRecordId);
return DaoBase.getInstance().query(HPKC010.QUERY, queryMap);
}
/** /**
* 查询库存信息 * 查询库存信息
...@@ -500,13 +563,13 @@ public class HPKCTools { ...@@ -500,13 +563,13 @@ public class HPKCTools {
* @param ids * @param ids
* @return * @return
*/ */
public static List<HPKC011> list(List<Long> ids) { public static List<HPKC010> list(List<Long> ids) {
if (CollectionUtils.isEmpty(ids)) { if (CollectionUtils.isEmpty(ids)) {
return null; return null;
} }
Map queryMap = new HashMap(); Map queryMap = new HashMap();
queryMap.put("ids", ids); queryMap.put("ids", ids);
return DaoBase.getInstance().query(HPKC011.QUERY, queryMap); return DaoBase.getInstance().query(HPKC010.QUERY, queryMap);
} }
/** /**
...@@ -515,12 +578,12 @@ public class HPKCTools { ...@@ -515,12 +578,12 @@ public class HPKCTools {
* @param ids * @param ids
* @return * @return
*/ */
public static Map<Long, HPKC011> map(List<Long> ids) { public static Map<Long, HPKC010> map(List<Long> ids) {
List<HPKC011> results = list(ids); List<HPKC010> results = list(ids);
if (CollectionUtils.isEmpty(results)) { if (CollectionUtils.isEmpty(results)) {
return null; return null;
} }
return results.stream().collect(Collectors.toMap(HPKC011::getId, item -> item)); return results.stream().collect(Collectors.toMap(HPKC010::getId, item -> item));
} }
/** /**
...@@ -535,34 +598,9 @@ public class HPKCTools { ...@@ -535,34 +598,9 @@ public class HPKCTools {
} }
Map queryMap = new HashMap(); Map queryMap = new HashMap();
queryMap.put("ids", ids); queryMap.put("ids", ids);
DaoBase.getInstance().update(HPSqlConstant.HPKC011.LOCK, queryMap); DaoBase.getInstance().update(HPSqlConstant.HPKC010.LOCK, queryMap);
}
} }
/**
* 更新库存
*
* @param whCode
* @param inventRecordId
* @param amount
* @param weight
*/
public static void updateStock(String whCode, Long inventRecordId, BigDecimal amount, BigDecimal weight) {
if (amount.compareTo(BigDecimal.ZERO) == 0 && weight.compareTo(BigDecimal.ZERO) == 0) {
return;
}
EiInfo inInfo = new EiInfo();
inInfo.set("whCode", whCode);
inInfo.set("inventRecordId", inventRecordId);
inInfo.set("amount", amount);
inInfo.set("weight", weight);
inInfo.set(EiConstant.serviceName, "HPKC010");
inInfo.set(EiConstant.methodName, "updateStock");
EiInfo outInfo = XLocalManager.call(inInfo);
if (outInfo.getStatus() < 0) {
throw new PlatException("跟新库存失败:" + outInfo.getMsg());
}
} }
......
package com.baosight.hpjx.hp.pz.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;
import java.util.Map;
import com.baosight.iplat4j.core.util.StringUtils;
/**
* Project: <br>
* Title:THppz012.java <br>
* Description: <br>
*
* Copyrigth:Baosight Software LTD.co Copyright (c) 2019. <br>
*
* @version 1.0
* @history 2024-02-27 9:53:53 create
*/
public class HPPZ012 extends DaoEPBase {
private static final long serialVersionUID = 1L;
public static final String FIELD_ID = "id";
public static final String FIELD_COMPANY_CODE = "companyCode"; /* 企业编码*/
public static final String FIELD_DEP_CODE = "depCode"; /* 部门编码*/
public static final String FIELD_CREATED_BY = "createdBy"; /* 创建人*/
public static final String FIELD_CREATED_NAME = "createdName"; /* 创建人名称*/
public static final String FIELD_CREATED_TIME = "createdTime"; /* 创建时间*/
public static final String FIELD_UPDATED_BY = "updatedBy"; /* 更新人*/
public static final String FIELD_UPDATED_NAME = "updatedName"; /* 更新人名称*/
public static final String FIELD_UPDATED_TIME = "updatedTime"; /* 更新时间*/
public static final String FIELD_DELETE_FLAG = "deleteFlag"; /* 0.否1.是*/
public static final String FIELD_WH_CODE = "whCode"; /* 仓库编码*/
public static final String FIELD_WH_NAME = "whName"; /* 仓库名称*/
public static final String FIELD_INVENT_TYPE = "inventType"; /* 物料类型*/
public static final String FIELD_INVENT_CODE = "inventCode"; /* 物料编码*/
public static final String FIELD_INVENT_NAME = "inventName"; /* 物料名称*/
public static final String FIELD_INVENT_RECORD_ID = "inventRecordId"; /* 存货档案ID*/
public static final String FIELD_WARN_NUM = "warnNum"; /* 预警数量*/
public static final String FIELD_REMARK = "remark"; /* 备注*/
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_CREATED_BY = "CREATED_BY"; /* 创建人*/
public static final String COL_CREATED_NAME = "CREATED_NAME"; /* 创建人名称*/
public static final String COL_CREATED_TIME = "CREATED_TIME"; /* 创建时间*/
public static final String COL_UPDATED_BY = "UPDATED_BY"; /* 更新人*/
public static final String COL_UPDATED_NAME = "UPDATED_NAME"; /* 更新人名称*/
public static final String COL_UPDATED_TIME = "UPDATED_TIME"; /* 更新时间*/
public static final String COL_DELETE_FLAG = "DELETE_FLAG"; /* 0.否1.是*/
public static final String COL_WH_CODE = "WH_CODE"; /* 仓库编码*/
public static final String COL_WH_NAME = "WH_NAME"; /* 仓库名称*/
public static final String COL_INVENT_TYPE = "INVENT_TYPE"; /* 物料类型*/
public static final String COL_INVENT_CODE = "INVENT_CODE"; /* 物料编码*/
public static final String COL_INVENT_NAME = "INVENT_NAME"; /* 物料名称*/
public static final String COL_INVENT_RECORD_ID = "INVENT_RECORD_ID"; /* 存货档案ID*/
public static final String COL_WARN_NUM = "WARN_NUM"; /* 预警数量*/
public static final String COL_REMARK = "REMARK"; /* 备注*/
public static final String QUERY = "HPPZ012.query";
public static final String COUNT = "HPPZ012.count";
public static final String INSERT = "HPPZ012.insert";
public static final String UPDATE = "HPPZ012.update";
public static final String DELETE = "HPPZ012.delete";
private Long id;
private String companyCode = " "; /* 企业编码*/
private String depCode = " "; /* 部门编码*/
private String createdBy = " "; /* 创建人*/
private String createdName = " "; /* 创建人名称*/
private String createdTime = " "; /* 创建时间*/
private String updatedBy = " "; /* 更新人*/
private String updatedName = " "; /* 更新人名称*/
private String updatedTime = " "; /* 更新时间*/
private Integer deleteFlag; /* 0.否1.是*/
private String whCode = " "; /* 仓库编码*/
private String whName = " "; /* 仓库名称*/
private String inventType = " "; /* 物料类型*/
private String inventCode = " "; /* 物料编码*/
private String inventName = " "; /* 物料名称*/
private Long inventRecordId; /* 存货档案ID*/
private BigDecimal warnNum = new BigDecimal("0"); /* 预警数量*/
private String remark = " "; /* 备注*/
/**
* initialize the metadata.
*/
public void initMetaData() {
EiColumn eiColumn;
eiColumn = new EiColumn(FIELD_ID);
eiColumn.setPrimaryKey(true);
eiColumn.setDescName(" ");
eiMetadata.addMeta(eiColumn);
eiColumn = new EiColumn(FIELD_COMPANY_CODE);
eiColumn.setDescName("企业编码");
eiMetadata.addMeta(eiColumn);
eiColumn = new EiColumn(FIELD_DEP_CODE);
eiColumn.setDescName("部门编码");
eiMetadata.addMeta(eiColumn);
eiColumn = new EiColumn(FIELD_CREATED_BY);
eiColumn.setDescName("创建人");
eiMetadata.addMeta(eiColumn);
eiColumn = new EiColumn(FIELD_CREATED_NAME);
eiColumn.setDescName("创建人名称");
eiMetadata.addMeta(eiColumn);
eiColumn = new EiColumn(FIELD_CREATED_TIME);
eiColumn.setDescName("创建时间");
eiMetadata.addMeta(eiColumn);
eiColumn = new EiColumn(FIELD_UPDATED_BY);
eiColumn.setDescName("更新人");
eiMetadata.addMeta(eiColumn);
eiColumn = new EiColumn(FIELD_UPDATED_NAME);
eiColumn.setDescName("更新人名称");
eiMetadata.addMeta(eiColumn);
eiColumn = new EiColumn(FIELD_UPDATED_TIME);
eiColumn.setDescName("更新时间");
eiMetadata.addMeta(eiColumn);
eiColumn = new EiColumn(FIELD_DELETE_FLAG);
eiColumn.setDescName("0.否1.是");
eiMetadata.addMeta(eiColumn);
eiColumn = new EiColumn(FIELD_WH_CODE);
eiColumn.setDescName("仓库编码");
eiMetadata.addMeta(eiColumn);
eiColumn = new EiColumn(FIELD_WH_NAME);
eiColumn.setDescName("仓库名称");
eiMetadata.addMeta(eiColumn);
eiColumn = new EiColumn(FIELD_INVENT_TYPE);
eiColumn.setDescName("物料类型");
eiMetadata.addMeta(eiColumn);
eiColumn = new EiColumn(FIELD_INVENT_CODE);
eiColumn.setDescName("物料编码");
eiMetadata.addMeta(eiColumn);
eiColumn = new EiColumn(FIELD_INVENT_NAME);
eiColumn.setDescName("物料名称");
eiMetadata.addMeta(eiColumn);
eiColumn = new EiColumn(FIELD_INVENT_RECORD_ID);
eiColumn.setDescName("存货档案ID");
eiMetadata.addMeta(eiColumn);
eiColumn = new EiColumn(FIELD_WARN_NUM);
eiColumn.setType("N");
eiColumn.setScaleLength(0);
eiColumn.setFieldLength(12);
eiColumn.setDescName("预警数量");
eiMetadata.addMeta(eiColumn);
eiColumn = new EiColumn(FIELD_REMARK);
eiColumn.setDescName("备注");
eiMetadata.addMeta(eiColumn);
}
/**
* the constructor.
*/
public HPPZ012() {
initMetaData();
}
/**
* get the id .
* @return the id
*/
public Long getId() {
return this.id;
}
/**
* set the id .
*
* @param id
*/
public void setId(Long id) {
this.id = id;
}
/**
* get the companyCode - 企业编码.
* @return the companyCode
*/
public String getCompanyCode() {
return this.companyCode;
}
/**
* set the companyCode - 企业编码.
*
* @param companyCode - 企业编码
*/
public void setCompanyCode(String companyCode) {
this.companyCode = companyCode;
}
/**
* get the depCode - 部门编码.
* @return the depCode
*/
public String getDepCode() {
return this.depCode;
}
/**
* set the depCode - 部门编码.
*
* @param depCode - 部门编码
*/
public void setDepCode(String depCode) {
this.depCode = depCode;
}
/**
* get the createdBy - 创建人.
* @return the createdBy
*/
public String getCreatedBy() {
return this.createdBy;
}
/**
* set the createdBy - 创建人.
*
* @param createdBy - 创建人
*/
public void setCreatedBy(String createdBy) {
this.createdBy = createdBy;
}
/**
* get the createdName - 创建人名称.
* @return the createdName
*/
public String getCreatedName() {
return this.createdName;
}
/**
* set the createdName - 创建人名称.
*
* @param createdName - 创建人名称
*/
public void setCreatedName(String createdName) {
this.createdName = createdName;
}
/**
* get the createdTime - 创建时间.
* @return the createdTime
*/
public String getCreatedTime() {
return this.createdTime;
}
/**
* set the createdTime - 创建时间.
*
* @param createdTime - 创建时间
*/
public void setCreatedTime(String createdTime) {
this.createdTime = createdTime;
}
/**
* get the updatedBy - 更新人.
* @return the updatedBy
*/
public String getUpdatedBy() {
return this.updatedBy;
}
/**
* set the updatedBy - 更新人.
*
* @param updatedBy - 更新人
*/
public void setUpdatedBy(String updatedBy) {
this.updatedBy = updatedBy;
}
/**
* get the updatedName - 更新人名称.
* @return the updatedName
*/
public String getUpdatedName() {
return this.updatedName;
}
/**
* set the updatedName - 更新人名称.
*
* @param updatedName - 更新人名称
*/
public void setUpdatedName(String updatedName) {
this.updatedName = updatedName;
}
/**
* get the updatedTime - 更新时间.
* @return the updatedTime
*/
public String getUpdatedTime() {
return this.updatedTime;
}
/**
* set the updatedTime - 更新时间.
*
* @param updatedTime - 更新时间
*/
public void setUpdatedTime(String updatedTime) {
this.updatedTime = updatedTime;
}
/**
* get the deleteFlag - 0.否1.是.
* @return the deleteFlag
*/
public Integer getDeleteFlag() {
return this.deleteFlag;
}
/**
* set the deleteFlag - 0.否1.是.
*
* @param deleteFlag - 0.否1.是
*/
public void setDeleteFlag(Integer deleteFlag) {
this.deleteFlag = deleteFlag;
}
/**
* get the whCode - 仓库编码.
* @return the whCode
*/
public String getWhCode() {
return this.whCode;
}
/**
* set the whCode - 仓库编码.
*
* @param whCode - 仓库编码
*/
public void setWhCode(String whCode) {
this.whCode = whCode;
}
/**
* get the whName - 仓库名称.
* @return the whName
*/
public String getWhName() {
return this.whName;
}
/**
* set the whName - 仓库名称.
*
* @param whName - 仓库名称
*/
public void setWhName(String whName) {
this.whName = whName;
}
/**
* get the inventType - 物料类型.
* @return the inventType
*/
public String getInventType() {
return this.inventType;
}
/**
* set the inventType - 物料类型.
*
* @param inventType - 物料类型
*/
public void setInventType(String inventType) {
this.inventType = inventType;
}
/**
* get the inventCode - 物料编码.
* @return the inventCode
*/
public String getInventCode() {
return this.inventCode;
}
/**
* set the inventCode - 物料编码.
*
* @param inventCode - 物料编码
*/
public void setInventCode(String inventCode) {
this.inventCode = inventCode;
}
/**
* get the inventName - 物料名称.
* @return the inventName
*/
public String getInventName() {
return this.inventName;
}
/**
* set the inventName - 物料名称.
*
* @param inventName - 物料名称
*/
public void setInventName(String inventName) {
this.inventName = inventName;
}
/**
* get the inventRecordId - 存货档案ID.
* @return the inventRecordId
*/
public Long getInventRecordId() {
return this.inventRecordId;
}
/**
* set the inventRecordId - 存货档案ID.
*
* @param inventRecordId - 存货档案ID
*/
public void setInventRecordId(Long inventRecordId) {
this.inventRecordId = inventRecordId;
}
/**
* get the warnNum - 预警数量.
* @return the warnNum
*/
public BigDecimal getWarnNum() {
return this.warnNum;
}
/**
* set the warnNum - 预警数量.
*
* @param warnNum - 预警数量
*/
public void setWarnNum(BigDecimal warnNum) {
this.warnNum = warnNum;
}
/**
* get the remark - 备注.
* @return the remark
*/
public String getRemark() {
return this.remark;
}
/**
* set the remark - 备注.
*
* @param remark - 备注
*/
public void setRemark(String remark) {
this.remark = remark;
}
/**
* get the value from Map.
*
* @param map - source data map
*/
@Override
public void fromMap(Map map) {
setId(NumberUtils.toLong(StringUtils.toString(map.get(FIELD_ID)), id));
setCompanyCode(StringUtils.defaultIfEmpty(StringUtils.toString(map.get(FIELD_COMPANY_CODE)), companyCode));
setDepCode(StringUtils.defaultIfEmpty(StringUtils.toString(map.get(FIELD_DEP_CODE)), depCode));
setCreatedBy(StringUtils.defaultIfEmpty(StringUtils.toString(map.get(FIELD_CREATED_BY)), createdBy));
setCreatedName(StringUtils.defaultIfEmpty(StringUtils.toString(map.get(FIELD_CREATED_NAME)), createdName));
setCreatedTime(StringUtils.defaultIfEmpty(StringUtils.toString(map.get(FIELD_CREATED_TIME)), createdTime));
setUpdatedBy(StringUtils.defaultIfEmpty(StringUtils.toString(map.get(FIELD_UPDATED_BY)), updatedBy));
setUpdatedName(StringUtils.defaultIfEmpty(StringUtils.toString(map.get(FIELD_UPDATED_NAME)), updatedName));
setUpdatedTime(StringUtils.defaultIfEmpty(StringUtils.toString(map.get(FIELD_UPDATED_TIME)), updatedTime));
setDeleteFlag(NumberUtils.toInteger(StringUtils.toString(map.get(FIELD_DELETE_FLAG)), deleteFlag));
setWhCode(StringUtils.defaultIfEmpty(StringUtils.toString(map.get(FIELD_WH_CODE)), whCode));
setWhName(StringUtils.defaultIfEmpty(StringUtils.toString(map.get(FIELD_WH_NAME)), whName));
setInventType(StringUtils.defaultIfEmpty(StringUtils.toString(map.get(FIELD_INVENT_TYPE)), inventType));
setInventCode(StringUtils.defaultIfEmpty(StringUtils.toString(map.get(FIELD_INVENT_CODE)), inventCode));
setInventName(StringUtils.defaultIfEmpty(StringUtils.toString(map.get(FIELD_INVENT_NAME)), inventName));
setInventRecordId(NumberUtils.toLong(StringUtils.toString(map.get(FIELD_INVENT_RECORD_ID)), inventRecordId));
setWarnNum(NumberUtils.toBigDecimal(StringUtils.toString(map.get(FIELD_WARN_NUM)), warnNum));
setRemark(StringUtils.defaultIfEmpty(StringUtils.toString(map.get(FIELD_REMARK)), remark));
}
/**
* 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_CREATED_BY, StringUtils.toString(createdBy, eiMetadata.getMeta(FIELD_CREATED_BY)));
map.put(FIELD_CREATED_NAME, StringUtils.toString(createdName, eiMetadata.getMeta(FIELD_CREATED_NAME)));
map.put(FIELD_CREATED_TIME, StringUtils.toString(createdTime, eiMetadata.getMeta(FIELD_CREATED_TIME)));
map.put(FIELD_UPDATED_BY, StringUtils.toString(updatedBy, eiMetadata.getMeta(FIELD_UPDATED_BY)));
map.put(FIELD_UPDATED_NAME, StringUtils.toString(updatedName, eiMetadata.getMeta(FIELD_UPDATED_NAME)));
map.put(FIELD_UPDATED_TIME, StringUtils.toString(updatedTime, eiMetadata.getMeta(FIELD_UPDATED_TIME)));
map.put(FIELD_DELETE_FLAG, StringUtils.toString(deleteFlag, eiMetadata.getMeta(FIELD_DELETE_FLAG)));
map.put(FIELD_WH_CODE, StringUtils.toString(whCode, eiMetadata.getMeta(FIELD_WH_CODE)));
map.put(FIELD_WH_NAME, StringUtils.toString(whName, eiMetadata.getMeta(FIELD_WH_NAME)));
map.put(FIELD_INVENT_TYPE, StringUtils.toString(inventType, eiMetadata.getMeta(FIELD_INVENT_TYPE)));
map.put(FIELD_INVENT_CODE, StringUtils.toString(inventCode, eiMetadata.getMeta(FIELD_INVENT_CODE)));
map.put(FIELD_INVENT_NAME, StringUtils.toString(inventName, eiMetadata.getMeta(FIELD_INVENT_NAME)));
map.put(FIELD_INVENT_RECORD_ID, StringUtils.toString(inventRecordId, eiMetadata.getMeta(FIELD_INVENT_RECORD_ID)));
map.put(FIELD_WARN_NUM, StringUtils.toString(warnNum, eiMetadata.getMeta(FIELD_WARN_NUM)));
map.put(FIELD_REMARK, StringUtils.toString(remark, eiMetadata.getMeta(FIELD_REMARK)));
return map;
}
}
...@@ -6,13 +6,15 @@ import com.baosight.hpjx.common.InitiateModeEnum; ...@@ -6,13 +6,15 @@ import com.baosight.hpjx.common.InitiateModeEnum;
import com.baosight.hpjx.core.constant.CommonConstant; import com.baosight.hpjx.core.constant.CommonConstant;
import com.baosight.hpjx.core.dao.DaoUtils; import com.baosight.hpjx.core.dao.DaoUtils;
import com.baosight.hpjx.hp.constant.HPConstant; import com.baosight.hpjx.hp.constant.HPConstant;
import com.baosight.hpjx.hp.pz.domain.HPPZ004; import com.baosight.hpjx.hp.kc.domain.HPKC010;
import com.baosight.hpjx.hp.kc.tools.HPKCTools;
import com.baosight.hpjx.hp.pz.domain.HPPZ006; import com.baosight.hpjx.hp.pz.domain.HPPZ006;
import com.baosight.hpjx.hp.pz.tools.HPPZTools; import com.baosight.hpjx.hp.pz.tools.HPPZTools;
import com.baosight.hpjx.util.AssertUtils; import com.baosight.hpjx.util.AssertUtils;
import com.baosight.hpjx.util.CommonMethod; import com.baosight.hpjx.util.CommonMethod;
import com.baosight.hpjx.util.EiInfoUtils; import com.baosight.hpjx.util.EiInfoUtils;
import com.baosight.hpjx.util.LogUtils; import com.baosight.hpjx.util.LogUtils;
import com.baosight.hpjx.util.MapUtils;
import com.baosight.hpjx.util.ObjectUtils; import com.baosight.hpjx.util.ObjectUtils;
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;
...@@ -23,7 +25,11 @@ import org.apache.commons.collections.CollectionUtils; ...@@ -23,7 +25,11 @@ import org.apache.commons.collections.CollectionUtils;
import org.apache.commons.lang.StringUtils; import org.apache.commons.lang.StringUtils;
import java.math.BigDecimal; import java.math.BigDecimal;
import java.util.*; import java.util.ArrayList;
import java.util.Arrays;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
/** /**
* @author:songx * @author:songx
...@@ -128,12 +134,15 @@ public class ServiceHPPZ006 extends ServiceBase { ...@@ -128,12 +134,15 @@ public class ServiceHPPZ006 extends ServiceBase {
public EiInfo update(EiInfo inInfo) { public EiInfo update(EiInfo inInfo) {
try { try {
List<Map> resultRows = inInfo.getBlock(EiConstant.resultBlock).getRows(); List<Map> resultRows = inInfo.getBlock(EiConstant.resultBlock).getRows();
// 数据校验
this.checkUpdateData(resultRows);
// 写入数据
for (int i = 0; i < resultRows.size(); i++) { for (int i = 0; i < resultRows.size(); i++) {
HPPZ006 fPz006 = new HPPZ006(); HPPZ006 fPz006 = new HPPZ006();
fPz006.fromMap(resultRows.get(i)); fPz006.fromMap(resultRows.get(i));
// 存货名称 // 存货名称
fPz006.setInventName(HPPZTools.HpPz004.getByCode(fPz006.getInventCode()).getInventName()); fPz006.setInventName(HPPZTools.HpPz004.getByCode(fPz006.getInventCode()).getInventName());
fPz006.setSpec(HPPZTools.jointSpec(fPz006.getLength(),fPz006.getWidth(),fPz006.getThick())); fPz006.setSpec(HPPZTools.jointSpec(fPz006.getLength(), fPz006.getWidth(), fPz006.getThick()));
DaoUtils.update(HPPZ006.UPDATE, fPz006); DaoUtils.update(HPPZ006.UPDATE, fPz006);
} }
inInfo = this.query(inInfo); inInfo = this.query(inInfo);
...@@ -146,12 +155,27 @@ public class ServiceHPPZ006 extends ServiceBase { ...@@ -146,12 +155,27 @@ public class ServiceHPPZ006 extends ServiceBase {
} }
/** /**
* 修改数据校验
*
* @param resultRows
*/
private void checkUpdateData(List<Map> resultRows) {
for (Map resultRow : resultRows) {
HPPZ006 fPz006 = new HPPZ006();
fPz006.fromMap(resultRow);
// 校验是否存在库存
List<HPKC010> dbKc010s = HPKCTools.HpKc010.listBySpec(fPz006.getId());
AssertUtils.isEmpty(dbKc010s, String.format("档案[%s]已存在库存数量,不能进行修改", fPz006.getId()));
}
}
/**
* 删除操作 * 删除操作
* *
* @param inInfo * @param inInfo
* @return * @return
*/ */
@OperationLogAnnotation(operModul = "存货档案",operType = "删除",operDesc = "删除") @OperationLogAnnotation(operModul = "存货档案", operType = "删除", operDesc = "删除")
public EiInfo delete(EiInfo inInfo) { public EiInfo delete(EiInfo inInfo) {
try { try {
List<Map> resultRows = inInfo.getBlock(EiConstant.resultBlock).getRows(); List<Map> resultRows = inInfo.getBlock(EiConstant.resultBlock).getRows();
...@@ -235,17 +259,19 @@ public class ServiceHPPZ006 extends ServiceBase { ...@@ -235,17 +259,19 @@ public class ServiceHPPZ006 extends ServiceBase {
*/ */
@OperationLogAnnotation(operModul = "存货档案",operType = "查询",operDesc = "存货名称下拉框") @OperationLogAnnotation(operModul = "存货档案",operType = "查询",operDesc = "存货名称下拉框")
public EiInfo queryMaterialComboBox(EiInfo eiInfo) { public EiInfo queryMaterialComboBox(EiInfo eiInfo) {
Map map = EiInfoUtils.getFirstRow(eiInfo); Map queryRow = EiInfoUtils.getFirstRow(eiInfo);
if (ObjectUtils.isEmpty(map.get("inventType"))) { if (ObjectUtils.isEmpty(queryRow.get("inventType"))) {
map.put("inventType", eiInfo.getString("inventType")); queryRow.put("inventType", eiInfo.getString("inventType"));
} }
boolean isSplicingSymbol = true; boolean isSplicingSymbol = true;
if (eiInfo.getString("isSplicingSymbol") != null) { if (eiInfo.getString("isSplicingSymbol") != null) {
isSplicingSymbol = Boolean.parseBoolean(eiInfo.getString("isSplicingSymbol")); isSplicingSymbol = Boolean.parseBoolean(eiInfo.getString("isSplicingSymbol"));
} else if (queryRow.get("isSplicingSymbol") != null) {
isSplicingSymbol = MapUtils.getBoolean(queryRow, "isSplicingSymbol");
} }
List<DdynamicEnum> list = new ArrayList<>(); List<DdynamicEnum> list = new ArrayList<>();
list.add(DdynamicEnum.MATERIAL_RECORD_BLOCK_ID); list.add(DdynamicEnum.MATERIAL_RECORD_BLOCK_ID);
CommonMethod.initBlock(eiInfo, list, map,isSplicingSymbol); CommonMethod.initBlock(eiInfo, list, queryRow, isSplicingSymbol);
return eiInfo; return eiInfo;
} }
......
...@@ -8,6 +8,7 @@ import com.baosight.hpjx.hp.pz.domain.HPPZ007; ...@@ -8,6 +8,7 @@ import com.baosight.hpjx.hp.pz.domain.HPPZ007;
import com.baosight.hpjx.util.CommonMethod; import com.baosight.hpjx.util.CommonMethod;
import com.baosight.hpjx.util.EiInfoUtils; import com.baosight.hpjx.util.EiInfoUtils;
import com.baosight.hpjx.util.LogUtils; import com.baosight.hpjx.util.LogUtils;
import com.baosight.hpjx.util.MapUtils;
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;
...@@ -154,13 +155,16 @@ public class ServiceHPPZ007 extends ServiceBase { ...@@ -154,13 +155,16 @@ public class ServiceHPPZ007 extends ServiceBase {
*/ */
@OperationLogAnnotation(operModul = "仓库档案",operType = "查询",operDesc = "下拉框") @OperationLogAnnotation(operModul = "仓库档案",operType = "查询",operDesc = "下拉框")
public EiInfo queryComboBox(EiInfo inInfo) { public EiInfo queryComboBox(EiInfo inInfo) {
Map queryRow = EiInfoUtils.getFirstRow(inInfo);
List<DdynamicEnum> list = new ArrayList<>(); List<DdynamicEnum> list = new ArrayList<>();
list.add(DdynamicEnum.WH_RECORD_BLOCK_ID); list.add(DdynamicEnum.WH_RECORD_BLOCK_ID);
boolean isSplicingSymbol = true; boolean isSplicingSymbol = true;
if (inInfo.getString("isSplicingSymbol") != null) { if (inInfo.getString("isSplicingSymbol") != null) {
isSplicingSymbol = Boolean.parseBoolean(inInfo.getString("isSplicingSymbol")); isSplicingSymbol = Boolean.parseBoolean(inInfo.getString("isSplicingSymbol"));
} else if (queryRow.get("isSplicingSymbol") != null) {
isSplicingSymbol = MapUtils.getBoolean(queryRow, "isSplicingSymbol");
} }
CommonMethod.initBlock(inInfo, list, EiInfoUtils.getFirstRow(inInfo),isSplicingSymbol); CommonMethod.initBlock(inInfo, list, EiInfoUtils.getFirstRow(inInfo), isSplicingSymbol);
return inInfo; return inInfo;
} }
......
package com.baosight.hpjx.hp.pz.service;
import com.baosight.hpjx.aspect.annotation.OperationLogAnnotation;
import com.baosight.hpjx.common.DdynamicEnum;
import com.baosight.hpjx.common.InventTypeEnum;
import com.baosight.hpjx.core.constant.CommonConstant;
import com.baosight.hpjx.core.dao.DaoUtils;
import com.baosight.hpjx.hp.pz.domain.HPPZ012;
import com.baosight.hpjx.hp.pz.tools.HPPZTools;
import com.baosight.hpjx.util.AssertUtils;
import com.baosight.hpjx.util.CommonMethod;
import com.baosight.hpjx.util.LogUtils;
import com.baosight.iplat4j.core.ei.EiConstant;
import com.baosight.iplat4j.core.ei.EiInfo;
import com.baosight.iplat4j.core.exception.PlatException;
import com.baosight.iplat4j.core.service.impl.ServiceBase;
import java.util.Arrays;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
/**
* 库存预警值管理
*
* @author:songx
* @date:2024/1/18,17:15
*/
public class ServiceHPPZ012 extends ServiceBase {
// 指定存货类型
private static final Integer[] DEFAULT_INVENT_CODE = {InventTypeEnum.RAW.getCode(),
InventTypeEnum.CONSUMABLE.getCode()};
/**
* 画面初始化
*
* @param inInfo
* @return
*/
@Override
@OperationLogAnnotation(operModul = "库存预警管理", operType = "查询", operDesc = "初始化")
public EiInfo initLoad(EiInfo inInfo) {
try {
Map queryMap = new HashMap();
queryMap.put("inventTypes", DEFAULT_INVENT_CODE);
CommonMethod.initBlock(inInfo, Arrays.asList(DdynamicEnum.WH_RECORD_BLOCK_ID), queryMap, false);
CommonMethod.initBlock(inInfo, Arrays.asList(DdynamicEnum.INVENT_NAME_BLOCK_ID), queryMap, false);
CommonMethod.initBlock(inInfo, Arrays.asList(DdynamicEnum.SPEC_NAME_BLOCK_ID), queryMap, false);
CommonMethod.initBlock(inInfo, Arrays.asList(DdynamicEnum.INVENT_ALL_BLOCK_ID), queryMap, false);
inInfo.addBlock(EiConstant.resultBlock).addBlockMeta(new HPPZ012().eiMetadata);
} catch (PlatException e) {
LogUtils.setDetailMsg(inInfo, e, "初始化失败");
}
return inInfo;
}
/**
* 查询数据列表
*
* @param inInfo
* @return
*/
@Override
@OperationLogAnnotation(operModul = "库存预警管理", operType = "查询", operDesc = "查询")
public EiInfo query(EiInfo inInfo) {
try {
inInfo = super.query(inInfo, HPPZ012.QUERY, new HPPZ012());
} catch (Exception e) {
LogUtils.setDetailMsg(inInfo, e, "查询失败");
}
return inInfo;
}
/**
* 保存操作.
*
* @param inInfo
* @return
*/
@OperationLogAnnotation(operModul = "库存预警管理", operType = "新增", operDesc = "保存操作")
public EiInfo save(EiInfo inInfo) {
try {
List<Map> resultRows = inInfo.getBlock(EiConstant.resultBlock).getRows();
// 数据校验
this.checkSaveData(resultRows);
// 写入数据
this.saveData(resultRows);
inInfo = this.query(inInfo);
inInfo.setStatus(EiConstant.STATUS_DEFAULT);
inInfo.setMsg("操作成功!本次对[" + resultRows.size() + "]条数据保存成功!");
} catch (Exception e) {
LogUtils.setDetailMsg(inInfo, e, "保存失败");
}
return inInfo;
}
/**
* 校验保存的数据
*
* @param resultRows
*/
private void checkSaveData(List<Map> resultRows) {
// 数据校验
for (int i = 0; i < resultRows.size(); i++) {
HPPZ012 fPz012 = new HPPZ012();
fPz012.fromMap(resultRows.get(i));
AssertUtils.isNull(fPz012.getWhCode(), "请选择仓库");
AssertUtils.isEmpty(fPz012.getInventCode(), "请选择存货");
AssertUtils.isNull(fPz012.getInventRecordId(), "请选择规格");
AssertUtils.isNull(fPz012.getWarnNum(), "预警数量不能为空");
}
}
/**
* 保存数据
*
* @param resultRows
*/
private void saveData(List<Map> resultRows) {
for (Map resultRow : resultRows) {
HPPZ012 fPz012 = new HPPZ012();
fPz012.fromMap(resultRow);
// 设置基础信息
this.setBaseInfo(fPz012);
if (fPz012.getId() == null || fPz012.getId() == 0) {
this.add(fPz012);
} else {
this.modify(fPz012);
}
}
}
/**
* 设置基础信息
*
* @param fPz012
*/
private void setBaseInfo(HPPZ012 fPz012) {
// 仓库名称
fPz012.setWhName(HPPZTools.HpPz007.getByCode(fPz012.getWhCode()).getWhName());
// 存货名称
fPz012.setInventName(HPPZTools.HpPz004.getByCode(fPz012.getInventCode()).getInventName());
}
/**
* 新增企业信息
*
* @param fPz012
*/
private void add(HPPZ012 fPz012) {
fPz012.setDeleteFlag(CommonConstant.YesNo.NO_0);
DaoUtils.insert(HPPZ012.INSERT, fPz012);
}
/**
* 修改数据
*
* @param fPz012
*/
private void modify(HPPZ012 fPz012) {
DaoUtils.update(HPPZ012.UPDATE, fPz012);
}
/**
* 删除操作
*
* @param inInfo
* @return
*/
@OperationLogAnnotation(operModul = "库存预警管理", operType = "删除", operDesc = "删除操作")
public EiInfo delete(EiInfo inInfo) {
try {
List<Map> resultRows = inInfo.getBlock(EiConstant.resultBlock).getRows();
for (Map resultRow : resultRows) {
HPPZ012 fPz012 = new HPPZ012();
fPz012.fromMap(resultRow);
fPz012.setDeleteFlag(CommonConstant.YesNo.YES_1);
DaoUtils.update(HPPZ012.DELETE, fPz012);
}
inInfo = this.query(inInfo);
inInfo.setStatus(EiConstant.STATUS_DEFAULT);
inInfo.setMsg("操作成功!本次对[" + resultRows.size() + "]条数据删除成功!");
} catch (Exception e) {
LogUtils.setDetailMsg(inInfo, e, "修改失败");
}
return inInfo;
}
}
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE sqlMap PUBLIC "-//iBATIS.com//DTD SQL Map 2.0//EN" "http://www.ibatis.com/dtd/sql-map-2.dtd">
<sqlMap namespace="HPPZ012">
<sql id="column">
ID as "id",
COMPANY_CODE as "companyCode", <!-- 企业编码 -->
DEP_CODE as "depCode", <!-- 部门编码 -->
CREATED_BY as "createdBy", <!-- 创建人 -->
CREATED_NAME as "createdName", <!-- 创建人名称 -->
CREATED_TIME as "createdTime", <!-- 创建时间 -->
UPDATED_BY as "updatedBy", <!-- 更新人 -->
UPDATED_NAME as "updatedName", <!-- 更新人名称 -->
UPDATED_TIME as "updatedTime", <!-- 更新时间 -->
DELETE_FLAG as "deleteFlag", <!-- 0.否1.是 -->
WH_CODE as "whCode", <!-- 仓库编码 -->
WH_NAME as "whName", <!-- 仓库名称 -->
INVENT_TYPE as "inventType", <!-- 物料类型 -->
INVENT_CODE as "inventCode", <!-- 物料编码 -->
INVENT_NAME as "inventName", <!-- 物料名称 -->
INVENT_RECORD_ID as "inventRecordId", <!-- 存货档案ID -->
WARN_NUM as "warnNum", <!-- 预警数量 -->
REMARK as "remark" <!-- 备注 -->
</sql>
<sql id="condition">
AND DELETE_FLAG = '0'
<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="createdBy">
CREATED_BY = #createdBy#
</isNotEmpty>
<isNotEmpty prepend=" AND " property="createdName">
CREATED_NAME = #createdName#
</isNotEmpty>
<isNotEmpty prepend=" AND " property="createdTime">
CREATED_TIME = #createdTime#
</isNotEmpty>
<isNotEmpty prepend=" AND " property="updatedBy">
UPDATED_BY = #updatedBy#
</isNotEmpty>
<isNotEmpty prepend=" AND " property="updatedName">
UPDATED_NAME = #updatedName#
</isNotEmpty>
<isNotEmpty prepend=" AND " property="updatedTime">
UPDATED_TIME = #updatedTime#
</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>
<isNotEmpty prepend=" AND " property="inventRecordId">
INVENT_RECORD_ID = #inventRecordId#
</isNotEmpty>
<isNotEmpty prepend=" AND " property="warnNum">
WARN_NUM = #warnNum#
</isNotEmpty>
</sql>
<sql id="customCondition">
<isNotEmpty prepend=" AND " property="spec">
<isEqual property="spec" compareValue="无规格">
INVENT_RECORD_ID IN (SELECT ID FROM ${hpjxSchema}.T_HPPZ006 WHERE SPEC = '')
</isEqual>
<isNotEqual property="spec" compareValue="无规格">
INVENT_RECORD_ID IN (SELECT ID FROM ${hpjxSchema}.T_HPPZ006 WHERE SPEC = #spec#)
</isNotEqual>
</isNotEmpty>
</sql>
<sql id="order">
<dynamic prepend="ORDER BY">
<isNotEmpty property="order">
$order$
</isNotEmpty>
<isEmpty property="order">
ID DESC
</isEmpty>
</dynamic>
</sql>
<select id="query" parameterClass="java.util.HashMap" resultClass="com.baosight.hpjx.hp.pz.domain.HPPZ012">
SELECT
<include refid="column"/>
FROM ${hpjxSchema}.T_HPPZ012
WHERE 1=1
<include refid="condition"/>
<include refid="customCondition"/>
<include refid="order"/>
</select>
<select id="count" resultClass="int">
SELECT COUNT(*) FROM ${hpjxSchema}.T_HPPZ012
WHERE 1=1
<include refid="condition"/>
<include refid="customCondition"/>
</select>
<insert id="insert">
INSERT INTO ${hpjxSchema}.T_HPPZ012 (
COMPANY_CODE, <!-- 企业编码 -->
DEP_CODE, <!-- 部门编码 -->
CREATED_BY, <!-- 创建人 -->
CREATED_NAME, <!-- 创建人名称 -->
CREATED_TIME, <!-- 创建时间 -->
DELETE_FLAG,
WH_CODE, <!-- 仓库编码 -->
WH_NAME, <!-- 仓库名称 -->
INVENT_TYPE, <!-- 物料类型 -->
INVENT_CODE, <!-- 物料编码 -->
INVENT_NAME, <!-- 物料名称 -->
INVENT_RECORD_ID, <!-- 存货档案ID -->
WARN_NUM, <!-- 预警数量 -->
REMARK
) VALUES (
#companyCode#, #depCode#, #createdBy#, #createdName#, #createdTime#, #deleteFlag#,
#whCode#, #whName#, #inventType#, #inventCode#, #inventName#, #inventRecordId#,
#warnNum#, #remark#
)
</insert>
<!-- 逻辑删除 -->
<delete id="delete">
UPDATE FROM ${hpjxSchema}.T_HPPZ012 SET DELETE_FLAG = #deleteFlag# WHERE ID = #id#
</delete>
<update id="update">
UPDATE ${hpjxSchema}.T_HPPZ012
SET
UPDATED_BY = #updatedBy#, <!-- 更新人 -->
UPDATED_NAME = #updatedName#, <!-- 更新人名称 -->
UPDATED_TIME = #updatedTime#, <!-- 更新时间 -->
WH_CODE = #whCode#, <!-- 仓库编码 -->
WH_NAME = #whName#, <!-- 仓库名称 -->
INVENT_TYPE = #inventType#, <!-- 物料类型 -->
INVENT_CODE = #inventCode#, <!-- 物料编码 -->
INVENT_NAME = #inventName#, <!-- 物料名称 -->
INVENT_RECORD_ID = #inventRecordId#, <!-- 存货档案ID -->
WARN_NUM = #warnNum# <!-- 预警数量 -->
WHERE ID = #id#
</update>
</sqlMap>
...@@ -4,7 +4,6 @@ import com.baosight.hpjx.common.InventTypeEnum; ...@@ -4,7 +4,6 @@ import com.baosight.hpjx.common.InventTypeEnum;
import com.baosight.hpjx.core.constant.CommonConstant; import com.baosight.hpjx.core.constant.CommonConstant;
import com.baosight.hpjx.core.dao.DaoBase; import com.baosight.hpjx.core.dao.DaoBase;
import com.baosight.hpjx.hp.constant.HPSqlConstant; import com.baosight.hpjx.hp.constant.HPSqlConstant;
import com.baosight.hpjx.hp.kc.domain.HPKC006;
import com.baosight.hpjx.hp.pz.domain.HPPZ004; import com.baosight.hpjx.hp.pz.domain.HPPZ004;
import com.baosight.hpjx.hp.pz.domain.HPPZ006; import com.baosight.hpjx.hp.pz.domain.HPPZ006;
import com.baosight.hpjx.hp.pz.domain.HPPZ007; import com.baosight.hpjx.hp.pz.domain.HPPZ007;
...@@ -19,6 +18,7 @@ import org.apache.commons.lang.StringUtils; ...@@ -19,6 +18,7 @@ import org.apache.commons.lang.StringUtils;
import org.springframework.util.CollectionUtils; import org.springframework.util.CollectionUtils;
import java.math.BigDecimal; import java.math.BigDecimal;
import java.math.RoundingMode;
import java.util.HashMap; import java.util.HashMap;
import java.util.List; import java.util.List;
import java.util.Map; import java.util.Map;
...@@ -137,6 +137,59 @@ public class HPPZTools { ...@@ -137,6 +137,59 @@ public class HPPZTools {
} }
/** /**
* HPPZ006 公共DAO定义
*
* @author:songx
* @date:2024/2/6,13:37
*/
public static class HpPz006 {
/**
* 查询
*
* @param id
* @return
*/
public static HPPZ006 get(Long id) {
AssertUtils.isNull(id, "仓库编码不能为空");
Map queryMap = new HashMap();
queryMap.put("id", id);
List<HPPZ006> results = DaoBase.getInstance().query(HPPZ006.QUERY, queryMap);
AssertUtils.isNull(results, String.format("规格[%s]不存在", id));
return results.get(0);
}
/**
* 计算单重
*
* @param id
* @return
*/
public static BigDecimal calcUnitWeight(Long id) {
HPPZ006 dbPz006 = get(id);
if ((dbPz006.getLength() == null && dbPz006.getWidth() == null && dbPz006.getThick() == null)
|| dbPz006.getCoefficient() == null) {
return BigDecimal.ZERO;
}
BigDecimal unitWeight = BigDecimal.ONE;
// 长
if (dbPz006.getLength() != null) {
unitWeight = unitWeight.multiply(dbPz006.getLength());
}
// 宽
if (dbPz006.getWidth() != null) {
unitWeight = unitWeight.multiply(dbPz006.getWidth());
}
// 厚
if (dbPz006.getThick() != null) {
unitWeight = unitWeight.multiply(dbPz006.getThick());
}
// 乘以系数
return unitWeight.multiply(dbPz006.getCoefficient()).setScale(3, RoundingMode.HALF_UP);
}
}
/**
* HPPZ007 公共DAO定义 * HPPZ007 公共DAO定义
* *
* @author:songx * @author:songx
......
...@@ -6,7 +6,7 @@ $(function() { ...@@ -6,7 +6,7 @@ $(function() {
IPLATUI.EFGrid = { IPLATUI.EFGrid = {
pageable: { pageable: {
pageSize: 20, pageSize: 20,
pageSizes: [10, 20, 50, 70, 100], pageSizes: [20, 50, 70, 100],
}, },
"result": { "result": {
columns: [{ columns: [{
...@@ -28,6 +28,7 @@ $(function() { ...@@ -28,6 +28,7 @@ $(function() {
let inInfo = new EiInfo(); let inInfo = new EiInfo();
inInfo.set("inqu_status-0-inventTypes", [1, 2]); inInfo.set("inqu_status-0-inventTypes", [1, 2]);
inInfo.set("inqu_status-0-whType", options.model["inventType"]); inInfo.set("inqu_status-0-whType", options.model["inventType"]);
inInfo.set("inqu_status-0-isSplicingSymbol", false);
inInfo.set("serviceName", "HPPZ007"); inInfo.set("serviceName", "HPPZ007");
inInfo.set("methodName", "queryComboBox"); inInfo.set("methodName", "queryComboBox");
inInfo.set("blockId", "wh_record_block_id"); inInfo.set("blockId", "wh_record_block_id");
...@@ -48,6 +49,7 @@ $(function() { ...@@ -48,6 +49,7 @@ $(function() {
let inInfo = new EiInfo(); let inInfo = new EiInfo();
inInfo.set("inqu_status-0-inventTypes", [1, 2]); inInfo.set("inqu_status-0-inventTypes", [1, 2]);
inInfo.set("inqu_status-0-inventType", options.model["inventType"]); inInfo.set("inqu_status-0-inventType", options.model["inventType"]);
inInfo.set("inqu_status-0-isSplicingSymbol", false);
inInfo.set("serviceName", "HPPZ006"); inInfo.set("serviceName", "HPPZ006");
inInfo.set("methodName", "queryMaterialComboBox"); inInfo.set("methodName", "queryMaterialComboBox");
inInfo.set("blockId", "material_record_block_id"); inInfo.set("blockId", "material_record_block_id");
...@@ -126,8 +128,22 @@ $(function() { ...@@ -126,8 +128,22 @@ $(function() {
*/ */
$(window).load(function () { $(window).load(function () {
// 仓库名称 // 仓库名称
initWh()
// 存货名称
initInvent()
// 规格
initSpec()
// 查询
query();
});
/**
* 初始化仓库
*/
let initWh = function () {
let inInfo = new EiInfo(); let inInfo = new EiInfo();
inInfo.set("inqu_status-0-inventTypes", [1, 2]); inInfo.set("inqu_status-0-inventTypes", [1, 2]);
inInfo.set("inqu_status-0-isSplicingSymbol", false);
EiCommunicator.send("HPPZ007", "queryComboBox", inInfo, { EiCommunicator.send("HPPZ007", "queryComboBox", inInfo, {
onSuccess: function (ei) { onSuccess: function (ei) {
whNameGlobalData = ei.getBlock("wh_record_block_id").getMappedRows(); whNameGlobalData = ei.getBlock("wh_record_block_id").getMappedRows();
...@@ -135,7 +151,14 @@ $(window).load(function () { ...@@ -135,7 +151,14 @@ $(window).load(function () {
onFail: function (ei) { onFail: function (ei) {
} }
}, {async: false}); }, {async: false});
// 存货名称 }
/**
* 初始化存货
*/
let initInvent = function () {
let inInfo = new EiInfo();
inInfo.set("inqu_status-0-inventTypes", [1, 2]);
EiCommunicator.send("HPPZ004", "queryComboBox", inInfo, { EiCommunicator.send("HPPZ004", "queryComboBox", inInfo, {
onSuccess: function (ei) { onSuccess: function (ei) {
inventNameGlobalData = ei.getBlock("invent_name_block_id").getMappedRows(); inventNameGlobalData = ei.getBlock("invent_name_block_id").getMappedRows();
...@@ -143,7 +166,15 @@ $(window).load(function () { ...@@ -143,7 +166,15 @@ $(window).load(function () {
onFail: function (ei) { onFail: function (ei) {
} }
}, {async: false}); }, {async: false});
// 规格 }
/**
* 初始化规格
*/
let initSpec = function () {
let inInfo = new EiInfo();
inInfo.set("inqu_status-0-inventTypes", [1, 2]);
inInfo.set("inqu_status-0-isSplicingSymbol", false);
EiCommunicator.send("HPPZ006", "queryComboBoxAll", inInfo, { EiCommunicator.send("HPPZ006", "queryComboBoxAll", inInfo, {
onSuccess: function (ei) { onSuccess: function (ei) {
inventAllGlobalData = ei.getBlock("invent_all_block_id").getMappedRows(); inventAllGlobalData = ei.getBlock("invent_all_block_id").getMappedRows();
...@@ -151,9 +182,7 @@ $(window).load(function () { ...@@ -151,9 +182,7 @@ $(window).load(function () {
onFail: function (ei) { onFail: function (ei) {
} }
}, {async: false}); }, {async: false});
// 查询 }
query();
});
/** /**
* 查询 * 查询
...@@ -171,9 +200,16 @@ let save = function () { ...@@ -171,9 +200,16 @@ let save = function () {
message("请选择数据"); message("请选择数据");
return; return;
} }
for (let i = 0; i < rows.length; i++) {
let amount = rows[i]['amount'];
if (isBlank(amount) || !isNumber(amount) || !(amount > 0)) {
message("勾选的第" + (i + 1) + "行数量必须大于0");
return;
}
}
JSUtils.confirm("确定对勾选中的[" + rows.length + "]条数据做\"保存\"操作? ", { JSUtils.confirm("确定对勾选中的[" + rows.length + "]条数据做\"保存\"操作? ", {
ok: function () { ok: function () {
JSUtils.submitGridsData("result", "HPKC006", "save", true); JSUtils.submitGridsData("result", "HPKC001", "save", true);
} }
}); });
} }
......
...@@ -14,7 +14,7 @@ ...@@ -14,7 +14,7 @@
<EF:EFInput cname="采购单号" ename="inqu_status-0-chpurchaseNoeckNo" colWidth="3"/> <EF:EFInput cname="采购单号" ename="inqu_status-0-chpurchaseNoeckNo" colWidth="3"/>
<EF:EFSelect cname="存货类型" ename="inqu_status-0-inventType" colWidth="3" filter="contains"> <EF:EFSelect cname="存货类型" ename="inqu_status-0-inventType" colWidth="3" filter="contains">
<EF:EFOption label="全部" value=""/> <EF:EFOption label="全部" value=""/>
<EF:EFCodeOption codeName="hpjx.hpkc.inventType"/> <EF:EFCodeOption codeName="hpjx.hpkc.inventType" condition="ITEM_CODE IN ('1', '2')"/>
</EF:EFSelect> </EF:EFSelect>
<EF:EFSelect cname="仓库名称" ename="inqu_status-0-whCode" colWidth="3" filter="contains" defultValue=""> <EF:EFSelect cname="仓库名称" ename="inqu_status-0-whCode" colWidth="3" filter="contains" defultValue="">
<EF:EFOption label="全部" value=""/> <EF:EFOption label="全部" value=""/>
...@@ -44,21 +44,24 @@ ...@@ -44,21 +44,24 @@
</EF:EFRegion> </EF:EFRegion>
<EF:EFRegion id="result" title="明细信息"> <EF:EFRegion id="result" title="明细信息">
<EF:EFGrid blockId="result" autoDraw="override" isFloat="true" checkMode="row"> <EF:EFGrid blockId="result" autoDraw="override" autoFit="true" isFloat="true" checkMode="row">
<EF:EFColumn ename="id" cname="内码" hidden="true"/> <EF:EFColumn ename="id" cname="内码" hidden="true"/>
<EF:EFColumn ename="purchaseNo" cname="采购单号" enable="false" width="140" align="center"/> <EF:EFColumn ename="purchaseNo" cname="采购单号" enable="false" width="140" align="center"/>
<EF:EFColumn ename="receiptDate" cname="单据日期" width="90" align="center" editType="date" <EF:EFColumn ename="receiptDate" cname="单据日期" width="90" align="center" editType="date"
dateFormat="yyyy-MM-dd" parseFormats="['yyyyMMdd']" required="true" readonly="true"/> dateFormat="yyyy-MM-dd" parseFormats="['yyyyMMdd']" required="true" readonly="true"/>
<EF:EFComboColumn ename="inventType" cname="存货类型" width="100" align="center" required="true" readonly="true"> <EF:EFComboColumn ename="inventType" cname="存货类型" width="100" align="center" required="true"
<EF:EFCodeOption codeName="hpjx.hpkc.inventType"/> readonly="true">
<EF:EFCodeOption codeName="hpjx.hpkc.inventType" condition="ITEM_CODE IN ('1', '2')"/>
</EF:EFComboColumn> </EF:EFComboColumn>
<EF:EFColumn ename="whCode" cname="仓库名称" width="120" align="center" required="true" readonly="true"/> <EF:EFColumn ename="whCode" cname="仓库名称" width="120" align="center" required="true" readonly="true"/>
<EF:EFColumn ename="inventCode" cname="存货名称" width="120" align="center" required="true" readonly="true"/> <EF:EFColumn ename="inventCode" cname="存货名称" width="120" align="center" required="true" readonly="true"/>
<EF:EFColumn ename="inventRecordId" cname="规格" width="120" align="center"/> <EF:EFColumn ename="inventRecordId" cname="规格" width="120" align="center" required="true" readonly="true"/>
<EF:EFColumn ename="material" cname="材质" width="120" align="center" enable="false"/> <EF:EFColumn ename="material" cname="材质" width="120" align="center" enable="false"/>
<EF:EFColumn ename="unit" cname="单位" width="120" align="center" enable="false"/> <EF:EFColumn ename="unit" cname="单位" width="120" align="center" enable="false"/>
<EF:EFColumn ename="amount" cname="数量" format="{0:N3}" maxLength="20" width="90" align="right" readonly="true"/> <EF:EFColumn ename="amount" cname="数量" format="{0:N3}" maxLength="20" width="100" align="right"
<EF:EFColumn ename="weight" cname="重量" format="{0:N3}" maxLength="20" width="90" align="right" readonly="true"/> required="true" readonly="true"/>
<EF:EFColumn ename="unitWeight" cname="单重" enable="false" width="100" align="right" format="{0:N3}"/>
<EF:EFColumn ename="weight" cname="重量" enable="false" width="100" align="right" format="{0:N3}"/>
<EF:EFColumn ename="remark" cname="备注" width="150" readonly="true"/> <EF:EFColumn ename="remark" cname="备注" width="150" readonly="true"/>
<EF:EFColumn ename="oldPurchaseNo" cname="原采购单号" enable="false" width="140" align="center"/> <EF:EFColumn ename="oldPurchaseNo" cname="原采购单号" enable="false" width="140" align="center"/>
<EF:EFColumn ename="createdName" cname="创建人" enable="false" width="100" align="center"/> <EF:EFColumn ename="createdName" cname="创建人" enable="false" width="100" align="center"/>
...@@ -66,7 +69,9 @@ ...@@ -66,7 +69,9 @@
editType="datetime" parseFormats="['yyyyMMddHHmmss']"/> editType="datetime" parseFormats="['yyyyMMddHHmmss']"/>
</EF:EFGrid> </EF:EFGrid>
</EF:EFRegion> </EF:EFRegion>
<EF:EFRegion title="提示">
<span style="color: red">说明:数据仅支持新增和删除,不能修改。</span>
</EF:EFRegion>
</EF:EFPage> </EF:EFPage>
......
...@@ -44,7 +44,7 @@ ...@@ -44,7 +44,7 @@
</EF:EFRegion> </EF:EFRegion>
<EF:EFRegion id="result" title="明细信息"> <EF:EFRegion id="result" title="明细信息">
<EF:EFGrid blockId="result" autoDraw="override" isFloat="true" checkMode="row"> <EF:EFGrid blockId="result" autoDraw="override" autoFit="true" isFloat="true" checkMode="row">
<EF:EFColumn ename="id" cname="主键id" hidden="true"/> <EF:EFColumn ename="id" cname="主键id" hidden="true"/>
<EF:EFColumn ename="reqNo" cname="领料单号" enable="false" width="140" align="center"/> <EF:EFColumn ename="reqNo" cname="领料单号" enable="false" width="140" align="center"/>
<EF:EFColumn ename="receiptDate" cname="单据日期" enable="false" width="90" align="center" <EF:EFColumn ename="receiptDate" cname="单据日期" enable="false" width="90" align="center"
...@@ -65,9 +65,11 @@ ...@@ -65,9 +65,11 @@
columnTemplate="#=textField#" itemTemplate="#=textField#"> columnTemplate="#=textField#" itemTemplate="#=textField#">
</EF:EFComboColumn> </EF:EFComboColumn>
<EF:EFColumn ename="amount" cname="数量" enable="false" format="{0:N3}" maxLength="20" width="100" <EF:EFColumn ename="amount" cname="数量" enable="false" format="{0:N3}" maxLength="20" width="100"
align="center"/> align="right"/>
<EF:EFColumn ename="unitWeight" cname="单重" enable="false" format="{0:N3}" maxLength="20" width="100"
align="right"/>
<EF:EFColumn ename="weight" cname="重量" enable="false" format="{0:N3}" maxLength="20" width="100" <EF:EFColumn ename="weight" cname="重量" enable="false" format="{0:N3}" maxLength="20" width="100"
align="center"/> align="right"/>
<EF:EFColumn ename="remark" cname="备注" enable="false" width="100" align="center"/> <EF:EFColumn ename="remark" cname="备注" enable="false" width="100" align="center"/>
<EF:EFColumn ename="oldReqNo" cname="原领料单号" enable="false" width="140" align="center"/> <EF:EFColumn ename="oldReqNo" cname="原领料单号" enable="false" width="140" align="center"/>
<EF:EFColumn ename="createdName" cname="创建人" enable="false" width="120" align="center"/> <EF:EFColumn ename="createdName" cname="创建人" enable="false" width="120" align="center"/>
......
...@@ -43,9 +43,7 @@ let select = function () { ...@@ -43,9 +43,7 @@ let select = function () {
} }
for (let i = 0; i < rows.length; i++) { for (let i = 0; i < rows.length; i++) {
let applyAmount = rows[i]['applyAmount']; let applyAmount = rows[i]['applyAmount'];
let applyWeight = rows[i]['applyWeight'];
let amount = rows[i]['amount']; let amount = rows[i]['amount'];
let weight = rows[i]['weight'];
if (isBlank(applyAmount) || !isNumber(applyAmount) || !(applyAmount > 0)) { if (isBlank(applyAmount) || !isNumber(applyAmount) || !(applyAmount > 0)) {
message("第" + (i + 1) + "行申请数量必须大于0"); message("第" + (i + 1) + "行申请数量必须大于0");
return; return;
...@@ -53,13 +51,6 @@ let select = function () { ...@@ -53,13 +51,6 @@ let select = function () {
if (parseFloat(applyAmount) > parseFloat(amount)) { if (parseFloat(applyAmount) > parseFloat(amount)) {
message("第" + (i + 1) + "行申请数量不能大于库存数量"); message("第" + (i + 1) + "行申请数量不能大于库存数量");
return; return;
}if (isBlank(applyWeight) || !isNumber(applyWeight) || !(applyWeight > 0)) {
message("第" + (i + 1) + "行申请重量必须大于0");
return;
}
if (parseFloat(applyWeight) > parseFloat(weight)) {
message("第" + (i + 1) + "行申请重量不能大于库存重量");
return;
} }
} }
JSUtils.confirm("确定对勾选中的[" + rows.length + "]条数据生成出库单吗? ", { JSUtils.confirm("确定对勾选中的[" + rows.length + "]条数据生成出库单吗? ", {
......
...@@ -28,7 +28,7 @@ ...@@ -28,7 +28,7 @@
</EF:EFRegion> </EF:EFRegion>
<EF:EFRegion id="result" title="记录集"> <EF:EFRegion id="result" title="记录集">
<EF:EFGrid blockId="result" autoDraw="override" checkMode="row"> <EF:EFGrid blockId="result" autoDraw="override" autoFit="true" checkMode="row">
<EF:EFColumn ename="id" cname="库存ID" enable="false" width="60" align="center"/> <EF:EFColumn ename="id" cname="库存ID" enable="false" width="60" align="center"/>
<EF:EFComboColumn ename="inventType" cname="存货类型" enable="false" width="100" align="center"> <EF:EFComboColumn ename="inventType" cname="存货类型" enable="false" width="100" align="center">
<EF:EFCodeOption codeName="hpjx.hpkc.inventType"/> <EF:EFCodeOption codeName="hpjx.hpkc.inventType"/>
...@@ -46,10 +46,10 @@ ...@@ -46,10 +46,10 @@
columnTemplate="#=textField#" itemTemplate="#=textField#"> columnTemplate="#=textField#" itemTemplate="#=textField#">
</EF:EFComboColumn> </EF:EFComboColumn>
<EF:EFColumn ename="applyAmount" cname="申请数量" width="120" align="right" format="{0:N3}" required="true"/> <EF:EFColumn ename="applyAmount" cname="申请数量" width="120" align="right" format="{0:N3}" required="true"/>
<EF:EFColumn ename="applyWeight" cname="申请重量" width="120" align="right" format="{0:N3}" required="true"/> <EF:EFColumn ename="applyRemark" cname="申请说明" width="150" editType="textarea" copy="true"/>
<EF:EFColumn ename="applyRemark" cname="说明" width="150" editType="textarea" copy="true"/>
<EF:EFColumn ename="amount" cname="库存数量" enable="false" width="120" align="right" format="{0:N3}" <EF:EFColumn ename="amount" cname="库存数量" enable="false" width="120" align="right" format="{0:N3}"
sumType="all"/> sumType="all"/>
<EF:EFColumn ename="unitWeight" cname="单量" enable="false" width="120" align="right" format="{0:N3}"/>
<EF:EFColumn ename="weight" cname="库存重量" enable="false" width="120" align="right" format="{0:N3}" <EF:EFColumn ename="weight" cname="库存重量" enable="false" width="120" align="right" format="{0:N3}"
sumType="all"/> sumType="all"/>
<EF:EFColumn ename="remark" cname="备注" enable="false" width="150"/> <EF:EFColumn ename="remark" cname="备注" enable="false" width="150"/>
......
...@@ -27,6 +27,7 @@ $(function() { ...@@ -27,6 +27,7 @@ $(function() {
editor: function (container, options) { editor: function (container, options) {
let inInfo = new EiInfo(); let inInfo = new EiInfo();
inInfo.set("inqu_status-0-whType", options.model["inventType"]); inInfo.set("inqu_status-0-whType", options.model["inventType"]);
inInfo.set("inqu_status-0-isSplicingSymbol", false);
inInfo.set("serviceName", "HPPZ007"); inInfo.set("serviceName", "HPPZ007");
inInfo.set("methodName", "queryComboBox"); inInfo.set("methodName", "queryComboBox");
inInfo.set("blockId", "wh_record_block_id"); inInfo.set("blockId", "wh_record_block_id");
...@@ -46,6 +47,7 @@ $(function() { ...@@ -46,6 +47,7 @@ $(function() {
editor: function (container, options) { editor: function (container, options) {
let inInfo = new EiInfo(); let inInfo = new EiInfo();
inInfo.set("inqu_status-0-inventType", options.model["inventType"]); inInfo.set("inqu_status-0-inventType", options.model["inventType"]);
inInfo.set("inqu_status-0-isSplicingSymbol", false);
inInfo.set("serviceName", "HPPZ006"); inInfo.set("serviceName", "HPPZ006");
inInfo.set("methodName", "queryMaterialComboBox"); inInfo.set("methodName", "queryMaterialComboBox");
inInfo.set("blockId", "material_record_block_id"); inInfo.set("blockId", "material_record_block_id");
...@@ -94,6 +96,7 @@ $(function() { ...@@ -94,6 +96,7 @@ $(function() {
*/ */
$(window).load(function () { $(window).load(function () {
let inInfo = new EiInfo(); let inInfo = new EiInfo();
inInfo.set("inqu_status-0-isSplicingSymbol", false);
// 仓库名称 // 仓库名称
EiCommunicator.send("HPPZ007", "queryComboBox", inInfo, { EiCommunicator.send("HPPZ007", "queryComboBox", inInfo, {
onSuccess: function (ei) { onSuccess: function (ei) {
......
...@@ -56,12 +56,12 @@ ...@@ -56,12 +56,12 @@
<EF:EFColumn ename="inventRecordId" cname="规格" width="120" align="center" required="true" readonly="true"/> <EF:EFColumn ename="inventRecordId" cname="规格" width="120" align="center" required="true" readonly="true"/>
<EF:EFColumn ename="bookAmount" cname="账面数量" format="{0:N3}" maxLength="20" width="90" align="right" <EF:EFColumn ename="bookAmount" cname="账面数量" format="{0:N3}" maxLength="20" width="90" align="right"
sumType="all" required="true" readonly="true"/> sumType="all" required="true" readonly="true"/>
<EF:EFColumn ename="bookWeight" cname="账面重量" format="{0:N3}" maxLength="20" width="90" align="right" <EF:EFColumn ename="bookWeight" cname="账面重量" enable="false" format="{0:N3}" maxLength="20" width="90"
sumType="all" required="true" readonly="true"/> align="right" sumType="all"/>
<EF:EFColumn ename="entityAmount" cname="实物数量" format="{0:N3}" maxLength="20" width="100" align="right" <EF:EFColumn ename="entityAmount" cname="实物数量" format="{0:N3}" maxLength="20" width="100" align="right"
sumType="all" required="true" readonly="true"/> sumType="all" required="true" readonly="true"/>
<EF:EFColumn ename="entityWeight" cname="实物重量" format="{0:N3}" maxLength="20" width="100" align="right" <EF:EFColumn ename="entityWeight" cname="实物重量" enable="false" format="{0:N3}" maxLength="20" width="100"
sumType="all" required="true" readonly="true"/> align="right" sumType="all"/>
<EF:EFColumn ename="diffAmount" cname="差异数量" enable="false" format="{0:N3}" maxLength="20" width="100" <EF:EFColumn ename="diffAmount" cname="差异数量" enable="false" format="{0:N3}" maxLength="20" width="100"
align="right" sumType="all" readonly="true"/> align="right" sumType="all" readonly="true"/>
<EF:EFColumn ename="diffWeight" cname="差异重量" enable="false" format="{0:N3}" maxLength="20" width="100" <EF:EFColumn ename="diffWeight" cname="差异重量" enable="false" format="{0:N3}" maxLength="20" width="100"
......
...@@ -66,15 +66,10 @@ let select = function () { ...@@ -66,15 +66,10 @@ let select = function () {
} }
for (let i = 0; i < rows.length; i++) { for (let i = 0; i < rows.length; i++) {
let entityAmount = rows[i]['entityAmount']; let entityAmount = rows[i]['entityAmount'];
let entityWeight = rows[i]['entityWeight'];
if (isBlank(entityAmount) || !isNumber(entityAmount) || entityAmount < 0) { if (isBlank(entityAmount) || !isNumber(entityAmount) || entityAmount < 0) {
message("第" + (i + 1) + "行实物数量不能小于0"); message("第" + (i + 1) + "行实物数量不能小于0");
return; return;
} }
if (isBlank(entityWeight) || !isNumber(entityWeight) || entityWeight < 0) {
message("第" + (i + 1) + "行实物重量不能小于0");
return;
}
} }
JSUtils.confirm("确定对勾选中的[" + rows.length + "]条数据生成盘点单吗? ", { JSUtils.confirm("确定对勾选中的[" + rows.length + "]条数据生成盘点单吗? ", {
ok: function () { ok: function () {
......
...@@ -46,8 +46,7 @@ ...@@ -46,8 +46,7 @@
columnTemplate="#=textField#" itemTemplate="#=textField#"> columnTemplate="#=textField#" itemTemplate="#=textField#">
</EF:EFComboColumn> </EF:EFComboColumn>
<EF:EFColumn ename="entityAmount" cname="实物数量" width="120" align="right" format="{0:N3}" required="true"/> <EF:EFColumn ename="entityAmount" cname="实物数量" width="120" align="right" format="{0:N3}" required="true"/>
<EF:EFColumn ename="entityWeight" cname="实物重量" width="120" align="right" format="{0:N3}" required="true"/> <EF:EFColumn ename="entityRemark" cname="盘点说明" width="150" editType="textarea" copy="true"/>
<EF:EFColumn ename="entityRemark" cname="说明" width="150" editType="textarea" copy="true"/>
<EF:EFColumn ename="amount" cname="库存数量" enable="false" width="120" align="right" format="{0:N3}" <EF:EFColumn ename="amount" cname="库存数量" enable="false" width="120" align="right" format="{0:N3}"
sumType="all"/> sumType="all"/>
<EF:EFColumn ename="weight" cname="库存重量" enable="false" width="120" align="right" format="{0:N3}" <EF:EFColumn ename="weight" cname="库存重量" enable="false" width="120" align="right" format="{0:N3}"
......
...@@ -30,6 +30,7 @@ $(function() { ...@@ -30,6 +30,7 @@ $(function() {
let inInfo = new EiInfo(); let inInfo = new EiInfo();
inInfo.set("inqu_status-0-inventTypes", [1, 2, 5]); inInfo.set("inqu_status-0-inventTypes", [1, 2, 5]);
inInfo.set("inqu_status-0-whType", options.model["inventType"]); inInfo.set("inqu_status-0-whType", options.model["inventType"]);
inInfo.set("inqu_status-0-isSplicingSymbol", false);
inInfo.set("serviceName", "HPPZ007"); inInfo.set("serviceName", "HPPZ007");
inInfo.set("methodName", "queryComboBox"); inInfo.set("methodName", "queryComboBox");
inInfo.set("blockId", "wh_record_block_id"); inInfo.set("blockId", "wh_record_block_id");
...@@ -62,7 +63,7 @@ $(function() { ...@@ -62,7 +63,7 @@ $(function() {
var eiInfo = new EiInfo(); var eiInfo = new EiInfo();
eiInfo.set("inqu_status-0-inventTypes", [1, 2, 5]); eiInfo.set("inqu_status-0-inventTypes", [1, 2, 5]);
eiInfo.set("inventType", options.model["inventType"]); eiInfo.set("inventType", options.model["inventType"]);
eiInfo.set("isSplicingSymbol",false); eiInfo.set("isSplicingSymbol", false);
//eiInfo.set("inqu_status-0-inventTypes", [1, 2, 5]); //eiInfo.set("inqu_status-0-inventTypes", [1, 2, 5]);
//eiInfo.set("inqu_status-0-inventCode", options.model["inventCode"]); //eiInfo.set("inqu_status-0-inventCode", options.model["inventCode"]);
//eiInfo.set("inqu_status-0-company_name", options.model["company_name"]); //eiInfo.set("inqu_status-0-company_name", options.model["company_name"]);
...@@ -203,7 +204,7 @@ $(window).load(function () { ...@@ -203,7 +204,7 @@ $(window).load(function () {
// 仓库名称 // 仓库名称
let inInfo = new EiInfo(); let inInfo = new EiInfo();
inInfo.set("inqu_status-0-inventTypes", [1, 2, 5]); inInfo.set("inqu_status-0-inventTypes", [1, 2, 5]);
inInfo.set("isSplicingSymbol", false); inInfo.set("inqu_status-0-isSplicingSymbol", false);
EiCommunicator.send("HPPZ007", "queryComboBox", inInfo, { EiCommunicator.send("HPPZ007", "queryComboBox", inInfo, {
onSuccess: function (ei) { onSuccess: function (ei) {
whNameGlobalData = ei.getBlock("wh_record_block_id").getMappedRows(); whNameGlobalData = ei.getBlock("wh_record_block_id").getMappedRows();
......
...@@ -48,22 +48,29 @@ ...@@ -48,22 +48,29 @@
<EF:EFColumn ename="otherEnterNo" cname="入库单号" enable="false" width="150" align="center"/> <EF:EFColumn ename="otherEnterNo" cname="入库单号" enable="false" width="150" align="center"/>
<EF:EFColumn ename="receiptDate" cname="单据日期" editType="date" dateFormat="yyyy-MM-dd" <EF:EFColumn ename="receiptDate" cname="单据日期" editType="date" dateFormat="yyyy-MM-dd"
parseFormats="['yyyyMMdd']" width="90" align="center" required="true" readonly="true"/> parseFormats="['yyyyMMdd']" width="90" align="center" required="true" readonly="true"/>
<EF:EFComboColumn ename="inventType" cname="存货类型" width="100" align="center" required="true" readonly="true"> <EF:EFComboColumn ename="inventType" cname="存货类型" width="100" align="center" required="true"
readonly="true">
<EF:EFCodeOption codeName="hpjx.hpkc.inventType" condition="ITEM_CODE IN ('1', '2', '5')"/> <EF:EFCodeOption codeName="hpjx.hpkc.inventType" condition="ITEM_CODE IN ('1', '2', '5')"/>
</EF:EFComboColumn> </EF:EFComboColumn>
<EF:EFColumn ename="whCode" cname="仓库名称" width="120" align="center" required="true" readonly="true"/> <EF:EFColumn ename="whCode" cname="仓库名称" width="120" align="center" required="true" readonly="true"/>
<EF:EFColumn ename="inventCode" cname="存货名称" width="120" align="center" required="true" readonly="true" hidden ="true"/> <EF:EFColumn ename="inventCode" cname="存货名称" width="120" align="center" required="true" readonly="true"
hidden="true"/>
<EF:EFColumn ename="inventName" cname="存货名称" width="120" align="center" required="true" readonly="true"/> <EF:EFColumn ename="inventName" cname="存货名称" width="120" align="center" required="true" readonly="true"/>
<EF:EFColumn ename="inventRecordId" cname="规格" width="120" align="center" required="false" readonly="true"/> <EF:EFColumn ename="inventRecordId" cname="规格" width="120" align="center" required="false" readonly="true"/>
<EF:EFColumn ename="amount" cname="数量" format="{0:N3}" maxLength="20" width="100" align="right" <EF:EFColumn ename="amount" cname="数量" format="{0:N3}" maxLength="20" width="100" align="right"
sumType="all" required="true" readonly="true"/> sumType="all" required="true" readonly="true"/>
<EF:EFColumn ename="weight" cname="重量" format="{0:N3}" maxLength="20" width="100" align="right" <EF:EFColumn ename="unitWeight" cname="单重" enable="false" width="100" align="right" format="{0:N3}"/>
sumType="all" required="true" readonly="true"/> <EF:EFColumn ename="weight" cname="重量" enable="false" width="100" align="right" format="{0:N3}"
<EF:EFColumn ename="length" cname="长" width="120" align="center" format="{0:N3}" required="false" readonly="true"/> sumType="all"/>
<EF:EFColumn ename="width" cname="宽" width="120" align="center" format="{0:N3}" required="false" readonly="true"/> <EF:EFColumn ename="length" cname="长" width="120" align="center" format="{0:N3}" required="false"
<EF:EFColumn ename="thick" cname="厚" width="120" align="center" format="{0:N3}" required="false" readonly="true"/> readonly="true"/>
<EF:EFColumn ename="width" cname="宽" width="120" align="center" format="{0:N3}" required="false"
readonly="true"/>
<EF:EFColumn ename="thick" cname="厚" width="120" align="center" format="{0:N3}" required="false"
readonly="true"/>
<EF:EFColumn ename="material" cname="材质" width="120" align="center" required="false" readonly="true"/> <EF:EFColumn ename="material" cname="材质" width="120" align="center" required="false" readonly="true"/>
<EF:EFColumn ename="coefficient" cname="系数" width="120" align="center" format="{0:N3}" required="false" readonly="true"/> <EF:EFColumn ename="coefficient" cname="系数" width="120" align="center" format="{0:N3}" required="false"
readonly="true"/>
<EF:EFColumn ename="unit" cname="单位" width="120" align="center" required="false" readonly="true"/> <EF:EFColumn ename="unit" cname="单位" width="120" align="center" required="false" readonly="true"/>
<EF:EFColumn ename="remark" cname="备注" width="150" maxLength="255" readonly="true"/> <EF:EFColumn ename="remark" cname="备注" width="150" maxLength="255" readonly="true"/>
<EF:EFColumn ename="createdName" cname="创建人" enable="false" width="100" align="center"/> <EF:EFColumn ename="createdName" cname="创建人" enable="false" width="100" align="center"/>
......
...@@ -63,10 +63,11 @@ ...@@ -63,10 +63,11 @@
blockName="invent_spec_block_id" textField="textField" valueField="valueField" blockName="invent_spec_block_id" textField="textField" valueField="valueField"
columnTemplate="#=textField#" itemTemplate="#=textField#"> columnTemplate="#=textField#" itemTemplate="#=textField#">
</EF:EFComboColumn> </EF:EFComboColumn>
<EF:EFColumn ename="amount" cname="数量" enable="false" format="{0:N3}" maxLength="20" width="100" <EF:EFColumn ename="amount" cname="数量" enable="false" format="{0:N3}" width="100" align="right"
align="right" sumType="all" required="true"/> sumType="all"/>
<EF:EFColumn ename="weight" cname="重量" enable="false" format="{0:N3}" maxLength="20" width="100" <EF:EFColumn ename="unitWeight" cname="单重" enable="false" format="{0:N3}" width="100" align="right"/>
align="right" sumType="all" required="true"/> <EF:EFColumn ename="weight" cname="重量" enable="false" format="{0:N3}" width="100" align="right"
sumType="all"/>
<EF:EFColumn ename="remark" cname="备注" enable="false" width="150"/> <EF:EFColumn ename="remark" cname="备注" enable="false" width="150"/>
<EF:EFColumn ename="oldOuterNo" cname="原出库单号" enable="false" width="140" align="center"/> <EF:EFColumn ename="oldOuterNo" cname="原出库单号" enable="false" width="140" align="center"/>
<EF:EFColumn ename="createdName" cname="创建人" enable="false" width="100" align="center"/> <EF:EFColumn ename="createdName" cname="创建人" enable="false" width="100" align="center"/>
......
...@@ -53,13 +53,6 @@ let select = function () { ...@@ -53,13 +53,6 @@ let select = function () {
if (parseFloat(applyAmount) > parseFloat(amount)) { if (parseFloat(applyAmount) > parseFloat(amount)) {
message("第" + (i + 1) + "行申请数量不能大于库存数量"); message("第" + (i + 1) + "行申请数量不能大于库存数量");
return; return;
}if (isBlank(applyWeight) || !isNumber(applyWeight) || !(applyWeight > 0)) {
message("第" + (i + 1) + "行申请重量必须大于0");
return;
}
if (parseFloat(applyWeight) > parseFloat(weight)) {
message("第" + (i + 1) + "行申请重量不能大于库存重量");
return;
} }
} }
JSUtils.confirm("确定对勾选中的[" + rows.length + "]条数据生成出库单吗? ", { JSUtils.confirm("确定对勾选中的[" + rows.length + "]条数据生成出库单吗? ", {
......
...@@ -46,12 +46,10 @@ ...@@ -46,12 +46,10 @@
columnTemplate="#=textField#" itemTemplate="#=textField#"> columnTemplate="#=textField#" itemTemplate="#=textField#">
</EF:EFComboColumn> </EF:EFComboColumn>
<EF:EFColumn ename="applyAmount" cname="申请数量" width="120" align="right" format="{0:N3}" required="true"/> <EF:EFColumn ename="applyAmount" cname="申请数量" width="120" align="right" format="{0:N3}" required="true"/>
<EF:EFColumn ename="applyWeight" cname="申请重量" width="120" align="right" format="{0:N3}" required="true"/> <EF:EFColumn ename="applyRemark" cname="申请说明" width="150" editType="textarea" copy="true"/>
<EF:EFColumn ename="applyRemark" cname="说明" enable="false" width="150" editType="textarea" copy="true"/> <EF:EFColumn ename="amount" cname="库存数量" enable="false" width="120" align="right" format="{0:N3}"/>
<EF:EFColumn ename="amount" cname="库存数量" enable="false" width="120" align="right" format="{0:N3}" <EF:EFColumn ename="unitWeight" cname="单重" enable="false" width="120" align="right" format="{0:N3}"/>
/> <EF:EFColumn ename="weight" cname="库存重量" enable="false" width="120" align="right" format="{0:N3}"/>
<EF:EFColumn ename="weight" cname="库存重量" enable="false" width="120" align="right" format="{0:N3}"
/>
<EF:EFColumn ename="remark" cname="备注" enable="false" width="150"/> <EF:EFColumn ename="remark" cname="备注" enable="false" width="150"/>
</EF:EFGrid> </EF:EFGrid>
</EF:EFRegion> </EF:EFRegion>
......
...@@ -58,10 +58,6 @@ ...@@ -58,10 +58,6 @@
sumType="all"/> sumType="all"/>
<EF:EFColumn ename="cgEnterWeight" cname="采购入库重量" enable="false" width="100" align="right" format="{0:N3}" <EF:EFColumn ename="cgEnterWeight" cname="采购入库重量" enable="false" width="100" align="right" format="{0:N3}"
sumType="all"/> sumType="all"/>
<EF:EFColumn ename="scEnterAmount" cname="生产入库数量" enable="false" width="90" align="right" format="{0:N3}"
sumType="all"/>
<EF:EFColumn ename="scEnterWeight" cname="生产入库重量" enable="false" width="90" align="right" format="{0:N3}"
sumType="all"/>
<EF:EFColumn ename="qtEnterAmount" cname="其它入库数量" enable="false" width="90" align="right" format="{0:N3}" <EF:EFColumn ename="qtEnterAmount" cname="其它入库数量" enable="false" width="90" align="right" format="{0:N3}"
sumType="all"/> sumType="all"/>
<EF:EFColumn ename="qtEnterWeight" cname="其它入库重量" enable="false" width="90" align="right" format="{0:N3}" <EF:EFColumn ename="qtEnterWeight" cname="其它入库重量" enable="false" width="90" align="right" format="{0:N3}"
...@@ -74,10 +70,6 @@ ...@@ -74,10 +70,6 @@
sumType="all"/> sumType="all"/>
<EF:EFColumn ename="scOuterWeight" cname="生产领料重量" enable="false" width="90" align="right" format="{0:N3}" <EF:EFColumn ename="scOuterWeight" cname="生产领料重量" enable="false" width="90" align="right" format="{0:N3}"
sumType="all"/> sumType="all"/>
<EF:EFColumn ename="xsOuterAmount" cname="销售出库数量" enable="false" width="90" align="right" format="{0:N3}"
sumType="all"/>
<EF:EFColumn ename="xsOuterWeight" cname="销售出库重量" enable="false" width="90" align="right" format="{0:N3}"
sumType="all"/>
<EF:EFColumn ename="qtOuterAmount" cname="其它出库数量" enable="false" width="90" align="right" format="{0:N3}" <EF:EFColumn ename="qtOuterAmount" cname="其它出库数量" enable="false" width="90" align="right" format="{0:N3}"
sumType="all"/> sumType="all"/>
<EF:EFColumn ename="qtOuterWeight" cname="其它出库重量" enable="false" width="90" align="right" format="{0:N3}" <EF:EFColumn ename="qtOuterWeight" cname="其它出库重量" enable="false" width="90" align="right" format="{0:N3}"
......
var inventNameGlobalData = []; var inventNameGlobalData = [];
var specGlobalData = []; var specGlobalData = [];
$(function() { $(function() {
// 查询 // 查询
$("#QUERY").on("click", query); $("#QUERY").on("click", query);
...@@ -57,6 +58,7 @@ $(function() { ...@@ -57,6 +58,7 @@ $(function() {
$(window).load(function () { $(window).load(function () {
// 存货名称 // 存货名称
let eiInfo = new EiInfo(); let eiInfo = new EiInfo();
inInfo.set("inqu_status-0-inventTypes", [1, 2, 5]);
EiCommunicator.send("HPPZ004", "queryComboBox", eiInfo, { EiCommunicator.send("HPPZ004", "queryComboBox", eiInfo, {
onSuccess: function (ei) { onSuccess: function (ei) {
inventNameGlobalData = ei.getBlock("invent_name_block_id").getMappedRows(); inventNameGlobalData = ei.getBlock("invent_name_block_id").getMappedRows();
......
...@@ -28,7 +28,7 @@ ...@@ -28,7 +28,7 @@
</EF:EFRegion> </EF:EFRegion>
<EF:EFRegion id="result" title="明细信息"> <EF:EFRegion id="result" title="明细信息">
<EF:EFGrid blockId="result" autoDraw="override" isFloat="true" checkMode="row"> <EF:EFGrid blockId="result" autoDraw="override" autoFit="true" isFloat="true" checkMode="row">
<EF:EFColumn ename="id" cname="内码" hidden="true"/> <EF:EFColumn ename="id" cname="内码" hidden="true"/>
<EF:EFColumn ename="inventRecordId" cname="存货档案ID" hidden="true"/> <EF:EFColumn ename="inventRecordId" cname="存货档案ID" hidden="true"/>
<EF:EFComboColumn ename="inventType" cname="存货类型" width="100" align="center" required="true" enable="false"> <EF:EFComboColumn ename="inventType" cname="存货类型" width="100" align="center" required="true" enable="false">
...@@ -43,8 +43,9 @@ ...@@ -43,8 +43,9 @@
<EF:EFColumn ename="spec" cname="规格" width="120" align="center" enable="false"/> <EF:EFColumn ename="spec" cname="规格" width="120" align="center" enable="false"/>
<EF:EFColumn ename="material" cname="材质" width="120" align="center" enable="false"/> <EF:EFColumn ename="material" cname="材质" width="120" align="center" enable="false"/>
<EF:EFColumn ename="unit" cname="单位" width="120" align="center" enable="false"/> <EF:EFColumn ename="unit" cname="单位" width="120" align="center" enable="false"/>
<EF:EFColumn ename="amount" cname="数量" format="{0:N3}" maxLength="20" width="90" align="right" enable="false"/> <EF:EFColumn ename="amount" cname="数量" enable="false" width="100" align="right" format="{0:N3}"/>
<EF:EFColumn ename="weight" cname="重量" format="{0:N3}" maxLength="20" width="90" align="right" enable="false"/> <EF:EFColumn ename="unitWeight" cname="单重" enable="false" width="100" align="right" format="{0:N3}"/>
<EF:EFColumn ename="weight" cname="重量" enable="false" width="100" align="right" format="{0:N3}"/>
<EF:EFColumn ename="createdBy" cname="创建人" enable="false" width="100" align="center"/> <EF:EFColumn ename="createdBy" cname="创建人" enable="false" width="100" align="center"/>
<EF:EFColumn ename="createdTime" cname="创建时刻" enable="false" width="140" align="center" <EF:EFColumn ename="createdTime" cname="创建时刻" enable="false" width="140" align="center"
editType="datetime" parseFormats="['yyyyMMddHHmmss']"/> editType="datetime" parseFormats="['yyyyMMddHHmmss']"/>
......
let inventAllGlobalData = [];
$(function() {
IPLATUI.EFGrid = {
pageable: {
pageSize: 20,
pageSizes: [20, 50, 70, 100],
},
"result": {
columns: [{
field: "spec",
template: function (dataItem) {
for (let i = 0; i < inventAllGlobalData.length; i++) {
if (inventAllGlobalData[i]['valueField'] === dataItem['inventRecordId']) {
return inventAllGlobalData[i]['textField'];
}
}
return "";
}
}, {
field: "material",
template: function (dataItem) {
for (let i = 0; i < inventAllGlobalData.length; i++) {
if (inventAllGlobalData[i]['valueField'] === dataItem['inventRecordId']) {
return inventAllGlobalData[i]['param1Field'];
}
}
return "";
}
}, {
field: "unit",
template: function (dataItem) {
for (let i = 0; i < inventAllGlobalData.length; i++) {
if (inventAllGlobalData[i]['valueField'] === dataItem['inventRecordId']) {
return inventAllGlobalData[i]['param2Field'];
}
}
return "";
}
}],
loadComplete: function (grid) {
// 此grid对象
grid.dataSource.bind("change", function(e) {
if (e.field == "inventRecordId") {
var tr,index;
// 获取此model元素信息
var item = e.items[0];
for (let i = 0; i < inventAllGlobalData.length; i++) {
if (inventAllGlobalData[i]['valueField'] === item.inventRecordId) {
resultGrid.setCellValue(item, 'material', inventAllGlobalData[i]['param1Field'])
resultGrid.setCellValue(item, 'unit', inventAllGlobalData[i]['param2Field'])
}
}
}
});
}
}
}
// 查询
$("#QUERY").on("click", query);
// 保存
$("#BTN_SAVE").on("click", save);
});
/**
* 页面加载时执行
*/
$(window).load(function () {
// 规格
initSpec();
// 查询
query();
});
/**
* 初始化规格
*/
let initSpec = function () {
let inInfo = new EiInfo();
inInfo.set("inqu_status-0-inventTypes", [1, 2]);
inInfo.set("inqu_status-0-isSplicingSymbol", false);
EiCommunicator.send("HPPZ006", "queryComboBoxAll", inInfo, {
onSuccess: function (ei) {
inventAllGlobalData = ei.getBlock("invent_all_block_id").getMappedRows();
},
onFail: function (ei) {
}
}, {async: false});
}
/**
* 查询
*/
let query = function () {
resultGrid.dataSource.page(1); // 点击查询按钮,从第1页开始查询
}
/**
* 保存
*/
let save = function () {
let rows = resultGrid.getCheckedRows();
if (rows.length < 1) {
message("请选择数据");
return;
}
JSUtils.confirm("确定对勾选中的[" + rows.length + "]条数据做\"保存\"操作? ", {
ok: function () {
JSUtils.submitGridsData("result", "HPKC006", "save", true);
}
});
}
<!DOCTYPE html>
<%@ page contentType="text/html; charset=UTF-8" %>
<%@ taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c" %>
<%@ taglib prefix="EF" tagdir="/WEB-INF/tags/EF" %>
<c:set var="ctx" value="${pageContext.request.contextPath}"/>
<EF:EFPage title="库存预警查询">
<EF:EFRegion id="inqu" title="查询条件">
<div class="row">
<div class="row">
<EF:EFSelect cname="存货类型" blockId="inqu_status" ename="inventType" row="0" colWidth="3"
filter="contains">
<EF:EFOption label="全部" value=""/>
<EF:EFCodeOption codeName="hpjx.hpkc.inventType" condition="ITEM_CODE IN ('1', '2')"/>
</EF:EFSelect>
<EF:EFSelect cname="仓库名称" blockId="inqu_status" ename="whCode" row="0" colWidth="3" filter="contains"
defultValue="">
<EF:EFOption label="全部" value=""/>
<EF:EFOptions blockId="wh_record_block_id" textField="textField" valueField="valueField"/>
</EF:EFSelect>
<EF:EFSelect cname="存货名称" blockId="inqu_status" ename="inventCode" row="0" colWidth="3"
filter="contains"
defultValue="">
<EF:EFOption label="全部" value=""/>
<EF:EFOptions blockId="invent_name_block_id" textField="textField" valueField="valueField"/>
</EF:EFSelect>
<EF:EFSelect cname="规格" blockId="inqu_status" ename="spec" row="0" colWidth="3" filter="contains"
defultValue="">
<EF:EFOption label="全部" value=""/>
<EF:EFOptions blockId="spec_name_block_id" textField="textField" valueField="valueField"/>
</EF:EFSelect>
</div>
</div>
</EF:EFRegion>
<EF:EFRegion id="result" title="明细信息">
<EF:EFGrid blockId="result" autoDraw="override" isFloat="true" checkMode="row">
<EF:EFColumn ename="id" cname="内码" hidden="true"/>
<EF:EFColumn ename="inventRecordId" cname="存货档案ID" hidden="true"/>
<EF:EFComboColumn ename="inventType" cname="存货类型" enable="false" width="100" align="center">
<EF:EFCodeOption codeName="hpjx.hpkc.inventType"/>
</EF:EFComboColumn>
<EF:EFComboColumn ename="whCode" cname="仓库名称" enable="false" width="120" align="center"
columnTemplate="#=textField#" itemTemplate="#=textField#"
blockName="wh_record_block_id" textField="textField" valueField="valueField"
filter="contains">
</EF:EFComboColumn>
<EF:EFComboColumn ename="inventCode" cname="存货名称" enable="false" width="120" align="center"
columnTemplate="#=textField#" itemTemplate="#=textField#"
blockName="invent_name_block_id" textField="textField" valueField="valueField"
filter="contains">
</EF:EFComboColumn>
<EF:EFColumn ename="spec" cname="规格" enable="false" width="120" align="center"/>
<EF:EFColumn ename="material" cname="材质" enable="false" width="120" align="center"/>
<EF:EFColumn ename="unit" cname="单位" enable="false" width="120" align="center"/>
<EF:EFColumn ename="amount" cname="库存数量" enable="false" width="90" align="right" format="{0:N3}"/>
<EF:EFColumn ename="warnNum" cname="预警值" enable="false" width="90" align="right" format="{0:N3}"/>
<EF:EFColumn ename="weight" cname="库存重量" enable="false" width="90" align="right" format="{0:N3}"/>
<EF:EFColumn ename="createdName" cname="创建人" enable="false" width="100" align="center"/>
<EF:EFColumn ename="createdTime" cname="创建时刻" enable="false" width="140" align="center"
editType="datetime" parseFormats="['yyyyMMddHHmmss']"/>
</EF:EFGrid>
</EF:EFRegion>
</EF:EFPage>
...@@ -25,7 +25,7 @@ ...@@ -25,7 +25,7 @@
<EF:EFRegion id="result" title="明细信息"> <EF:EFRegion id="result" title="明细信息">
<EF:EFGrid blockId="result" autoDraw="override" isFloat="true" checkMode="row"> <EF:EFGrid blockId="result" autoDraw="override" isFloat="true" checkMode="row">
<EF:EFColumn ename="id" cname="内码" hidden="true"/> <EF:EFColumn ename="id" cname="档案ID" enable="false" width="60" align="center"/>
<EF:EFComboColumn ename="inventType" cname="存货类型" width="120" align="center" requird="true"> <EF:EFComboColumn ename="inventType" cname="存货类型" width="120" align="center" requird="true">
<EF:EFCodeOption codeName="hpjx.hpkc.inventType"/> <EF:EFCodeOption codeName="hpjx.hpkc.inventType"/>
</EF:EFComboColumn> </EF:EFComboColumn>
......
...@@ -8,7 +8,7 @@ ...@@ -8,7 +8,7 @@
<EF:EFPage title="厂区管理"> <EF:EFPage title="厂区管理">
<EF:EFRegion id="inqu" title="查询条件"> <EF:EFRegion id="inqu" title="查询条件">
<div class="row"> <div class="row">
<EF:EFInput cname="厂区名称:" ename="factoryName" blockId="inqu_status" row="0" colWidth="3"/> <EF:EFInput cname="厂区名称" ename="factoryName" blockId="inqu_status" row="0" colWidth="3"/>
<EF:EFSelect cname="生产组名称" ename="groupCode" blockId="inqu_status" row="0" colWidth="3" filter="contains"> <EF:EFSelect cname="生产组名称" ename="groupCode" blockId="inqu_status" row="0" colWidth="3" filter="contains">
<EF:EFOption label="全部" value=""/> <EF:EFOption label="全部" value=""/>
<EF:EFOptions blockId="group_record_block_id" textField="textField" valueField="valueField"/> <EF:EFOptions blockId="group_record_block_id" textField="textField" valueField="valueField"/>
......
let whNameGlobalData = [];
let inventNameGlobalData = [];
let inventAllGlobalData = [];
$(function () {
IPLATUI.EFGrid.result = {
pageable: {
pageSize: 20,
pageSizes: [10, 20, 50, 70, 100],
},
columns: [ {
field: "whCode",
template: function (dataItem) {
for (let i = 0; i < whNameGlobalData.length; i++) {
if (whNameGlobalData[i]['valueField'] === dataItem['whCode']) {
return whNameGlobalData[i]['textField'];
}
}
return "";
},
editor: function (container, options) {
let inInfo = new EiInfo();
inInfo.set("inqu_status-0-inventTypes", [1, 2]);
inInfo.set("inqu_status-0-whType", options.model["inventType"]);
inInfo.set("inqu_status-0-isSplicingSymbol", false);
inInfo.set("serviceName", "HPPZ007");
inInfo.set("methodName", "queryComboBox");
inInfo.set("blockId", "wh_record_block_id");
inInfo.set("field", options.field);
refreshSelect(container, inInfo);
}
}, {
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) {
let inInfo = new EiInfo();
inInfo.set("inqu_status-0-inventTypes", [1, 2]);
inInfo.set("inqu_status-0-inventType", options.model["inventType"]);
inInfo.set("inqu_status-0-isSplicingSymbol", false);
inInfo.set("serviceName", "HPPZ006");
inInfo.set("methodName", "queryMaterialComboBox");
inInfo.set("blockId", "material_record_block_id");
inInfo.set("field", options.field);
refreshSelect(container, inInfo);
}
}, {
field: "inventRecordId",
template: function (dataItem) {
for (let i = 0; i < inventAllGlobalData.length; i++) {
if (inventAllGlobalData[i]['valueField'] === dataItem['inventRecordId']) {
return inventAllGlobalData[i]['textField'];
}
}
return "";
},
editor: function (container, options) {
let inInfo = new EiInfo();
inInfo.set("inqu_status-0-inventTypes", [1, 2]);
inInfo.set("inqu_status-0-inventCode", options.model["inventCode"]);
inInfo.set("serviceName", "HPPZ006");
inInfo.set("methodName", "queryComboBoxSpec");
inInfo.set("blockId", "invent_spec_block_id");
inInfo.set("field", options.field);
refreshSelect(container, inInfo);
}
}, {
field: "material",
template: function (dataItem) {
for (let i = 0; i < inventAllGlobalData.length; i++) {
if (inventAllGlobalData[i]['valueField'] === dataItem['inventRecordId']) {
return inventAllGlobalData[i]['param1Field'];
}
}
return "";
}
}, {
field: "unit",
template: function (dataItem) {
for (let i = 0; i < inventAllGlobalData.length; i++) {
if (inventAllGlobalData[i]['valueField'] === dataItem['inventRecordId']) {
return inventAllGlobalData[i]['param2Field'];
}
}
return "";
}
}],
loadComplete: function (grid) {
// 此grid对象
grid.dataSource.bind("change", function(e) {
if (e.field == "inventRecordId") {
var tr,index;
// 获取此model元素信息
var item = e.items[0];
for (let i = 0; i < inventAllGlobalData.length; i++) {
if (inventAllGlobalData[i]['valueField'] === item.inventRecordId) {
resultGrid.setCellValue(item, 'material', inventAllGlobalData[i]['param1Field'])
resultGrid.setCellValue(item, 'unit', inventAllGlobalData[i]['param2Field'])
}
}
}
});
},
onSave: function (e) {
// 阻止默认请求,使用自定义保存
e.preventDefault();
save();
},
onDelete: function (e) {
// 阻止默认请求,使用自定义删除
e.preventDefault();
deleteFunc();
}
}
// 查询
$("#QUERY").on("click", query);
});
/**
* 页面加载时执行
*/
$(window).load(function () {
// 仓库名称
initWh();
// 存货名称
initInvent();
// 规格
initSpec();
// 查询
query();
});
/**
* 初始化仓库
*/
let initWh = function () {
let inInfo = new EiInfo();
inInfo.set("inqu_status-0-inventTypes", [1, 2]);
inInfo.set("inqu_status-0-isSplicingSymbol", false);
EiCommunicator.send("HPPZ007", "queryComboBox", inInfo, {
onSuccess: function (ei) {
whNameGlobalData = ei.getBlock("wh_record_block_id").getMappedRows();
},
onFail: function (ei) {
}
}, {async: false});
}
/**
* 初始化存货
*/
let initInvent = function () {
let inInfo = new EiInfo();
inInfo.set("inqu_status-0-inventTypes", [1, 2]);
EiCommunicator.send("HPPZ004", "queryComboBox", inInfo, {
onSuccess: function (ei) {
inventNameGlobalData = ei.getBlock("invent_name_block_id").getMappedRows();
},
onFail: function (ei) {
}
}, {async: false});
}
/**
* 初始化规格
*/
let initSpec = function () {
let inInfo = new EiInfo();
inInfo.set("inqu_status-0-inventTypes", [1, 2]);
inInfo.set("inqu_status-0-isSplicingSymbol", false);
EiCommunicator.send("HPPZ006", "queryComboBoxAll", inInfo, {
onSuccess: function (ei) {
inventAllGlobalData = ei.getBlock("invent_all_block_id").getMappedRows();
},
onFail: function (ei) {
}
}, {async: false});
}
/**
* 查询
*/
let query = function () {
resultGrid.dataSource.page(1);
}
/**
* 保存
*/
let save = function () {
let rows = resultGrid.getCheckedRows();
if (rows.length < 1) {
message("请选择数据");
return;
}
JSUtils.confirm("确定对勾选中的[" + rows.length + "]条数据做\"保存\"操作? ", {
ok: function () {
JSUtils.submitGridsData("result", "HPPZ012", "save", true);
}
});
}
/**
* 删除
*/
let deleteFunc = function () {
let rows = resultGrid.getCheckedRows();
if (rows.length < 1) {
message("请选择数据");
return;
}
JSUtils.confirm("确定对勾选中的[" + rows.length + "]条数据做\"删除\"操作? ", {
ok: function () {
JSUtils.submitGridsData("result", "HPPZ012", "delete", true);
}
});
}
<!DOCTYPE html>
<%@ page contentType="text/html; charset=UTF-8" %>
<%@ taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c" %>
<%@ taglib prefix="EF" tagdir="/WEB-INF/tags/EF" %>
<c:set var="ctx" value="${pageContext.request.contextPath}"/>
<EF:EFPage title="库存预警管理">
<EF:EFRegion id="inqu" title="查询条件">
<div class="row">
<EF:EFSelect cname="存货类型" blockId="inqu_status" ename="inventType" row="0" colWidth="3" filter="contains">
<EF:EFOption label="全部" value=""/>
<EF:EFCodeOption codeName="hpjx.hpkc.inventType" condition="ITEM_CODE IN ('1', '2')"/>
</EF:EFSelect>
<EF:EFSelect cname="仓库名称" blockId="inqu_status" ename="whCode" row="0" colWidth="3" filter="contains"
defultValue="">
<EF:EFOption label="全部" value=""/>
<EF:EFOptions blockId="wh_record_block_id" textField="textField" valueField="valueField"/>
</EF:EFSelect>
<EF:EFSelect cname="存货名称" blockId="inqu_status" ename="inventCode" row="0" colWidth="3" filter="contains"
defultValue="">
<EF:EFOption label="全部" value=""/>
<EF:EFOptions blockId="invent_name_block_id" textField="textField" valueField="valueField"/>
</EF:EFSelect>
<EF:EFSelect cname="规格" blockId="inqu_status" ename="spec" row="0" colWidth="3" filter="contains"
defultValue="">
<EF:EFOption label="全部" value=""/>
<EF:EFOptions blockId="spec_name_block_id" textField="textField" valueField="valueField"/>
</EF:EFSelect>
</div>
<div class="row">
<EF:EFDateSpan startCname="创建日期(从)" endCname="至" blockId="inqu_status"
startName="createdDateFrom" endName="createdDateTo" row="0" role="date"
format="yyyy-MM-dd" ratio="3:3" satrtRatio="4:8" endRatio="4:8" readonly="true">
</EF:EFDateSpan>
</div>
</EF:EFRegion>
<EF:EFRegion id="result" title="记录集">
<EF:EFGrid blockId="result" autoDraw="override" checkMode="row">
<EF:EFColumn ename="id" cname="主键" hidden="true"/>
<EF:EFComboColumn ename="inventType" cname="存货类型" width="100" align="center" required="true"
readonly="true">
<EF:EFCodeOption codeName="hpjx.hpkc.inventType" condition="ITEM_CODE IN ('1', '2')"/>
</EF:EFComboColumn>
<EF:EFColumn ename="whCode" cname="仓库名称" width="120" align="center" required="true" readonly="true"/>
<EF:EFColumn ename="inventCode" cname="存货名称" width="120" align="center" required="true" readonly="true"/>
<EF:EFColumn ename="inventRecordId" cname="规格" width="120" align="center" required="true" readonly="true"/>
<EF:EFColumn ename="material" cname="材质" width="120" align="center" enable="false"/>
<EF:EFColumn ename="unit" cname="单位" width="120" align="center" enable="false"/>
<EF:EFColumn ename="warnNum" cname="预警值" width="100" align="right" format="{0:N3}" maxLength="20"
required="true"/>
<EF:EFColumn ename="remark" cname="备注" width="150"/>
<EF:EFColumn ename="createdName" cname="创建人" enable="false" width="100" align="center"/>
<EF:EFColumn ename="createdTime" cname="创建时刻" enable="false" width="140" align="center"
editType="datetime" parseFormats="['yyyyMMddHHmmss']"/>
<EF:EFColumn ename="updatedName" cname="修改人" enable="false" align="center"/>
<EF:EFColumn ename="updatedTime" cname="修改时间" enable="false" width="140" align="center"
editType="datetime" parseFormats="['yyyyMMddHHmmss','yyyy-MM-dd HH:mm:ss']"/>
</EF:EFGrid>
</EF:EFRegion>
</EF:EFPage>
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment