Commit 440b3ff5 by yukang

Merge remote-tracking branch 'origin/dev' into dev

# Conflicts:
#	src/main/java/com/baosight/hpjx/hp/zl/service/ServiceHPZL001.java
parents e3398e8f 4ad3c20e
...@@ -58,6 +58,8 @@ public class HPSqlConstant { ...@@ -58,6 +58,8 @@ public class HPSqlConstant {
public static final String STAT_DATE = "HPKC004.statDate"; public static final String STAT_DATE = "HPKC004.statDate";
// 锁 // 锁
public static final String LOCK = "HPKC004.lock"; public static final String LOCK = "HPKC004.lock";
// 修改打印状态
public static final String UPDATE_PRINT = "HPKC004.updatePrint";
} }
/** /**
......
...@@ -150,11 +150,19 @@ public class HPKC011 extends DaoEPBase { ...@@ -150,11 +150,19 @@ public class HPKC011 extends DaoEPBase {
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);
eiColumn = new EiColumn(FIELD_SUB_INVENT_CODE);
eiColumn.setDescName("零部件编码");
eiMetadata.addMeta(eiColumn);
eiColumn = new EiColumn(FIELD_SUB_INVENT_NAME);
eiColumn.setDescName("零部件名称");
eiMetadata.addMeta(eiColumn); eiMetadata.addMeta(eiColumn);
eiColumn = new EiColumn(FIELD_LENGTH); eiColumn = new EiColumn(FIELD_LENGTH);
......
...@@ -91,9 +91,9 @@ public class ServiceHPKC002A extends ServiceEPBase { ...@@ -91,9 +91,9 @@ public class ServiceHPKC002A extends ServiceEPBase {
// 库存ID // 库存ID
List<Long> ids = ObjectUtils.listKey(resultRows, "id"); List<Long> ids = ObjectUtils.listKey(resultRows, "id");
// 行锁 // 行锁
HPKCTools.lockKc010(ids); HPKCTools.HpKc010.lock(ids);
// 获取库存信息 // 获取库存信息
Map<Long, HPKC010> dbKc010Map = HPKCTools.mapKc010(ids); Map<Long, HPKC010> dbKc010Map = HPKCTools.HpKc010.map(ids);
// 状态校验 // 状态校验
for (Map row : resultRows) { for (Map row : resultRows) {
Long id = MapUtils.getLong(row, "id"); Long id = MapUtils.getLong(row, "id");
......
...@@ -89,9 +89,9 @@ public class ServiceHPKC004 extends ServiceBase { ...@@ -89,9 +89,9 @@ public class ServiceHPKC004 extends ServiceBase {
// 销售单号 // 销售单号
List<String> saleNos = ObjectUtils.listKey(resultRows, "saleNo"); List<String> saleNos = ObjectUtils.listKey(resultRows, "saleNo");
// 锁记录 // 锁记录
HPKCTools.lockKc004(saleNos); HPKCTools.HpKc004.lock(saleNos);
// 查询数据库记录 // 查询数据库记录
Map<String, HPKC004> mapKc004 = HPKCTools.mapKc004(saleNos); Map<String, HPKC004> mapKc004 = HPKCTools.HpKc004.map(saleNos);
for (int i = 0; i < resultRows.size(); i++) { for (int i = 0; i < resultRows.size(); i++) {
HPKC004 fKc004 = new HPKC004(); HPKC004 fKc004 = new HPKC004();
fKc004.fromMap(resultRows.get(i)); fKc004.fromMap(resultRows.get(i));
...@@ -103,10 +103,11 @@ public class ServiceHPKC004 extends ServiceBase { ...@@ -103,10 +103,11 @@ public class ServiceHPKC004 extends ServiceBase {
newKc004.setAmount(dbKc004.getAmount().negate()); newKc004.setAmount(dbKc004.getAmount().negate());
newKc004.setWeight(dbKc004.getWeight().negate()); newKc004.setWeight(dbKc004.getWeight().negate());
newKc004.setOldSaleNo(dbKc004.getSaleNo()); newKc004.setOldSaleNo(dbKc004.getSaleNo());
newKc004.setIsPrint(CommonConstant.YesNo.NO_0);
newKc004.setDeleteFlag(CommonConstant.YesNo.YES_1); newKc004.setDeleteFlag(CommonConstant.YesNo.YES_1);
DaoUtils.insert(HPKC004.INSERT, newKc004); DaoUtils.insert(HPKC004.INSERT, newKc004);
// 修改库存 // 修改库存
HPKCTools.updateStock(dbKc004.getWhCode(), dbKc004.getInventRecordId(), HPKCTools.updateProdStock(dbKc004.getWhCode(), dbKc004.getProdNo(),
dbKc004.getAmount(), dbKc004.getWeight()); dbKc004.getAmount(), dbKc004.getWeight());
} }
inInfo = this.query(inInfo); inInfo = this.query(inInfo);
......
...@@ -7,6 +7,7 @@ import com.baosight.hpjx.core.dao.DaoUtils; ...@@ -7,6 +7,7 @@ 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.HPKC004; import com.baosight.hpjx.hp.kc.domain.HPKC004;
import com.baosight.hpjx.hp.kc.domain.HPKC010; import com.baosight.hpjx.hp.kc.domain.HPKC010;
import com.baosight.hpjx.hp.kc.domain.HPKC011;
import com.baosight.hpjx.hp.kc.tools.HPKCTools; import com.baosight.hpjx.hp.kc.tools.HPKCTools;
import com.baosight.hpjx.util.AssertUtils; import com.baosight.hpjx.util.AssertUtils;
import com.baosight.hpjx.util.BeanUtils; import com.baosight.hpjx.util.BeanUtils;
...@@ -35,11 +36,6 @@ import java.util.Map; ...@@ -35,11 +36,6 @@ import java.util.Map;
*/ */
public class ServiceHPKC004A extends ServiceEPBase { public class ServiceHPKC004A extends ServiceEPBase {
// 指定存货类型
private static final Integer[] DEFAULT_INVENT_CODE = {InventTypeEnum.MATERIAL.getCode(),
InventTypeEnum.CONSUMABLE.getCode(), InventTypeEnum.SEMI_FINISHED_PRODUCT.getCode(),
InventTypeEnum.FINISHED_PRODUCT.getCode()};
/** /**
* 初始化 * 初始化
* *
...@@ -49,13 +45,7 @@ public class ServiceHPKC004A extends ServiceEPBase { ...@@ -49,13 +45,7 @@ public class ServiceHPKC004A extends ServiceEPBase {
@Override @Override
public EiInfo initLoad(EiInfo inInfo) { public EiInfo initLoad(EiInfo inInfo) {
try { try {
Map queryMap = new HashMap(); inInfo.addBlock(EiConstant.resultBlock).addBlockMeta(new HPKC011().eiMetadata);
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.INVENT_SPEC_BLOCK_ID), queryMap, false);
CommonMethod.initBlock(inInfo, Arrays.asList(DdynamicEnum.SPEC_NAME_BLOCK_ID), queryMap, false);
inInfo.addBlock(EiConstant.resultBlock).addBlockMeta(new HPKC010().eiMetadata);
} catch (Exception e) { } catch (Exception e) {
LogUtils.setDetailMsg(inInfo, e, "初始化失败"); LogUtils.setDetailMsg(inInfo, e, "初始化失败");
} }
...@@ -71,9 +61,7 @@ public class ServiceHPKC004A extends ServiceEPBase { ...@@ -71,9 +61,7 @@ public class ServiceHPKC004A extends ServiceEPBase {
@Override @Override
public EiInfo query(EiInfo inInfo) { public EiInfo query(EiInfo inInfo) {
try { try {
Map queryRow = EiInfoUtils.getFirstRow(inInfo); inInfo = super.query(inInfo, HPKC011.QUERY, new HPKC011());
queryRow.put("inventTypes", DEFAULT_INVENT_CODE);
inInfo = super.query(inInfo, HPKC010.QUERY, new HPKC010());
} catch (Exception e) { } catch (Exception e) {
LogUtils.setDetailMsg(inInfo, e, "查询失败"); LogUtils.setDetailMsg(inInfo, e, "查询失败");
} }
...@@ -92,40 +80,36 @@ public class ServiceHPKC004A extends ServiceEPBase { ...@@ -92,40 +80,36 @@ public class ServiceHPKC004A extends ServiceEPBase {
// 库存ID // 库存ID
List<Long> ids = ObjectUtils.listKey(resultRows, "id"); List<Long> ids = ObjectUtils.listKey(resultRows, "id");
// 行锁 // 行锁
HPKCTools.lockKc010(ids); HPKCTools.HpKc011.lock(ids);
// 获取库存信息 // 获取库存信息
Map<Long, HPKC010> dbKc010Map = HPKCTools.mapKc010(ids); Map<Long, HPKC011> dbKc011Map = HPKCTools.HpKc011.map(ids);
// 状态校验 // 状态校验
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); HPKC011 dbKc011 = dbKc011Map.get(id);
AssertUtils.isNull(dbKc010, "库存号[" + id + "]不存在!"); AssertUtils.isNull(dbKc011, "库存号[" + id + "]不存在!");
// 校验数量 // 校验数量
BigDecimal applyAmount = MapUtils.getBigDecimal(row, "applyAmount"); BigDecimal applyAmount = MapUtils.getBigDecimal(row, "applyAmount");
AssertUtils.isGt(applyAmount, dbKc010.getAmount(), AssertUtils.isGt(applyAmount, dbKc011.getAmount(), "库存号[" + id + "]可用数量不足!");
"库存号[" + id + "]可用数量不足!");
BigDecimal applyWeight = MapUtils.getBigDecimal(row, "applyWeight");
AssertUtils.isGt(applyWeight, dbKc010.getWeight(),
"库存号[" + id + "]可用重量不足!");
} }
// 生成销售库单 // 生成销售库单
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); HPKC011 dbKc011 = dbKc011Map.get(kcId);
HPKC004 newKc004 = BeanUtils.copy(dbKc010, HPKC004.class); HPKC004 newKc004 = BeanUtils.copy(dbKc011, HPKC004.class);
newKc004.setSaleNo(SequenceGenerator.getNextSequence(HPConstant.SequenceId.HPKC004_SALE_NO)); newKc004.setSaleNo(SequenceGenerator.getNextSequence(HPConstant.SequenceId.HPKC004_SALE_NO));
newKc004.setReceiptDate(DateUtils.shortDate()); newKc004.setReceiptDate(DateUtils.shortDate());
newKc004.setAmount(applyAmount); newKc004.setAmount(applyAmount);
newKc004.setWeight(applyWeight); newKc004.setWeight(applyAmount.multiply(dbKc011.getUnitWeight()));
newKc004.setRemark(applyRemark); newKc004.setRemark(applyRemark);
newKc004.setKcId(kcId); newKc004.setKcId(kcId);
newKc004.setIsPrint(CommonConstant.YesNo.NO_0);
newKc004.setDeleteFlag(CommonConstant.YesNo.NO_0); newKc004.setDeleteFlag(CommonConstant.YesNo.NO_0);
DaoUtils.insert(HPKC004.INSERT, newKc004); DaoUtils.insert(HPKC004.INSERT, newKc004);
// 修改库存数量 // 修改库存数量
HPKCTools.updateStock(newKc004.getWhCode(), newKc004.getInventRecordId(), HPKCTools.updateProdStock(newKc004.getWhCode(), newKc004.getProdNo(),
newKc004.getAmount().negate(), newKc004.getWeight().negate()); newKc004.getAmount().negate(), newKc004.getWeight().negate());
} }
} catch (Exception e) { } catch (Exception e) {
......
...@@ -81,9 +81,9 @@ public class ServiceHPKC005A extends ServiceEPBase { ...@@ -81,9 +81,9 @@ public class ServiceHPKC005A extends ServiceEPBase {
// 库存ID // 库存ID
List<Long> ids = ObjectUtils.listKey(resultRows, "id"); List<Long> ids = ObjectUtils.listKey(resultRows, "id");
// 行锁 // 行锁
HPKCTools.lockKc010(ids); HPKCTools.HpKc010.lock(ids);
// 获取库存信息 // 获取库存信息
Map<Long, HPKC010> dbKc010Map = HPKCTools.mapKc010(ids); Map<Long, HPKC010> dbKc010Map = HPKCTools.HpKc010.map(ids);
// 状态校验 // 状态校验
for (Map row : resultRows) { for (Map row : resultRows) {
Long id = MapUtils.getLong(row, "id"); Long id = MapUtils.getLong(row, "id");
......
...@@ -90,9 +90,9 @@ public class ServiceHPKC007A extends ServiceEPBase { ...@@ -90,9 +90,9 @@ public class ServiceHPKC007A extends ServiceEPBase {
// 库存ID // 库存ID
List<Long> ids = ObjectUtils.listKey(resultRows, "id"); List<Long> ids = ObjectUtils.listKey(resultRows, "id");
// 行锁 // 行锁
HPKCTools.lockKc010(ids); HPKCTools.HpKc010.lock(ids);
// 获取库存信息 // 获取库存信息
Map<Long, HPKC010> dbKc010Map = HPKCTools.mapKc010(ids); Map<Long, HPKC010> dbKc010Map = HPKCTools.HpKc010.map(ids);
// 状态校验 // 状态校验
for (Map row : resultRows) { for (Map row : resultRows) {
Long id = MapUtils.getLong(row, "id"); Long id = MapUtils.getLong(row, "id");
......
...@@ -10,16 +10,23 @@ ...@@ -10,16 +10,23 @@
SALE_NO as "saleNo", <!-- 销售单号 --> SALE_NO as "saleNo", <!-- 销售单号 -->
WH_CODE as "whCode", <!-- 仓库编码 --> WH_CODE as "whCode", <!-- 仓库编码 -->
WH_NAME as "whName", <!-- 仓库名称 --> WH_NAME as "whName", <!-- 仓库名称 -->
INVENT_TYPE as "inventType", <!-- 存货类型 --> PROD_NO as "prodNo", <!-- 生产订单号 -->
INVENT_CODE as "inventCode", <!-- 存货编码 --> PROJ_CODE as "projCode", <!-- 项目号 -->
INVENT_NAME as "inventName", <!-- 存货名称 --> PROJ_NAME as "projName", <!-- 项目名称 -->
INVENT_RECORD_ID as "inventRecordId", <!-- 规格 --> INVENT_CODE as "inventCode", <!-- 部件编码 -->
INVENT_NAME as "inventName", <!-- 部件名称 -->
SUB_INVENT_CODE as "subInventCode", <!-- 零部件编码 -->
SUB_INVENT_NAME as "subInventName", <!-- 零部件名称 -->
LENGTH as "length", <!-- 长 -->
WIDTH as "width", <!-- 宽 -->
THICK as "thick", <!-- 厚 -->
AMOUNT as "amount", <!-- 数量 --> AMOUNT as "amount", <!-- 数量 -->
UNIT_WEIGHT as "unitWeight", <!-- 单重 -->
WEIGHT as "weight", <!-- 重量 --> WEIGHT as "weight", <!-- 重量 -->
STATUS as "status", <!-- 状态 -->
REMARK as "remark", <!-- 备注 --> REMARK as "remark", <!-- 备注 -->
KC_ID as "kcId", <!-- 库存ID --> KC_ID as "kcId", <!-- 库存ID -->
OLD_SALE_NO as "oldSaleNo", <!-- 原销售单号 --> OLD_SALE_NO as "oldSaleNo", <!-- 原销售单号 -->
IS_PRINT as "isPrint", <!-- 是否打印:0.否1.是 -->
CREATED_BY as "createdBy", <!-- 创建人 --> CREATED_BY as "createdBy", <!-- 创建人 -->
CREATED_NAME as "createdName", <!-- 创建人名称 --> CREATED_NAME as "createdName", <!-- 创建人名称 -->
CREATED_TIME as "createdTime", <!-- 创建时间 --> CREATED_TIME as "createdTime", <!-- 创建时间 -->
...@@ -51,38 +58,51 @@ ...@@ -51,38 +58,51 @@
<isNotEmpty prepend=" AND " property="whName"> <isNotEmpty prepend=" AND " property="whName">
WH_NAME = #whName# WH_NAME = #whName#
</isNotEmpty> </isNotEmpty>
<isNotEmpty prepend=" AND " property="inventType"> <isNotEmpty prepend=" AND " property="prodNo">
INVENT_TYPE = #inventType# PROD_NO = #prodNo#
</isNotEmpty>
<isNotEmpty prepend=" AND " property="projCode">
PROJ_CODE = #projCode#
</isNotEmpty>
<isNotEmpty prepend=" AND " property="projName">
PROJ_NAME LIKE CONCAT('%', #projName#, '%')
</isNotEmpty> </isNotEmpty>
<isNotEmpty prepend=" AND " property="inventCode"> <isNotEmpty prepend=" AND " property="inventCode">
INVENT_CODE = #inventCode# INVENT_CODE = #inventCode#
</isNotEmpty> </isNotEmpty>
<isNotEmpty prepend=" AND " property="inventName"> <isNotEmpty prepend=" AND " property="inventName">
INVENT_NAME = #inventName# INVENT_NAME LIKE CONCAT('%', #inventName#, '%')
</isNotEmpty>
<isNotEmpty prepend=" AND " property="subInventCode">
SUB_INVENT_CODE = #subInventCode#
</isNotEmpty> </isNotEmpty>
<isNotEmpty prepend=" AND " property="inventRecordId"> <isNotEmpty prepend=" AND " property="subInventName">
INVENT_RECORD_ID = #inventRecordId# SUB_INVENT_NAME LIKE CONCAT('%', #subInventName#, '%')
</isNotEmpty>
<isNotEmpty prepend=" AND " property="remark">
REMARK = #remark#
</isNotEmpty> </isNotEmpty>
<isNotEmpty prepend=" AND " property="kcId"> <isNotEmpty prepend=" AND " property="kcId">
KC_ID = #kcId# KC_ID = #kcId#
</isNotEmpty> </isNotEmpty>
<isNotEmpty prepend=" AND " property="oldSaleNo">
OLD_SALE_NO = #oldSaleNo#
</isNotEmpty>
<isNotEmpty prepend=" AND " property="isPrint">
IS_PRINT = #isPrint#
</isNotEmpty>
<isNotEmpty prepend=" AND " property="deleteFlag"> <isNotEmpty prepend=" AND " property="deleteFlag">
DELETE_FLAG = #deleteFlag# DELETE_FLAG = #deleteFlag#
</isNotEmpty> </isNotEmpty>
</sql> </sql>
<sql id="customCondition"> <sql id="customCondition">
<isNotEmpty prepend=" AND " property="ids">
ID IN <iterate close=")" open="(" conjunction="," property="ids">#ids[]#</iterate>
</isNotEmpty>
<isNotEmpty prepend=" AND " property="saleNos"> <isNotEmpty prepend=" AND " property="saleNos">
SALE_NO IN <iterate close=")" open="(" conjunction="," property="saleNos">#saleNos[]#</iterate> SALE_NO IN <iterate close=")" open="(" conjunction="," property="saleNos">#saleNos[]#</iterate>
</isNotEmpty> </isNotEmpty>
<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>
<isNotEmpty prepend=" AND " property="createdDateFrom"> <isNotEmpty prepend=" AND " property="createdDateFrom">
CREATED_TIME &gt;= CONCAT(REPLACE(#createdDateFrom#, '-', ''), '000000') CREATED_TIME &gt;= CONCAT(REPLACE(#createdDateFrom#, '-', ''), '000000')
</isNotEmpty> </isNotEmpty>
...@@ -91,6 +111,13 @@ ...@@ -91,6 +111,13 @@
</isNotEmpty> </isNotEmpty>
</sql> </sql>
<!-- 公共修改字段 -->
<sql id="updateRevise">
UPDATED_BY = #updatedBy#, <!-- 修改人 -->
UPDATED_NAME = #updatedName#, <!-- 修改人名称 -->
UPDATED_TIME = #updatedTime# <!-- 修改时间 -->
</sql>
<sql id="order"> <sql id="order">
<dynamic prepend="ORDER BY"> <dynamic prepend="ORDER BY">
<isNotEmpty property="orderBy"> <isNotEmpty property="orderBy">
...@@ -125,27 +152,34 @@ ...@@ -125,27 +152,34 @@
SALE_NO, <!-- 销售单号 --> SALE_NO, <!-- 销售单号 -->
WH_CODE, <!-- 仓库编码 --> WH_CODE, <!-- 仓库编码 -->
WH_NAME, <!-- 仓库名称 --> WH_NAME, <!-- 仓库名称 -->
INVENT_TYPE, <!-- 存货类型 --> PROD_NO, <!-- 生产订单号 -->
INVENT_CODE, <!-- 存货编码 --> PROJ_CODE, <!-- 项目号 -->
INVENT_NAME, <!-- 存货名称 --> PROJ_NAME, <!-- 项目名称 -->
INVENT_RECORD_ID, <!-- 规格 --> INVENT_CODE, <!-- 部件编码 -->
INVENT_NAME, <!-- 部件名称 -->
SUB_INVENT_CODE, <!-- 零部件编码 -->
SUB_INVENT_NAME, <!-- 零部件名称 -->
LENGTH, <!-- 长 -->
WIDTH, <!-- 宽 -->
THICK, <!-- 厚 -->
AMOUNT, <!-- 数量 --> AMOUNT, <!-- 数量 -->
UNIT_WEIGHT, <!-- 单重 -->
WEIGHT, <!-- 重量 --> WEIGHT, <!-- 重量 -->
STATUS, <!-- 状态 -->
REMARK, <!-- 备注 --> REMARK, <!-- 备注 -->
KC_ID, <!-- 库存ID --> KC_ID, <!-- 库存ID -->
OLD_SALE_NO, <!-- 原销售单号 --> OLD_SALE_NO, <!-- 原销售单号 -->
IS_PRINT, <!-- 是否打印:0.否1.是 -->
CREATED_BY, <!-- 创建人 --> CREATED_BY, <!-- 创建人 -->
CREATED_NAME, <!-- 创建人名称 --> CREATED_NAME, <!-- 创建人名称 -->
CREATED_TIME, <!-- 创建时间 --> CREATED_TIME, <!-- 创建时间 -->
DELETE_FLAG <!-- 是否删除 --> DELETE_FLAG <!-- 是否删除 -->
) VALUES ( ) VALUES (
#companyCode#, #depCode#, #receiptDate#, #saleNo#, #whCode#, #whName#, #companyCode#, #depCode#, #receiptDate#, #saleNo#, #whCode#, #whName#, #prodNo#,
#inventType#, #inventCode#, #inventName#, #inventRecordId#, #amount#, #weight#, #status#, #projCode#, #projName#, #inventCode#, #inventName#, #subInventCode#, #subInventName#,
#remark#, #kcId#, #oldSaleNo#, #createdBy#, #createdName#, #createdTime#, #deleteFlag# #length#, #width#, #thick#, #amount#, #unitWeight#, #weight#, #remark#, #kcId#,
#oldSaleNo#, #isPrint#, #createdBy#, #createdName#, #createdTime#, #deleteFlag#
) )
</insert> </insert>
<!-- 逻辑删除 --> <!-- 逻辑删除 -->
<delete id="delete"> <delete id="delete">
UPDATE ${hpjxSchema}.T_HPKC004 SET DELETE_FLAG = 1 WHERE ID = #id# UPDATE ${hpjxSchema}.T_HPKC004 SET DELETE_FLAG = 1 WHERE ID = #id#
...@@ -157,16 +191,26 @@ ...@@ -157,16 +191,26 @@
RECEIPT_DATE = #receiptDate#, <!-- 票据日期 --> RECEIPT_DATE = #receiptDate#, <!-- 票据日期 -->
WH_CODE = #whCode#, <!-- 仓库编码 --> WH_CODE = #whCode#, <!-- 仓库编码 -->
WH_NAME = #whName#, <!-- 仓库名称 --> WH_NAME = #whName#, <!-- 仓库名称 -->
INVENT_TYPE = #inventType#, <!-- 存货类型 --> PROD_NO = #prodNo#, <!-- 生产订单号 -->
INVENT_CODE = #inventCode#, <!-- 存货编码 --> PROJ_CODE = #projCode#, <!-- 项目号 -->
INVENT_NAME = #inventName#, <!-- 存货名称 --> PROJ_NAME = #projName#, <!-- 项目名称 -->
INVENT_CODE = #inventCode#, <!-- 部件编码 -->
INVENT_NAME = #inventName#, <!-- 部件名称 -->
SUB_INVENT_CODE = #subInventCode#, <!-- 零部件编码 -->
SUB_INVENT_NAME = #subInventName#, <!-- 零部件名称 -->
LENGTH = #length#, <!-- 长 -->
WIDTH = #width#, <!-- 宽 -->
THICK = #thick#, <!-- 厚 -->
AMOUNT = #amount#, <!-- 数量 --> AMOUNT = #amount#, <!-- 数量 -->
UNIT_WEIGHT = #unitWeight#, <!-- 单重 -->
WEIGHT = #weight#, <!-- 重量 --> WEIGHT = #weight#, <!-- 重量 -->
STATUS = #status#, <!-- 状态 -->
REMARK = #remark#, <!-- 备注 --> REMARK = #remark#, <!-- 备注 -->
KC_ID = #kcId#, <!-- 库存ID -->
OLD_SALE_NO = #oldSaleNo#, <!-- 原销售单号 -->
UPDATED_BY = #updatedBy#, <!-- 修改人 --> UPDATED_BY = #updatedBy#, <!-- 修改人 -->
UPDATED_NAME = #updatedName#, <!-- 修改人名称 --> UPDATED_NAME = #updatedName#, <!-- 修改人名称 -->
UPDATED_TIME = #updatedTime# <!-- 修改时间 --> UPDATED_TIME = #updatedTime#, <!-- 修改时间 -->
DELETE_FLAG = #deleteFlag# <!-- 是否删除 -->
WHERE ID = #id# WHERE ID = #id#
</update> </update>
...@@ -183,6 +227,14 @@ ...@@ -183,6 +227,14 @@
</isNotEmpty> </isNotEmpty>
</update> </update>
<!-- 修改状态 -->
<update id="updatePrint">
UPDATE ${hpjxSchema}.T_HPKC004
SET IS_PRINT = 1,
<include refid="updateRevise"/>
WHERE ID IN <iterate close=")" open="(" conjunction="," property="ids">#ids[]#</iterate>
</update>
<!-- 统计库存 --> <!-- 统计库存 -->
<select id="statDate" resultClass="com.baosight.hpjx.hp.kc.domain.HPKC004"> <select id="statDate" resultClass="com.baosight.hpjx.hp.kc.domain.HPKC004">
SELECT SELECT
......
...@@ -57,13 +57,13 @@ ...@@ -57,13 +57,13 @@
INVENT_CODE = #inventCode# INVENT_CODE = #inventCode#
</isNotEmpty> </isNotEmpty>
<isNotEmpty prepend=" AND " property="inventName"> <isNotEmpty prepend=" AND " property="inventName">
INVENT_NAME = #inventName# INVENT_NAME LIKE CONCAT('%', #inventName#, '%')
</isNotEmpty> </isNotEmpty>
<isNotEmpty prepend=" AND " property="subInventCode"> <isNotEmpty prepend=" AND " property="subInventCode">
SUB_INVENT_CODE = #subInventCode# SUB_INVENT_CODE = #subInventCode#
</isNotEmpty> </isNotEmpty>
<isNotEmpty prepend=" AND " property="subInventName"> <isNotEmpty prepend=" AND " property="subInventName">
SUB_INVENT_NAME = #subInventName# SUB_INVENT_NAME LIKE CONCAT('%', #subInventName#, '%')
</isNotEmpty> </isNotEmpty>
<isNotEmpty prepend=" AND " property="createdBy"> <isNotEmpty prepend=" AND " property="createdBy">
CREATED_BY = #createdBy# CREATED_BY = #createdBy#
......
package com.baosight.hpjx.hp.kc.tools; 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.hp.constant.HPSqlConstant; import com.baosight.hpjx.hp.constant.HPSqlConstant;
import com.baosight.hpjx.hp.kc.domain.*; import com.baosight.hpjx.hp.kc.domain.*;
import com.baosight.iplat4j.core.ei.EiConstant; import com.baosight.iplat4j.core.ei.EiConstant;
...@@ -110,12 +111,20 @@ public class HPKCTools { ...@@ -110,12 +111,20 @@ public class HPKCTools {
} }
/** /**
* HPKC004 公共方法定义
*
* @author:songx
* @date:2024/1/31,16:36
*/
public static class HpKc004 {
/**
* 锁 * 锁
* *
* @param saleNos * @param saleNos
* @return * @return
*/ */
public static void lockKc004(List<String> saleNos) { public static void lock(List<String> saleNos) {
if (CollectionUtils.isEmpty(saleNos)) { if (CollectionUtils.isEmpty(saleNos)) {
return; return;
} }
...@@ -127,10 +136,25 @@ public class HPKCTools { ...@@ -127,10 +136,25 @@ public class HPKCTools {
/** /**
* 查询销售出库信息 * 查询销售出库信息
* *
* @param ids
* @return
*/
public static List<HPKC004> listById(List<Long> ids) {
if (CollectionUtils.isEmpty(ids)) {
return null;
}
Map queryMap = new HashMap();
queryMap.put("ids", ids);
return DaoBase.getInstance().query(HPKC004.QUERY, queryMap);
}
/**
* 查询销售出库信息
*
* @param saleNos * @param saleNos
* @return * @return
*/ */
public static List<HPKC004> listKc004(List<String> saleNos) { public static List<HPKC004> list(List<String> saleNos) {
if (CollectionUtils.isEmpty(saleNos)) { if (CollectionUtils.isEmpty(saleNos)) {
return null; return null;
} }
...@@ -145,8 +169,8 @@ public class HPKCTools { ...@@ -145,8 +169,8 @@ public class HPKCTools {
* @param saleNos * @param saleNos
* @return * @return
*/ */
public static Map<String, HPKC004> mapKc004(List<String> saleNos) { public static Map<String, HPKC004> map(List<String> saleNos) {
List<HPKC004> results = listKc004(saleNos); List<HPKC004> results = list(saleNos);
if (CollectionUtils.isEmpty(results)) { if (CollectionUtils.isEmpty(results)) {
return null; return null;
} }
...@@ -154,6 +178,21 @@ public class HPKCTools { ...@@ -154,6 +178,21 @@ public class HPKCTools {
} }
/** /**
* 修改打印状态
*
* @param ids
*/
public static void updatePrint(List<Long> ids) {
if (CollectionUtils.isEmpty(ids)) {
return;
}
Map queryMap = new HashMap();
queryMap.put("ids", ids);
DaoUtils.update(HPSqlConstant.HPKC004.UPDATE_PRINT, queryMap);
}
}
/**
* 锁 * 锁
* *
* @param checkNos * @param checkNos
...@@ -286,12 +325,20 @@ public class HPKCTools { ...@@ -286,12 +325,20 @@ public class HPKCTools {
} }
/** /**
* HPKC010公共DAO方法定义
*
* @author:songx
* @date:2024/1/31,16:42
*/
public static class HpKc010 {
/**
* 查询库存信息 * 查询库存信息
* *
* @param ids * @param ids
* @return * @return
*/ */
public static List<HPKC010> listKc010(List<Long> ids) { public static List<HPKC010> list(List<Long> ids) {
if (CollectionUtils.isEmpty(ids)) { if (CollectionUtils.isEmpty(ids)) {
return null; return null;
} }
...@@ -306,8 +353,8 @@ public class HPKCTools { ...@@ -306,8 +353,8 @@ public class HPKCTools {
* @param ids * @param ids
* @return * @return
*/ */
public static Map<Long, HPKC010> mapKc010(List<Long> ids) { public static Map<Long, HPKC010> map(List<Long> ids) {
List<HPKC010> results = listKc010(ids); List<HPKC010> results = list(ids);
if (CollectionUtils.isEmpty(results)) { if (CollectionUtils.isEmpty(results)) {
return null; return null;
} }
...@@ -320,7 +367,7 @@ public class HPKCTools { ...@@ -320,7 +367,7 @@ public class HPKCTools {
* @param ids * @param ids
* @return * @return
*/ */
public static void lockKc010(List<Long> ids) { public static void lock(List<Long> ids) {
if (CollectionUtils.isEmpty(ids)) { if (CollectionUtils.isEmpty(ids)) {
return; return;
} }
...@@ -329,6 +376,63 @@ public class HPKCTools { ...@@ -329,6 +376,63 @@ public class HPKCTools {
DaoBase.getInstance().update(HPSqlConstant.HPKC010.LOCK, queryMap); DaoBase.getInstance().update(HPSqlConstant.HPKC010.LOCK, queryMap);
} }
}
/**
* HPKC011公共DAO方法定义
*
* @author:songx
* @date:2024/1/31,16:42
*/
public static class HpKc011 {
/**
* 查询库存信息
*
* @param ids
* @return
*/
public static List<HPKC011> list(List<Long> ids) {
if (CollectionUtils.isEmpty(ids)) {
return null;
}
Map queryMap = new HashMap();
queryMap.put("ids", ids);
return DaoBase.getInstance().query(HPKC011.QUERY, queryMap);
}
/**
* 查询库存信息
*
* @param ids
* @return
*/
public static Map<Long, HPKC011> map(List<Long> ids) {
List<HPKC011> results = list(ids);
if (CollectionUtils.isEmpty(results)) {
return null;
}
return results.stream().collect(Collectors.toMap(HPKC011::getId, item -> item));
}
/**
* 锁
*
* @param ids
* @return
*/
public static void lock(List<Long> ids) {
if (CollectionUtils.isEmpty(ids)) {
return;
}
Map queryMap = new HashMap();
queryMap.put("ids", ids);
DaoBase.getInstance().update(HPSqlConstant.HPKC011.LOCK, queryMap);
}
}
/** /**
* 更新库存 * 更新库存
* *
......
package com.baosight.hpjx.util; package com.baosight.hpjx.util;
import com.alibaba.fastjson.JSONObject;
import com.baosight.iplat4j.core.exception.PlatException;
import java.io.UnsupportedEncodingException;
import java.net.URLDecoder;
import java.util.Map;
import java.util.UUID; import java.util.UUID;
/** /**
...@@ -109,4 +115,17 @@ public class StringUtils extends org.apache.commons.lang3.StringUtils { ...@@ -109,4 +115,17 @@ public class StringUtils extends org.apache.commons.lang3.StringUtils {
return str.length() > endIndex ? str.substring(0, endIndex) : str; return str.length() > endIndex ? str.substring(0, endIndex) : str;
} }
/**
* 解码参数
*
* @param parameter
* @return
*/
public static Map<String, Object> encodeParam(String parameter) throws UnsupportedEncodingException {
// 帆软传递进来的参数进行了两次编码,因此需要进行两次解码
String paramsText = URLDecoder.decode(parameter, "UTF-8");
paramsText = URLDecoder.decode(paramsText, "UTF-8");
return JSONObject.parseObject(paramsText).getInnerMap();
}
} }
...@@ -18,6 +18,9 @@ $(function () { ...@@ -18,6 +18,9 @@ $(function () {
// 挑选库存 // 挑选库存
$("#SELECT_STOCK").on("click", selectStock); $("#SELECT_STOCK").on("click", selectStock);
// 导出打印
$("#PRINT").on("click", exportPrint);
}); });
...@@ -59,3 +62,31 @@ let selectStockCallback = function () { ...@@ -59,3 +62,31 @@ let selectStockCallback = function () {
// 关闭弹窗 // 关闭弹窗
JSColorbox.close(); JSColorbox.close();
} }
/**
* 导出打印
*/
let exportPrint = function () {
let rows = resultGrid.getCheckedRows();
if (rows.length < 1) {
message("请选择同一个项目的数据")
return;
}
let saleIds = [];
let projCodeTemp;
for (let i = 0; i < rows.length; i++) {
let projCode = rows[i]['projCode'];
if (projCodeTemp == null) {
projCodeTemp = projCode;
} else if (projCodeTemp != projCode) {
message("第" + (i + 1) + "行项目号不一致,请选择同一个项目的数据");
return;
}
saleIds.push(rows[i]['id']);
}
let parameter = {
"saleIds": saleIds
};
window.location = IPLATUI.CONTEXT_PATH + "/HP/KC/HPKC90.jsp?route=1&parameter="
+ encodeURI(encodeURI(JSON.stringify(parameter)));
}
...@@ -8,66 +8,63 @@ ...@@ -8,66 +8,63 @@
<EF:EFPage title="销售出库单"> <EF:EFPage title="销售出库单">
<EF:EFRegion id="inqu" title="查询条件"> <EF:EFRegion id="inqu" title="查询条件">
<div class="row"> <div class="row">
<EF:EFDatePicker cname="单据日期" ename="inqu_status-0-receiptDate" colWidth="3" format="yyyy-MM-dd" <EF:EFDatePicker cname="单据日期" ename="receiptDate" blockId="inqu_status" row="0" colWidth="3"
readonly="true"/> format="yyyy-MM-dd" readonly="true"/>
<EF:EFInput cname="销售单号" ename="inqu_status-0-saleNo" colWidth="3"/> <EF:EFInput cname="销售单号" ename="saleNo" blockId="inqu_status" row="0" colWidth="3"/>
<EF:EFSelect cname="存货类型" ename="inqu_status-0-inventType" colWidth="3" filter="contains"> <EF:EFInput cname="项目号" ename="projCode" blockId="inqu_status" row="0" colWidth="3"/>
<EF:EFOption label="全部" value=""/> <EF:EFInput cname="项目名称" ename="projName" blockId="inqu_status" row="0" colWidth="3"/>
<EF:EFCodeOption codeName="hpjx.hpkc.inventType" condition="ITEM_CODE IN ('1', '2', '3', '4')"/>
</EF:EFSelect>
<EF:EFSelect cname="仓库名称" ename="inqu_status-0-whCode" colWidth="3" filter="contains">
<EF:EFOption label="全部" value=""/>
<EF:EFOptions blockId="wh_record_block_id" textField="textField" valueField="valueField"/>
</EF:EFSelect>
</div> </div>
<div class="row"> <div class="row">
<EF:EFSelect cname="存货名称" ename="inqu_status-0-inventCode" colWidth="3" filter="contains"> <EF:EFInput cname="部件编码" ename="inventCode" blockId="inqu_status" row="0" colWidth="3"/>
<EF:EFOption label="全部" value=""/> <EF:EFInput cname="部件名称" ename="inventName" blockId="inqu_status" row="0" colWidth="3"/>
<EF:EFOptions blockId="invent_name_block_id" textField="textField" valueField="valueField"/> <EF:EFInput cname="零部件编码" ename="subInventCode" blockId="inqu_status" row="0" colWidth="3"/>
</EF:EFSelect> <EF:EFInput cname="零部件名称" ename="subInventName" blockId="inqu_status" row="0" colWidth="3"/>
<EF:EFSelect cname="规格" ename="inqu_status-0-spec" colWidth="3" filter="contains">
<EF:EFOption label="全部" value=""/>
<EF:EFOptions blockId="spec_name_block_id" textField="textField" valueField="valueField"/>
</EF:EFSelect>
<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> </div>
<div class="row"> <div class="row">
<EF:EFSelect cname="是否删除" ename="inqu_status-0-deleteFlag" colWidth="3" defaultValue="0"> <EF:EFSelect cname="是否打印" ename="isPrint" blockId="inqu_status" row="0" colWidth="3" defaultValue="">
<EF:EFOption label="全部" value=""/>
<EF:EFCodeOption codeName="hpjx.hpjx.isPrint"/>
</EF:EFSelect>
<EF:EFSelect cname="是否删除" ename="deleteFlag" blockId="inqu_status" row="0" colWidth="3" defaultValue="0">
<EF:EFOption label="全部" value=""/> <EF:EFOption label="全部" value=""/>
<EF:EFCodeOption codeName="hpjx.hpjx.deleteFlag"/> <EF:EFCodeOption codeName="hpjx.hpjx.deleteFlag"/>
</EF:EFSelect> </EF:EFSelect>
<EF:EFDateSpan startCname="创建日期(从)" endCname="至" startName="createdDateFrom" endName="createdDateTo"
blockId="inqu_status" row="0" role="date" format="yyyy-MM-dd" ratio="3:3" satrtRatio="4:8"
endRatio="4:8" readonly="true">
</EF:EFDateSpan>
</div> </div>
</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" isFloat="true" checkMode="row">
<EF:EFColumn ename="id" cname="内码" hidden="true"/> <EF:EFColumn ename="id" cname="内码" hidden="true"/>
<EF:EFColumn ename="saleNo" 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"
editType="date" dateFormat="yyyy-MM-dd" parseFormats="['yyyyMMdd']"/> editType="date" dateFormat="yyyy-MM-dd" parseFormats="['yyyyMMdd']"/>
<EF:EFComboColumn ename="inventType" cname="存货类型" enable="false" width="100" align="center"> <EF:EFColumn ename="projName" cname="项目名称" enable="false" width="140" align="center"/>
<EF:EFCodeOption codeName="hpjx.hpkc.inventType"/> <EF:EFColumn ename="inventName" cname="部件名称" enable="false" width="120" align="center"/>
</EF:EFComboColumn> <EF:EFColumn ename="subInventName" cname="零部件名称" enable="false" width="120" align="center"/>
<EF:EFComboColumn ename="whCode" cname="仓库编码" enable="false" width="120" align="center"
blockName="wh_record_block_id" textField="textField" valueField="valueField"
columnTemplate="#=textField#" itemTemplate="#=textField#">
</EF:EFComboColumn>
<EF:EFComboColumn ename="inventCode" cname="存货名称" enable="false" width="120" align="center"
blockName="invent_name_block_id" textField="textField" valueField="valueField"
columnTemplate="#=textField#" itemTemplate="#=textField#">
</EF:EFComboColumn>
<EF:EFComboColumn ename="inventRecordId" cname="规格" enable="false" width="120" align="center"
blockName="invent_spec_block_id" textField="textField" valueField="valueField"
columnTemplate="#=textField#" itemTemplate="#=textField#">
</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="center"/>
<EF:EFColumn ename="weight" cname="重量" enable="false" format="{0:N3}" maxLength="20" width="100" <EF:EFColumn ename="length" cname="长" enable="false" format="{0:N3}" maxLength="20" width="100"
align="center"/>
<EF:EFColumn ename="width" cname="宽" enable="false" format="{0:N3}" maxLength="20" width="100"
align="center"/> align="center"/>
<EF:EFColumn ename="thick" cname="厚" enable="false" format="{0:N3}" maxLength="20" width="100"
align="center"/>
<EF:EFColumn ename="unitWeight" cname="单重" enable="false" format="{0:N3}" maxLength="20" width="100"
align="center"/>
<EF:EFColumn ename="weight" cname="总重" enable="false" format="{0:N3}" maxLength="20" width="100"
align="center"/>
<EF:EFComboColumn ename="isPrint" cname="是否打印" width="80" align="center">
<EF:EFCodeOption codeName="hpjx.hpjx.isPrint"/>
</EF:EFComboColumn>
<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="projCode" cname="项目号" enable="false" width="140" align="center"/>
<EF:EFColumn ename="inventCode" cname="部件编码" enable="false" width="120" align="center"/>
<EF:EFColumn ename="subInventCode" cname="零部件编码" enable="false" width="120" align="center"/>
<EF:EFColumn ename="prodNo" cname="生产订单号" enable="false" width="140" align="center"/>
<EF:EFColumn ename="saleNo" cname="销售单号" enable="false" width="140" align="center"/>
<EF:EFColumn ename="oldSaleNo" cname="原销售单号" enable="false" width="140" align="center"/> <EF:EFColumn ename="oldSaleNo" 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"/>
<EF:EFColumn ename="createdTime" cname="创建时间" enable="false" width="140" align="center" <EF:EFColumn ename="createdTime" cname="创建时间" enable="false" width="140" 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 + "]条数据生成出库单吗? ", {
......
...@@ -8,51 +8,38 @@ ...@@ -8,51 +8,38 @@
<EF:EFPage title="库存查询"> <EF:EFPage title="库存查询">
<EF:EFRegion id="inqu" title="查询区域" type="query"> <EF:EFRegion id="inqu" title="查询区域" type="query">
<div class="row"> <div class="row">
<EF:EFSelect cname="存货类型" ename="inqu_status-0-inventType" colWidth="3" filter="contains"> <div class="row">
<EF:EFOption label="全部" value=""/> <EF:EFInput cname="项目号" ename="projCode" blockId="inqu_status" row="0" colWidth="3"/>
<EF:EFCodeOption codeName="hpjx.hpkc.inventType" condition="ITEM_CODE IN ('1', '2', '3', '4')"/> <EF:EFInput cname="项目名称" ename="projName" blockId="inqu_status" row="0" colWidth="3"/>
</EF:EFSelect> <EF:EFInput cname="部件编码" ename="inventCode" blockId="inqu_status" row="0" colWidth="3"/>
<EF:EFSelect cname="仓库名称" ename="inqu_status-0-whCode" colWidth="3" filter="contains"> <EF:EFInput cname="部件名称" ename="inventName" blockId="inqu_status" row="0" colWidth="3"/>
<EF:EFOption label="全部" value=""/> </div>
<EF:EFOptions blockId="wh_record_block_id" textField="textField" valueField="valueField"/> <div class="row">
</EF:EFSelect> <EF:EFInput cname="零部件编码" ename="subInventCode" blockId="inqu_status" row="0" colWidth="3"/>
<EF:EFSelect cname="存货名称" ename="inqu_status-0-inventCode" colWidth="3" filter="contains"> <EF:EFInput cname="零部件名称" ename="subInventName" blockId="inqu_status" row="0" colWidth="3"/>
<EF:EFOption label="全部" value=""/> </div>
<EF:EFOptions blockId="invent_name_block_id" textField="textField" valueField="valueField"/>
</EF:EFSelect>
<EF:EFSelect ename="inqu_status-0-spec" cname="规格" colWidth="3" filter="contains">
<EF:EFOption label="全部" value=""/>
<EF:EFOptions blockId="spec_name_block_id" textField="textField" valueField="valueField"/>
</EF:EFSelect>
</div> </div>
</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" 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:EFColumn ename="whName" cname="仓库名称" enable="false" width="140" align="center"/>
<EF:EFCodeOption codeName="hpjx.hpkc.inventType"/> <EF:EFColumn ename="projName" cname="项目名称" enable="false" width="140" align="center"/>
</EF:EFComboColumn> <EF:EFColumn ename="inventName" cname="部件名称" enable="false" width="120" align="center"/>
<EF:EFComboColumn ename="whCode" cname="仓库名称" enable="false" width="120" align="center" <EF:EFColumn ename="subInventName" cname="零部件名称" enable="false" width="120" align="center"/>
blockName="wh_record_block_id" textField="textField" valueField="valueField"
columnTemplate="#=textField#" itemTemplate="#=textField#">
</EF:EFComboColumn>
<EF:EFComboColumn ename="inventCode" cname="存货名称" enable="false" width="120" align="center"
blockName="invent_name_block_id" textField="textField" valueField="valueField"
columnTemplate="#=textField#" itemTemplate="#=textField#">
</EF:EFComboColumn>
<EF:EFComboColumn ename="inventRecordId" cname="规格" enable="false" width="120" align="center"
blockName="invent_spec_block_id" textField="textField" valueField="valueField"
columnTemplate="#=textField#" itemTemplate="#=textField#">
</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="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"/>
<EF:EFColumn ename="whCode" cname="仓库编码" enable="false" width="140" align="center"/>
<EF:EFColumn ename="projCode" cname="项目号" enable="false" width="140" align="center"/>
<EF:EFColumn ename="inventCode" cname="部件编码" enable="false" width="120" align="center"/>
<EF:EFColumn ename="subInventCode" cname="零部件编码" enable="false" width="120" align="center"/>
<EF:EFColumn ename="prodNo" cname="生产订单号" enable="false" width="140" align="center"/>
</EF:EFGrid> </EF:EFGrid>
</EF:EFRegion> </EF:EFRegion>
</EF:EFPage> </EF:EFPage>
var inventNameGlobalData = []; var inventNameGlobalData = [];
var specGlobalData = [];
$(function() { $(function() {
// 查询 // 查询
$("#QUERY").on("click", query); $("#QUERY").on("click", query);
...@@ -16,32 +15,12 @@ $(function() { ...@@ -16,32 +15,12 @@ $(function() {
} }
return ""; return "";
} }
}, { },{
field: "spec", field: "subInventCode",
template: function (dataItem) { template: function (dataItem) {
for (let i = 0; i < specGlobalData.length; i++) { for (let i = 0; i < inventNameGlobalData.length; i++) {
if (specGlobalData[i]['valueField'] === dataItem['inventRecordId']) { if (inventNameGlobalData[i]['valueField'] === dataItem['subInventCode']) {
return specGlobalData[i]['textField']; return inventNameGlobalData[i]['textField'];
}
}
return "";
}
}, {
field: "material",
template: function (dataItem) {
for (let i = 0; i < specGlobalData.length; i++) {
if (specGlobalData[i]['valueField'] === dataItem['inventRecordId']) {
return specGlobalData[i]['param1Field'];
}
}
return "";
}
}, {
field: "unit",
template: function (dataItem) {
for (let i = 0; i < specGlobalData.length; i++) {
if (specGlobalData[i]['valueField'] === dataItem['inventRecordId']) {
return specGlobalData[i]['param2Field'];
} }
} }
return ""; return "";
...@@ -64,14 +43,6 @@ $(window).load(function () { ...@@ -64,14 +43,6 @@ $(window).load(function () {
onFail: function (ei) { onFail: function (ei) {
} }
}, {async: false}); }, {async: false});
// 规格
EiCommunicator.send("HPPZ006", "queryComboBoxAll", eiInfo, {
onSuccess: function (ei) {
specGlobalData = ei.getBlock("invent_all_block_id").getMappedRows();
},
onFail: function (ei) {
}
}, {async: false});
// 查询 // 查询
query(); query();
}); });
......
...@@ -5,24 +5,25 @@ ...@@ -5,24 +5,25 @@
<c:set var="ctx" value="${pageContext.request.contextPath}"/> <c:set var="ctx" value="${pageContext.request.contextPath}"/>
<EF:EFPage title="实时库存管理"> <EF:EFPage title="产品库存管理">
<EF:EFRegion id="inqu" title="查询条件"> <EF:EFRegion id="inqu" title="查询条件">
<div class="row"> <div class="row">
<EF:EFInput blockId="inqu_status" ename="projCode" colWidth="3" cname="项目编号:" />
<EF:EFInput blockId="inqu_status" ename="projName" colWidth="3" cname="项目名称:" />
<EF:EFInput blockId="inqu_status" ename="prodNo" colWidth="3" cname="生产单号:" />
<EF:EFSelect ename="inqu_status-0-whCode" cname="仓库名称" colWidth="3" filter="contains" defultValue=""> <EF:EFSelect ename="inqu_status-0-whCode" cname="仓库名称" colWidth="3" filter="contains" defultValue="">
<EF:EFOption label="全部" value=""/> <EF:EFOption label="全部" value=""/>
<EF:EFOptions blockId="wh_record_block_id" textField="textField" valueField="valueField"/> <EF:EFOptions blockId="wh_record_block_id" textField="textField" valueField="valueField"/>
</EF:EFSelect> </EF:EFSelect>
<EF:EFSelect ename="inqu_status-0-inventType" cname="存货类型" colWidth="3" filter="contains"> </div>
<EF:EFOption label="全部" value=""/> <div class="row">
<EF:EFCodeOption codeName="hpjx.hpkc.inventType"/> <EF:EFSelect ename="inqu_status-0-inventCode" cname="部件名称" colWidth="3" filter="contains" defultValue="">
</EF:EFSelect>
<EF:EFSelect ename="inqu_status-0-inventCode" cname="存货名称" colWidth="3" filter="contains" defultValue="">
<EF:EFOption label="全部" value=""/> <EF:EFOption label="全部" value=""/>
<EF:EFOptions blockId="material_record_block_id" textField="textField" valueField="valueField"/> <EF:EFOptions blockId="material_record_block_id" textField="textField" valueField="valueField"/>
</EF:EFSelect> </EF:EFSelect>
<EF:EFSelect ename="inqu_status-0-spec" cname="规格" colWidth="3" filter="contains" defultValue=""> <EF:EFSelect ename="inqu_status-0-subInventCode" cname="零部件名称" colWidth="3" filter="contains" defultValue="">
<EF:EFOption label="全部" value=""/> <EF:EFOption label="全部" value=""/>
<EF:EFOptions blockId="spec_name_block_id" textField="textField" valueField="valueField"/> <EF:EFOptions blockId="material_record_block_id" textField="textField" valueField="valueField"/>
</EF:EFSelect> </EF:EFSelect>
</div> </div>
</EF:EFRegion> </EF:EFRegion>
...@@ -30,21 +31,23 @@ ...@@ -30,21 +31,23 @@
<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="内码" hidden="true"/>
<EF:EFColumn ename="inventRecordId" cname="存货档案ID" hidden="true"/> <EF:EFColumn ename="prodNo" cname="生产单号" width="120" align="center" required="true"/>
<EF:EFComboColumn ename="whCode" cname="仓库编码" width="120" columnTemplate="#=textField#" <EF:EFComboColumn ename="whCode" cname="仓库编码" width="120" columnTemplate="#=textField#"
itemTemplate="#=textField#" blockName="wh_record_block_id" itemTemplate="#=textField#" blockName="wh_record_block_id"
textField="textField" valueField="valueField" textField="textField" valueField="valueField"
align="center" filter="contains"> align="center" filter="contains" required="true">
</EF:EFComboColumn>
<EF:EFComboColumn ename="inventType" cname="存货类型" width="100" align="center" required="true">
<EF:EFCodeOption codeName="hpjx.hpkc.inventType"/>
</EF:EFComboColumn> </EF:EFComboColumn>
<EF:EFColumn ename="inventCode" cname="存货名称" width="120" align="center" required="true"/> <EF:EFColumn ename="projCode" cname="项目编号" width="120" align="center" required="true"/>
<EF:EFColumn ename="spec" cname="规格" width="120" align="center"/> <EF:EFColumn ename="projName" cname="项目名称" width="120" align="center" required="true"/>
<EF:EFColumn ename="material" cname="材质" width="120" align="center"/> <EF:EFColumn ename="inventCode" cname="部件名称" width="120" align="center" required="true"/>
<EF:EFColumn ename="unit" cname="单位" width="120" align="center"/> <EF:EFColumn ename="subInventCode" cname="零部件名称" width="120" align="center" required="true"/>
<EF:EFColumn ename="amount" cname="数量" format="{0:N3}" maxLength="20" width="90" align="right"/> <EF:EFColumn ename="length" cname="长" format="{0:N3}" maxLength="20" width="90" align="right"/>
<EF:EFColumn ename="width" cname="宽" format="{0:N3}" maxLength="20" width="90" align="right"/>
<EF:EFColumn ename="thich" cname="厚" format="{0:N3}" maxLength="20" width="90" align="right"/>
<EF:EFColumn ename="amount" cname="数量" format="{0:N3}" maxLength="20" width="90" align="right" required="true"/>
<EF:EFColumn ename="unitWeight" cname="单重" format="{0:N3}" maxLength="20" width="90" align="right"/>
<EF:EFColumn ename="weight" cname="重量" format="{0:N3}" maxLength="20" width="90" align="right"/> <EF:EFColumn ename="weight" cname="重量" format="{0:N3}" maxLength="20" width="90" align="right"/>
<EF:EFColumn ename="remark" cname="备注" width="120" align="center"/>
<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']"/>
...@@ -53,5 +56,4 @@ ...@@ -53,5 +56,4 @@
editType="datetime" parseFormats="['yyyyMMddHHmmss']"/> editType="datetime" parseFormats="['yyyyMMddHHmmss']"/>
</EF:EFGrid> </EF:EFGrid>
</EF:EFRegion> </EF:EFRegion>
</EF:EFPage> </EF:EFPage>
<!DOCTYPE html> <!DOCTYPE html>
<%@ page contentType="text/html;charset=UTF-8" %> <%@ page contentType="text/html;charset=UTF-8" %>
<%@ page import="com.baosight.hpjx.hp.kc.tools.CKExcelTools" %> <%@ page import="com.baosight.hpjx.hp.kc.tools.CKExcelTools" %>
<%@ page import="com.baosight.iplat4j.core.exception.PlatException" %>
<% <%
try { try {
// 1.出库单
if ("1".equals(request.getParameter("route"))) {
CKExcelTools.downloadFile(pageContext); CKExcelTools.downloadFile(pageContext);
} else {
throw new PlatException("非法的路由信息");
}
out.clear(); out.clear();
out = pageContext.pushBody(); out = pageContext.pushBody();
} catch (Exception e) { } catch (Throwable e) {
request.setAttribute("iplat_msgKey", "ES001"); request.setAttribute("iplat_msgKey", "ES001");
request.setAttribute("iplat_msg", "出库单下载失败"); request.setAttribute("iplat_msg", "文件下载失败");
request.setAttribute("iplat_msgDetail", e.toString()); request.setAttribute("iplat_msgDetail", e.toString());
request.getRequestDispatcher("/EU/DM/EUDM30.jsp").forward(request, response); request.getRequestDispatcher("/EU/DM/EUDM30.jsp").forward(request, response);
} }
%> %>
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