Commit d23c3691 by 宋祥

Merge branch 'dev' of http://129.211.46.84:8800/platform/hg-smart into master-dc

# Conflicts:
#	src/main/resources/application.properties
#	src/main/resources/quartz.properties
parents ece82da3 b8643c38
......@@ -7,7 +7,8 @@ package com.baosight.hggp.common;
public enum InventorySource {
MANUAL_ENTRY(1,"手动录入"),
INVENTORY(2,"盘点"),
ALLOCATION(3,"调拨");
ALLOCATION(3,"调拨"),
PACKING_ORDER(4,"打包单");
private Integer code;
......
......@@ -50,7 +50,13 @@
PROJ_NAME as "projName", <!-- 项目名称 -->
CALCULATION_METHOD as "calculationMethod", <!-- 计算方式 0-数量乘单价 1-重量乘单价 -->
CANCEL_AMOUNT as "cancelAmount",
UN_CANCEL_AMOUNT as "unCancelAmount"
UN_CANCEL_AMOUNT as "unCancelAmount",
INVOICE_QTY as "invoiceQty",
INVOICE_WEIGHT as "invoiceWeight",
INVOICE_AMOUNT as "invoiceAmount",
INVOICE_REMAINING_QTY as "invoiceRemainingQty",
INVOICE_REMAINING_WEIGHT as "invoiceRemainingWeight",
INVOICE_REMAINING_AMOUNT as "invoiceRemainingAmount"
</sql>
<sql id="condition">
......@@ -273,7 +279,13 @@
PROJ_NAME, <!-- 项目名称 -->
CALCULATION_METHOD, <!-- 计算方式 0-数量乘单价 1-重量乘单价 -->
CANCEL_AMOUNT,
UN_CANCEL_AMOUNT
UN_CANCEL_AMOUNT,
INVOICE_QTY,
INVOICE_WEIGHT,
INVOICE_AMOUNT,
INVOICE_REMAINING_QTY,
INVOICE_REMAINING_WEIGHT,
INVOICE_REMAINING_AMOUNT
) VALUES (
#accountCode#, #depCode#, #createdBy#, #createdName#, #createdTime#, #deleteFlag#,
#companyCode#, #companyName#, #receiveDate#, #receiveNo#, #receiveLineNo#, #planNo#,
......@@ -282,7 +294,8 @@
#material#, #unit#, #length#, #width#, #thick#, #receiveQty#, #deliverQty#,
#depositQty#, #receiveUnitWeight#, #receiveWeight#, #status#, #price#, #amount#,
#taxIncludeAmount#, #taxAmount#, #taxRate#, #inventTypeDetail#, #primaryId#,
#isInvoicing#, #projCode#, #projName#, #calculationMethod#, #cancelAmount#, #unCancelAmount#
#isInvoicing#, #projCode#, #projName#, #calculationMethod#, #cancelAmount#, #unCancelAmount#,
#invoiceQty#, #invoiceWeight#, #invoiceAmount#, #invoiceRemainingQty#, #invoiceRemainingWeight#, #invoiceRemainingAmount#
)
</insert>
......@@ -327,6 +340,12 @@
IS_INVOICING = #isInvoicing#,
CANCEL_AMOUNT = #cancelAmount#,
UN_CANCEL_AMOUNT = #unCancelAmount#,
INVOICE_QTY = #invoiceQty#,
INVOICE_WEIGHT = #invoiceWeight#,
INVOICE_AMOUNT = #invoiceAmount#,
INVOICE_REMAINING_QTY = #invoiceRemainingQty#,
INVOICE_REMAINING_WEIGHT = #invoiceRemainingWeight#,
INVOICE_REMAINING_AMOUNT = #invoiceRemainingAmount#,
<include refid="updateRevise"/>
WHERE ID = #id#
</update>
......@@ -418,7 +437,13 @@
b.PUR_USER_ID as "purUserId", <!-- 采购员 -->
b.PUR_USER_NAME as "purUserName", <!-- 采购员名称 -->
a.CANCEL_AMOUNT as "cancelAmount",
a.UN_CANCEL_AMOUNT as "unCancelAmount"
a.UN_CANCEL_AMOUNT as "unCancelAmount",
a.INVOICE_QTY as "invoiceQty",
a.INVOICE_WEIGHT as "invoiceWeight",
a.INVOICE_AMOUNT as "invoiceAmount",
a.INVOICE_REMAINING_QTY as "invoiceRemainingQty",
a.INVOICE_REMAINING_WEIGHT as "invoiceRemainingWeight",
a.INVOICE_REMAINING_AMOUNT as "invoiceRemainingAmount"
FROM ${hggpSchema}.HGCG003A a
LEFT JOIN ${hggpSchema}.HGCG003 b ON a.PRIMARY_ID = b.id
WHERE 1=1
......
......@@ -195,6 +195,9 @@ public class HGConstant {
//采购询价单号
public static final String INQUIRY_NUMBER = "INQUIRY_NUMBER";
//打包单号
public static final String PACK_CODE = "PACK_CODE";
}
/**
......@@ -546,4 +549,18 @@ public class HGConstant {
// 已开票
public static final Integer S2 = 2;
}
/**
* 领料来源
*
* @author:jhs
* @date:2024/10/27,13:57
*/
public static class ReceiveDataSource {
// 库存
public static final Integer S1 = 1;
// 产品清单
public static final Integer S2 = 2;
}
}
......@@ -108,13 +108,13 @@ public class HGSqlConstant {
// 收货完成
public static final String UPDATE_CONFIRM = MODULE_NAME + "updateConfirm";
}
/**
* @author:songx
* @date:2024/8/30,16:25
*/
public class HgCg003A {
// 模块名称:HGCW003A
private static final String MODULE_NAME = "HGCG003A.";
//
......@@ -560,6 +560,22 @@ public class HGSqlConstant {
}
/**
* HGKC010 SQL 定义
*
* @author:jhs
* @date:2024/10/27,16:45
*/
public class HGSC004A {
// 模块名称
private static final String MODULE_NAME = "HGSC004A.";
// 物料清单查询
public static final String QUERY_MATERIAL = MODULE_NAME + "queryMaterial";
// 锁
public static final String LOCKS = MODULE_NAME + "locks";
}
/**
* @author:songx
* @date:2024/2/5,10:16
*/
......@@ -614,7 +630,7 @@ public class HGSqlConstant {
* @date:2024/10/22,16:05
*/
public class HGZL004 {
// 锁
public static final String LOCK = "HGZL004.lock";
}
......@@ -626,7 +642,7 @@ public class HGSqlConstant {
* @date:2024/5/8,10:55
*/
public class HgXsUser {
// 查询
public static final String GET_BY_LOGIN = "HGXSUser.getByLogin";
// 查询
......@@ -656,7 +672,7 @@ public class HGSqlConstant {
* @date:2024/1/20,16:45
*/
public class HgXsOrg {
// 查询组织机构
public static final String GET = "HGXSOrg.get";
// 查询组织机构
......
......@@ -51,6 +51,14 @@ public class HGCW013 extends DaoEPBase {
public static final String FIELD_SPEC = "spec"; /* 规格*/
public static final String FIELD_CONTRACT_NO = "contractNo"; /* 合同号*/
//页面取值字段
public static final String FIELD_SAVE_INVOICE_QTY = "saveInvoiceQty"; /* 收票数量*/
public static final String FIELD_SAVE_INVOICE_WEIGHT = "saveInvoiceWeight"; /* 收票重量*/
public static final String FIELD_SAVE_INVOICE_AMOUNT = "saveInvoiceAmount"; /* 收票金额*/
public static final String FIELD_INVOICE_REMAINING_QTY = "invoiceRemainingQty"; /* 收票剩余数量*/
public static final String FIELD_INVOICE_REMAINING_WEIGHT = "invoiceRemainingWeight"; /* 收票剩余重量*/
public static final String FIELD_INVOICE_REMAINING_AMOUNT = "invoiceRemainingAmount"; /* 收票剩余金额*/
public static final String COL_ID = "ID";
public static final String COL_MAIN_ID = "MAIN_ID"; /* 主表ID*/
public static final String COL_ACCOUNT_CODE = "ACCOUNT_CODE"; /* 企业编码*/
......@@ -104,6 +112,14 @@ public class HGCW013 extends DaoEPBase {
private String spec = " "; /* 规格*/
private String contractNo = " "; /* 合同号*/
//页面取值字段
private BigDecimal saveInvoiceQty = new BigDecimal("0"); /* 收票数量*/
private BigDecimal saveInvoiceWeight = new BigDecimal("0"); /* 收票重量*/
private BigDecimal saveInvoiceAmount = new BigDecimal("0"); /* 收票金额*/
private BigDecimal invoiceRemainingQty = new BigDecimal("0"); /* 收票剩余数量*/
private BigDecimal invoiceRemainingWeight = new BigDecimal("0"); /* 收票剩余重量*/
private BigDecimal invoiceRemainingAmount = new BigDecimal("0"); /* 收票剩余金额*/
/**
* initialize the metadata.
*/
......@@ -213,6 +229,48 @@ public class HGCW013 extends DaoEPBase {
eiColumn = new EiColumn(FIELD_CONTRACT_NO);
eiColumn.setDescName("合同号");
eiMetadata.addMeta(eiColumn);
eiColumn = new EiColumn(FIELD_SAVE_INVOICE_QTY);
eiColumn.setType("N");
eiColumn.setScaleLength(0);
eiColumn.setFieldLength(20);
eiColumn.setDescName("收票数量");
eiMetadata.addMeta(eiColumn);
eiColumn = new EiColumn(FIELD_SAVE_INVOICE_WEIGHT);
eiColumn.setType("N");
eiColumn.setScaleLength(3);
eiColumn.setFieldLength(20);
eiColumn.setDescName("收票重量");
eiMetadata.addMeta(eiColumn);
eiColumn = new EiColumn(FIELD_SAVE_INVOICE_AMOUNT);
eiColumn.setType("N");
eiColumn.setScaleLength(2);
eiColumn.setFieldLength(12);
eiColumn.setDescName("收票金额");
eiMetadata.addMeta(eiColumn);
eiColumn = new EiColumn(FIELD_INVOICE_REMAINING_QTY);
eiColumn.setType("N");
eiColumn.setScaleLength(0);
eiColumn.setFieldLength(20);
eiColumn.setDescName("收票剩余数量");
eiMetadata.addMeta(eiColumn);
eiColumn = new EiColumn(FIELD_INVOICE_REMAINING_WEIGHT);
eiColumn.setType("N");
eiColumn.setScaleLength(3);
eiColumn.setFieldLength(20);
eiColumn.setDescName("收票剩余重量");
eiMetadata.addMeta(eiColumn);
eiColumn = new EiColumn(FIELD_INVOICE_REMAINING_AMOUNT);
eiColumn.setType("N");
eiColumn.setScaleLength(2);
eiColumn.setFieldLength(12);
eiColumn.setDescName("收票剩余金额");
eiMetadata.addMeta(eiColumn);
}
/**
......@@ -576,6 +634,54 @@ public class HGCW013 extends DaoEPBase {
this.contractNo = contractNo;
}
public BigDecimal getSaveInvoiceQty() {
return saveInvoiceQty;
}
public void setSaveInvoiceQty(BigDecimal saveInvoiceQty) {
this.saveInvoiceQty = saveInvoiceQty;
}
public BigDecimal getSaveInvoiceWeight() {
return saveInvoiceWeight;
}
public void setSaveInvoiceWeight(BigDecimal saveInvoiceWeight) {
this.saveInvoiceWeight = saveInvoiceWeight;
}
public BigDecimal getSaveInvoiceAmount() {
return saveInvoiceAmount;
}
public void setSaveInvoiceAmount(BigDecimal saveInvoiceAmount) {
this.saveInvoiceAmount = saveInvoiceAmount;
}
public BigDecimal getInvoiceRemainingQty() {
return invoiceRemainingQty;
}
public void setInvoiceRemainingQty(BigDecimal invoiceRemainingQty) {
this.invoiceRemainingQty = invoiceRemainingQty;
}
public BigDecimal getInvoiceRemainingWeight() {
return invoiceRemainingWeight;
}
public void setInvoiceRemainingWeight(BigDecimal invoiceRemainingWeight) {
this.invoiceRemainingWeight = invoiceRemainingWeight;
}
public BigDecimal getInvoiceRemainingAmount() {
return invoiceRemainingAmount;
}
public void setInvoiceRemainingAmount(BigDecimal invoiceRemainingAmount) {
this.invoiceRemainingAmount = invoiceRemainingAmount;
}
/**
* get the value from Map.
*
......@@ -609,6 +715,13 @@ public class HGCW013 extends DaoEPBase {
setInventName(StringUtils.defaultIfEmpty(StringUtils.toString(map.get(FIELD_INVENT_NAME)), inventName));
setSpec(StringUtils.defaultIfEmpty(StringUtils.toString(map.get(FIELD_SPEC)), spec));
setContractNo(StringUtils.defaultIfEmpty(StringUtils.toString(map.get(FIELD_CONTRACT_NO)), contractNo));
//页面取值字段
setSaveInvoiceQty(NumberUtils.toBigDecimal(StringUtils.toString(map.get(FIELD_SAVE_INVOICE_QTY)), saveInvoiceQty));
setSaveInvoiceWeight(NumberUtils.toBigDecimal(StringUtils.toString(map.get(FIELD_SAVE_INVOICE_WEIGHT)), saveInvoiceWeight));
setSaveInvoiceAmount(NumberUtils.toBigDecimal(StringUtils.toString(map.get(FIELD_SAVE_INVOICE_AMOUNT)), saveInvoiceAmount));
setInvoiceRemainingQty(NumberUtils.toBigDecimal(StringUtils.toString(map.get(FIELD_INVOICE_REMAINING_QTY)), invoiceRemainingQty));
setInvoiceRemainingWeight(NumberUtils.toBigDecimal(StringUtils.toString(map.get(FIELD_INVOICE_REMAINING_WEIGHT)), invoiceRemainingWeight));
setInvoiceRemainingAmount(NumberUtils.toBigDecimal(StringUtils.toString(map.get(FIELD_INVOICE_REMAINING_AMOUNT)), invoiceRemainingAmount));
}
/**
......@@ -644,6 +757,13 @@ public class HGCW013 extends DaoEPBase {
map.put(FIELD_SPEC, StringUtils.toString(spec, eiMetadata.getMeta(FIELD_SPEC)));
map.put(FIELD_CONTRACT_NO, StringUtils.toString(contractNo, eiMetadata.getMeta(FIELD_CONTRACT_NO)));
map.put(FIELD_SAVE_INVOICE_QTY, StringUtils.toString(saveInvoiceQty, eiMetadata.getMeta(FIELD_SAVE_INVOICE_QTY)));
map.put(FIELD_SAVE_INVOICE_WEIGHT, StringUtils.toString(saveInvoiceWeight, eiMetadata.getMeta(FIELD_SAVE_INVOICE_WEIGHT)));
map.put(FIELD_SAVE_INVOICE_AMOUNT, StringUtils.toString(saveInvoiceAmount, eiMetadata.getMeta(FIELD_SAVE_INVOICE_AMOUNT)));
map.put(FIELD_INVOICE_REMAINING_QTY, StringUtils.toString(invoiceRemainingQty, eiMetadata.getMeta(FIELD_INVOICE_REMAINING_QTY)));
map.put(FIELD_INVOICE_REMAINING_WEIGHT, StringUtils.toString(invoiceRemainingWeight, eiMetadata.getMeta(FIELD_INVOICE_REMAINING_WEIGHT)));
map.put(FIELD_INVOICE_REMAINING_AMOUNT, StringUtils.toString(invoiceRemainingAmount, eiMetadata.getMeta(FIELD_INVOICE_REMAINING_AMOUNT)));
return map;
}
}
......@@ -134,6 +134,9 @@ public class ServiceHGCW002 extends ServiceBase {
HGCW002.getContractType() +
SequenceGenerator.getNextSequence(HGConstant.SequenceId.CW_CONTRACT_NO);
HGCW002.setContractNumber(contractNumber);
}else {
HGCW002 hgcw002 = HGCWTools.HgCw002.getContractNumber(HGCW002.getContractNumber());
AssertUtils.isTrue(hgcw002!=null, "合同编号:[" + HGCW002.getContractNumber() + "]已存在!");
}
HGCW002.setReviewStatus(0);
......@@ -144,7 +147,14 @@ public class ServiceHGCW002 extends ServiceBase {
HGCWTools.HgCw003.save(detail1Rows, HGCW002.getContractNumber(), HGCW002);
HGCWTools.HgCw999.batchUpdate(detail2Rows, HGCW002.getId());
} else {
if (HGCW002.getContractNumber().trim().isEmpty()){
AssertUtils.isTrue(true, "合同编号不能为空!");
}else {
HGCW002 hgcw002 = HGCWTools.HgCw002.getContractNumber(HGCW002.getContractNumber());
if (hgcw002 != null && !hgcw002.getId().equals(HGCW002.getId())){
AssertUtils.isTrue(true, "合同编号:[" + HGCW002.getContractNumber() + "]已存在!");
}
}
BigDecimal totalContractPriceExcluding = new BigDecimal(0);
BigDecimal totalContractPriceIncluding = new BigDecimal(0);
BigDecimal valueAddedTax = new BigDecimal(0);
......
......@@ -131,9 +131,12 @@ public class ServiceHGCW010 extends ServiceBase {
AssertUtils.isNull(HGSC001, "项目编码[" + hgcw010.getProjCode() + "]不存在");
hgcw010.setProjName(HGSC001.getProjName());
}
hgcw010.setBillState(HGConstant.BillStatus.S1);
if (StringUtils.isNotBlank(hgcw010.getBillNumber())){
hgcw010.setBillState(HGConstant.BillStatus.S2);
}
hgcw010.setSigningDate(DateUtils.formatShort(hgcw010.getSigningDate()));
if (hgcw010.getId() == null || hgcw010.getId() == 0) {
hgcw010.setBillState(HGConstant.BillStatus.S1);
hgcw010.setReviewStatus(ReviewStatusEnum.UNREVIEWED.getCode());
this.add(hgcw010);
} else {
......
......@@ -12,11 +12,13 @@ import com.baosight.hggp.hg.cg.constant.HgCgConst;
import com.baosight.hggp.hg.cg.domain.HGCG003;
import com.baosight.hggp.hg.cg.domain.HGCG003B;
import com.baosight.hggp.hg.cg.tools.HGCGTools;
import com.baosight.hggp.hg.cg.utils.HGCGUtils;
import com.baosight.hggp.hg.constant.HGConstant;
import com.baosight.hggp.hg.constant.HGSqlConstant;
import com.baosight.hggp.hg.cw.domain.*;
import com.baosight.hggp.hg.cw.tools.HGCWTools;
import com.baosight.hggp.hg.cw.vo.UserVO;
import com.baosight.hggp.hg.sc.tools.HGSCTools;
import com.baosight.hggp.hg.xs.domain.Company;
import com.baosight.hggp.util.*;
import com.baosight.iplat4j.core.ei.EiConstant;
......@@ -246,7 +248,7 @@ public class ServiceHGCW012 extends ServiceBase {
}
}
DaoUtils.update(HGCW012.DELETE, hgcw012);
}
inInfo.setStatus(EiConstant.STATUS_DEFAULT);
inInfo.setMsg("操作成功!本次对[" + resultRows.size() + "]条数据删除成功!");
......@@ -408,17 +410,44 @@ public class ServiceHGCW012 extends ServiceBase {
//hgcw012.setRemainingAmount(new BigDecimal(decimalFormat.format(totalContractPriceIncluding)));
DaoUtils.insert(HGCW012.INSERT, hgcw012);
List<HGCG003B> hgcg003BList = MapUtils.toDaoEPBases(inInfo, HGCG003B.class);
Map<Long, HGCG003B> dbCg003BMap = HGCGUtils.HgCg003B.lockGetDataEp(hgcg003BList);
//生成明细表
for (HGCW013 hgcw013 : hgcw013List) {
HGCG003B hgcg003B = dbCg003BMap.get(hgcw013.getId());
hgcw013.setMainId(hgcw012.getId());
//跟新采购收票状态
Map<String, Object> paramMap = new HashMap<>();
paramMap.put(HGCG003B.FIELD_RECEIVE_NO, hgcw013.getSettlementNumber());
paramMap.put(HGCG003B.FIELD_IS_INVOICING, HGConstant.CgIsInvoicing.S_1);
paramMap.put(HGCG003B.FIELD_IS_INVOICING, HGConstant.CgIsInvoicing.S_0);
paramMap.put(HGCG003B.FIELD_CANCEL_AMOUNT, hgcw013.getTotalContractPriceIncluding());
paramMap.put(HGCG003B.FIELD_UN_CANCEL_AMOUNT, 0);
paramMap.put(HGCG003B.FIELD_ID, hgcw013.getId());
if(Objects.nonNull(hgcg003B)){
paramMap.put(HGCG003B.FIELD_INVOICE_QTY, hgcg003B.getInvoiceQty().add(hgcw013.getSaveInvoiceQty()));
paramMap.put(HGCG003B.FIELD_INVOICE_WEIGHT, hgcg003B.getInvoiceWeight().add(hgcw013.getSaveInvoiceWeight()));
paramMap.put(HGCG003B.FIELD_INVOICE_AMOUNT, hgcg003B.getInvoiceAmount().add(hgcw013.getSaveInvoiceAmount()));
if(hgcg003B.getInvoiceRemainingQty().compareTo(BigDecimal.ZERO) > 0){
paramMap.put(HGCG003B.FIELD_INVOICE_REMAINING_QTY, hgcg003B.getInvoiceRemainingQty().subtract(hgcw013.getSaveInvoiceQty()));
}else{
paramMap.put(HGCG003B.FIELD_INVOICE_REMAINING_QTY, hgcg003B.getReceiveQty().subtract(hgcw013.getSaveInvoiceQty()));
}
if(hgcg003B.getInvoiceRemainingWeight().compareTo(BigDecimal.ZERO) > 0){
paramMap.put(HGCG003B.FIELD_INVOICE_REMAINING_WEIGHT, hgcg003B.getInvoiceRemainingWeight().subtract(hgcw013.getSaveInvoiceWeight()));
}else{
paramMap.put(HGCG003B.FIELD_INVOICE_REMAINING_WEIGHT, hgcg003B.getReceiveWeight().subtract(hgcw013.getSaveInvoiceWeight()));
}
if(hgcg003B.getInvoiceRemainingAmount().compareTo(BigDecimal.ZERO) > 0){
paramMap.put(HGCG003B.FIELD_INVOICE_REMAINING_AMOUNT, hgcg003B.getInvoiceRemainingAmount().subtract(hgcw013.getSaveInvoiceAmount()));
}else{
paramMap.put(HGCG003B.FIELD_INVOICE_REMAINING_AMOUNT, hgcg003B.getAmount().subtract(hgcw013.getSaveInvoiceAmount()));
}
//收货金额等于开票金额
if(hgcg003B.getAmount().compareTo(hgcg003B.getInvoiceAmount().add(hgcw013.getSaveInvoiceAmount())) == 0){
paramMap.put(HGCG003B.FIELD_IS_INVOICING, HGConstant.CgIsInvoicing.S_1);
}
}
DaoUtils.update(HGSqlConstant.HgCg003A.UPDATE_IS_INVOICING, paramMap);
hgcw013.setId(null);
this.addHGCW013(hgcw013);
......
......@@ -4,33 +4,33 @@
Version : 1.0
schema : hggp
tableName : HGCW008
ID BIGINT NOT NULL primarykey,
ACCOUNT_CODE VARCHAR,
COMPANY_CODE VARCHAR,
COMPANY_NAME VARCHAR,
PROJ_CODE VARCHAR,
PROJ_NAME VARCHAR,
CONTRACT_NUMBER VARCHAR,
CONTRACT_NAME VARCHAR,
SETTLEMENT_NUMBER VARCHAR,
SETTLEMENT_TYPE TINYINT,
CONTRACT_DATE VARCHAR,
TAX_POINTS INTEGER,
PRICE_TAX_SEPARATION INTEGER,
THIS_SETTLEMENT_AMOUNT DECIMAL,
THIS_SETTLEMENT_TAX DECIMAL,
THIS_PRICE_TAX DECIMAL,
TOTAL_CONTRACT_PRICE DECIMAL,
CUMULATIVE_SETTLEMENT_AMOUNT DECIMAL,
CUMULATIVE_SETTLEMENT_TAX DECIMAL,
CUMULATIVE_PRICE_TAX DECIMAL,
REVIEW_STATUS TINYINT,
CREATED_BY VARCHAR NOT NULL,
CREATED_NAME VARCHAR NOT NULL,
CREATED_TIME VARCHAR NOT NULL,
UPDATED_BY VARCHAR NOT NULL,
UPDATED_NAME VARCHAR NOT NULL,
UPDATED_TIME VARCHAR NOT NULL,
ID BIGINT NOT NULL primarykey,
ACCOUNT_CODE VARCHAR,
COMPANY_CODE VARCHAR,
COMPANY_NAME VARCHAR,
PROJ_CODE VARCHAR,
PROJ_NAME VARCHAR,
CONTRACT_NUMBER VARCHAR,
CONTRACT_NAME VARCHAR,
SETTLEMENT_NUMBER VARCHAR,
SETTLEMENT_TYPE TINYINT,
CONTRACT_DATE VARCHAR,
TAX_POINTS INTEGER,
PRICE_TAX_SEPARATION INTEGER,
THIS_SETTLEMENT_AMOUNT DECIMAL,
THIS_SETTLEMENT_TAX DECIMAL,
THIS_PRICE_TAX DECIMAL,
TOTAL_CONTRACT_PRICE DECIMAL,
CUMULATIVE_SETTLEMENT_AMOUNT DECIMAL,
CUMULATIVE_SETTLEMENT_TAX DECIMAL,
CUMULATIVE_PRICE_TAX DECIMAL,
REVIEW_STATUS TINYINT,
CREATED_BY VARCHAR NOT NULL,
CREATED_NAME VARCHAR NOT NULL,
CREATED_TIME VARCHAR NOT NULL,
UPDATED_BY VARCHAR NOT NULL,
UPDATED_NAME VARCHAR NOT NULL,
UPDATED_TIME VARCHAR NOT NULL,
DEP_CODE VARCHAR
-->
<sqlMap namespace="HGCW012A">
......@@ -456,7 +456,13 @@
A.IS_INVOICING as "isInvoicing",
A.CALCULATION_METHOD as "calculationMethod", <!-- 计算方式 0-数量乘单价 1-重量乘单价 -->
A.CANCEL_AMOUNT as "cancelAmount",
A.UN_CANCEL_AMOUNT as "unCancelAmount"
A.UN_CANCEL_AMOUNT as "unCancelAmount",
A.INVOICE_QTY as "invoiceQty",
A.INVOICE_WEIGHT as "invoiceWeight",
A.INVOICE_AMOUNT as "invoiceAmount",
A.INVOICE_REMAINING_QTY as "invoiceRemainingQty",
A.INVOICE_REMAINING_WEIGHT as "invoiceRemainingWeight",
A.INVOICE_REMAINING_AMOUNT as "invoiceRemainingAmount"
FROM ${hggpSchema}.HGCG003A A LEFT JOIN ${hggpSchema}.HGCG003 B ON A.PRIMARY_ID = B.ID
WHERE A.DELETE_FLAG = 0 and b.delete_flag = 0
<isNotEmpty prepend=" AND " property="id">
......
......@@ -59,4 +59,27 @@ public class HgKcConst {
public static final Integer S3 = 3;
}
}
/**
* HGKC014 定义
*
* @author:songx
* @date:2024/1/20,16:45
*/
public static class HgKc017 {
/**
* 提交状态
*
* @author:songx
* @date:2024/5/15,15:18
*/
public static class Status {
// 未提交
public static final Integer S0 = 0;
// 已提交
public static final Integer S1 = 1;
}
}
}
......@@ -54,6 +54,8 @@ public class HGKC004A extends DaoEPBase {
public static final String FIELD_PROJ_CODE = "projCode"; /* 项目编码*/
public static final String FIELD_PROJ_NAME = "projName"; /* 项目名称*/
public static final String FIELD_INVENT_TYPE_DETAIL = "inventTypeDetail"; /*存货类型明细*/
public static final String FIELD_SOURCE = "source"; /* 数据来源*/
public static final String FIELD_SOURCE_ID = "sourceId"; /* 数据来源*/
public static final String COL_ID = "ID"; /* ID*/
public static final String COL_ACCOUNT_CODE = "ACCOUNT_CODE"; /* 企业编码*/
......@@ -128,6 +130,9 @@ public class HGKC004A extends DaoEPBase {
private String projCode = " "; /* 项目编码*/
private String projName = " "; /* 项目名称*/
private String inventTypeDetail;
private Integer source; /* 数据来源*/
private Long sourceId = new Long(0); /* 数据来源*/
......@@ -286,6 +291,14 @@ public class HGKC004A extends DaoEPBase {
eiColumn = new EiColumn(FIELD_INVENT_TYPE_DETAIL);
eiColumn.setDescName("存货类型明细");
eiMetadata.addMeta(eiColumn);
eiColumn = new EiColumn(FIELD_SOURCE);
eiColumn.setDescName("数据来源");
eiMetadata.addMeta(eiColumn);
eiColumn = new EiColumn(FIELD_SOURCE_ID);
eiColumn.setDescName("数据来源ID");
eiMetadata.addMeta(eiColumn);
}
/**
......@@ -751,6 +764,23 @@ public class HGKC004A extends DaoEPBase {
this.inventTypeDetail = inventTypeDetail;
}
public Integer getSource() {
return source;
}
public void setSource(Integer source) {
this.source = source;
}
public Long getSourceId() {
return sourceId;
}
public void setSourceId(Long sourceId) {
this.sourceId = sourceId;
}
/**
* get the value from Map.
*
......@@ -791,6 +821,9 @@ public class HGKC004A extends DaoEPBase {
setProjCode(StringUtils.defaultIfEmpty(StringUtils.toString(map.get(FIELD_PROJ_CODE)), projCode));
setProjName(StringUtils.defaultIfEmpty(StringUtils.toString(map.get(FIELD_PROJ_NAME)), projName));
setInventTypeDetail(StringUtils.defaultIfEmpty(StringUtils.toString(map.get(FIELD_INVENT_TYPE_DETAIL)), inventTypeDetail));
setSource(NumberUtils.toInteger(StringUtils.toString(map.get(FIELD_SOURCE)), source));
setSourceId(NumberUtils.toLong(StringUtils.toString(map.get(FIELD_SOURCE_ID)), sourceId));
}
/**
......@@ -832,6 +865,8 @@ public class HGKC004A extends DaoEPBase {
map.put(FIELD_PROJ_CODE, StringUtils.toString(projCode, eiMetadata.getMeta(FIELD_PROJ_CODE)));
map.put(FIELD_PROJ_NAME, StringUtils.toString(projName, eiMetadata.getMeta(FIELD_PROJ_NAME)));
map.put(FIELD_INVENT_TYPE_DETAIL,StringUtils.toString(inventTypeDetail, eiMetadata.getMeta(FIELD_INVENT_TYPE_DETAIL)));
map.put(FIELD_SOURCE, StringUtils.toString(source, eiMetadata.getMeta(FIELD_SOURCE)));
map.put(FIELD_SOURCE_ID, StringUtils.toString(sourceId, eiMetadata.getMeta(FIELD_SOURCE_ID)));
return map;
}
......
......@@ -44,6 +44,7 @@ public class HGKC008 extends DaoEPBase {
public static final String FIELD_PROJ_NAME = "projName"; /* 项目名称*/
public static final String FIELD_RECEIVE_USER_ID = "receiveUserId"; /* 领用人ID*/
public static final String FIELD_RECEIVE_USER_NAME = "receiveUserName"; /* 领用人姓名*/
public static final String FIELD_DATA_SOURCE= "dataSource"; /* 数据来源 1存货 2产品清单*/
public static final String COL_ID = "ID"; /* 主键id*/
public static final String COL_ACCOUNT_CODE = "ACCOUNT_CODE"; /* 账套*/
......@@ -98,6 +99,7 @@ public class HGKC008 extends DaoEPBase {
private String projName = " "; /* 项目名称*/
private String receiveUserId = " "; /* 领用人ID*/
private String receiveUserName = " "; /* 领用人姓名*/
private Integer dataSource = new Integer(0); /* 数据来源 1存货 2产品清单*/
/**
* initialize the metadata.
......@@ -184,14 +186,18 @@ public class HGKC008 extends DaoEPBase {
eiColumn = new EiColumn(FIELD_PROJ_NAME);
eiColumn.setDescName("项目名称");
eiMetadata.addMeta(eiColumn);
eiColumn = new EiColumn(FIELD_RECEIVE_USER_ID);
eiColumn.setDescName("领用人ID");
eiMetadata.addMeta(eiColumn);
eiColumn = new EiColumn(FIELD_RECEIVE_USER_NAME);
eiColumn.setDescName("领用人姓名");
eiMetadata.addMeta(eiColumn);
eiColumn = new EiColumn(FIELD_DATA_SOURCE);
eiColumn.setDescName("数据来源 1存货 2产品清单");
eiMetadata.addMeta(eiColumn);
}
/**
......@@ -505,23 +511,31 @@ public class HGKC008 extends DaoEPBase {
public void setProjName(String projName) {
this.projName = projName;
}
public String getReceiveUserId() {
return receiveUserId;
}
public void setReceiveUserId(String receiveUserId) {
this.receiveUserId = receiveUserId;
}
public String getReceiveUserName() {
return receiveUserName;
}
public void setReceiveUserName(String receiveUserName) {
this.receiveUserName = receiveUserName;
}
public Integer getDataSource() {
return dataSource;
}
public void setDataSource(Integer dataSource) {
this.dataSource = dataSource;
}
/**
* get the value from Map.
*
......@@ -552,6 +566,7 @@ public class HGKC008 extends DaoEPBase {
setProjName(StringUtils.defaultIfEmpty(StringUtils.toString(map.get(FIELD_PROJ_NAME)), projName));
setReceiveUserId(StringUtils.defaultIfEmpty(StringUtils.toString(map.get(FIELD_RECEIVE_USER_ID)), receiveUserId));
setReceiveUserName(StringUtils.defaultIfEmpty(StringUtils.toString(map.get(FIELD_RECEIVE_USER_NAME)), receiveUserName));
setDataSource(NumberUtils.toInteger(StringUtils.toString(map.get(FIELD_DATA_SOURCE)), dataSource));
}
/**
......@@ -583,6 +598,7 @@ public class HGKC008 extends DaoEPBase {
map.put(FIELD_PROJ_NAME, StringUtils.toString(projName, eiMetadata.getMeta(FIELD_PROJ_NAME)));
map.put(FIELD_RECEIVE_USER_ID, StringUtils.toString(receiveUserId, eiMetadata.getMeta(FIELD_RECEIVE_USER_ID)));
map.put(FIELD_RECEIVE_USER_NAME, StringUtils.toString(receiveUserName, eiMetadata.getMeta(FIELD_RECEIVE_USER_NAME)));
map.put(FIELD_DATA_SOURCE, StringUtils.toString(dataSource, eiMetadata.getMeta(FIELD_DATA_SOURCE)));
return map;
}
......
......@@ -8,9 +8,7 @@ import com.baosight.hggp.core.security.UserSessionUtils;
import com.baosight.hggp.hg.constant.HGConstant;
import com.baosight.hggp.hg.constant.HGSqlConstant;
import com.baosight.hggp.hg.cw.tools.HGCWTools;
import com.baosight.hggp.hg.kc.domain.HGKC004;
import com.baosight.hggp.hg.kc.domain.HGKC004A;
import com.baosight.hggp.hg.kc.domain.HGKC010;
import com.baosight.hggp.hg.kc.domain.*;
import com.baosight.hggp.hg.kc.tools.HGKCTools;
import com.baosight.hggp.hg.pz.domain.HGPZ005;
import com.baosight.hggp.hg.pz.tools.HGPZTools;
......@@ -18,6 +16,7 @@ import com.baosight.hggp.hg.sb.domain.HGSB001;
import com.baosight.hggp.hg.sb.domain.HGSB002;
import com.baosight.hggp.hg.sb.tools.HGSBTools;
import com.baosight.hggp.hg.xs.domain.Company;
import com.baosight.hggp.hg.yx.domain.HGYX001A;
import com.baosight.hggp.util.*;
import com.baosight.hggp.util.contants.ACConstants;
import com.baosight.iplat4j.core.ei.EiBlock;
......@@ -31,6 +30,7 @@ import org.apache.commons.collections.CollectionUtils;
import java.math.BigDecimal;
import java.util.*;
import java.util.stream.Collectors;
/**
* @author LiuYang
......@@ -171,24 +171,45 @@ public class ServiceHGKC004 extends ServiceEPBase {
HGCWTools.HgCw001.getAccountPeriod(kc004.getCompanyCode(),kc004.getReceiptDate());
List<HGKC004A> hgkc004s = HGKCTools.HgKc004.getDetailById(hgkc004.getId());
AssertUtils.isEmpty(hgkc004s, "销售出库单明细不存在!");
//查询打包单明细
List<Long> sourceIds = Optional.ofNullable(hgkc004s).orElse(new ArrayList<>()).stream().map(HGKC004A::getSourceId).collect(Collectors.toList());
List<HGKC016A> hgkc016as = HGKCTools.HgKc016a.getById(sourceIds);
for (HGKC004A hgkc004A : hgkc004s) {
if (hgkc004A.getPrice().compareTo(BigDecimal.ZERO) < 0 || hgkc004A.getAmount().compareTo(BigDecimal.ZERO) < 0){
throw new PlatException("单价和金额不能小于0!");
}
HGKC010 hgkc010 = HGKCTools.HgKc010.get(kc004.getCompanyCode(), kc004.getWhCode(), hgkc004A.getInventCode());
if (hgkc010 == null) {
throw new PlatException("库存不足!");
}
if (hgkc010.getInvQty().compareTo(hgkc004A.getQuantity()) < 0) {
throw new PlatException("库存不足,无法提交!");
}else if (hgkc010.getInvQty().compareTo(hgkc004A.getQuantity()) == 0) {
hgkc010.setInvQty(BigDecimal.ZERO);
hgkc010.setInvWeight(BigDecimal.ZERO);
// 2 打包单 1 实时库存
if (hgkc004A.getSource() == 2){
List<HGKC016A> hgkc016as1 = Optional.ofNullable(hgkc016as).orElse(new ArrayList<>()).stream().filter(hgkc016a -> hgkc016a.getId().equals(hgkc004A.getSourceId())).collect(Collectors.toList());
AssertUtils.isEmpty(hgkc016as1, "打包单明细库存不存在,无法保存!");
for (HGKC016A hgkc016a: hgkc016as1) {
HGKC016 hgkc016 = HGKCTools.HgKc016.getById(hgkc016a.getParentId());
hgkc016a.setInvQty(hgkc016a.getInvQty().subtract(hgkc004A.getQuantity()));
hgkc016a.setInvWeight(hgkc016a.getInvQty().multiply(hgkc004A.getUnitWeight()));
DaoUtils.update(HGKC016A.UPDATE_INV, hgkc016a);
if (hgkc016 != null){
hgkc016.setInvQty(hgkc016.getInvQty().subtract(hgkc004A.getQuantity()));
hgkc016.setInvWeight(hgkc016.getInvQty().multiply(hgkc004A.getUnitWeight()));
DaoUtils.update(HGKC016.UPDATE, hgkc016);
}
}
}else {
hgkc010.setInvQty(hgkc010.getInvQty().subtract(hgkc004A.getQuantity()));
hgkc010.setInvWeight(hgkc010.getInvQty().multiply(hgkc004A.getUnitWeight()));
HGKC010 hgkc010 = HGKCTools.HgKc010.get(kc004.getCompanyCode(), kc004.getWhCode(), hgkc004A.getInventCode());
if (hgkc010 == null) {
throw new PlatException("库存不足!");
}
if (hgkc010.getInvQty().compareTo(hgkc004A.getQuantity()) < 0) {
throw new PlatException("库存不足,无法提交!");
}else if (hgkc010.getInvQty().compareTo(hgkc004A.getQuantity()) == 0) {
hgkc010.setInvQty(BigDecimal.ZERO);
hgkc010.setInvWeight(BigDecimal.ZERO);
}else {
hgkc010.setInvQty(hgkc010.getInvQty().subtract(hgkc004A.getQuantity()));
hgkc010.setInvWeight(hgkc010.getInvQty().multiply(hgkc004A.getUnitWeight()));
}
DaoUtils.update(HGKC010.UPDATE_INV, hgkc010);
}
DaoUtils.update(HGKC010.UPDATE_INV, hgkc010);
}
DaoUtils.update(HGKC004.UPDATE_STATUS, hgkc004);
}
......
......@@ -117,7 +117,7 @@ public class ServiceHGKC008B extends ServiceBase {
}
return inInfo;
}
/**
* 确认数量
*
......@@ -149,10 +149,11 @@ public class ServiceHGKC008B extends ServiceBase {
newKc008A.setDeleteFlag(DeleteFlagEnum.UN_REMOVE.getCode());
newKc008A.setAccountCode("");
newKc008A.setDepCode("");
newKc008A.setDataSource(HGConstant.ReceiveDataSource.S1);
DaoUtils.insert(HGKC008A.INSERT, newKc008A);
}
}
/**
* 数据校验
*
......@@ -187,5 +188,5 @@ public class ServiceHGKC008B extends ServiceBase {
}
}
}
}
package com.baosight.hggp.hg.kc.service;
import com.baosight.hggp.aspect.annotation.OperationLogAnnotation;
import com.baosight.hggp.common.DdynamicEnum;
import com.baosight.hggp.common.InventTypeDetailEnum;
import com.baosight.hggp.core.constant.CommonConstant;
import com.baosight.hggp.core.dao.DaoUtils;
import com.baosight.hggp.core.enums.DeleteFlagEnum;
import com.baosight.hggp.core.security.UserSessionUtils;
import com.baosight.hggp.hg.constant.HGConstant;
import com.baosight.hggp.hg.constant.HGSqlConstant;
import com.baosight.hggp.hg.kc.constant.HgKcConst;
import com.baosight.hggp.hg.kc.domain.HGKC008;
import com.baosight.hggp.hg.kc.domain.HGKC008A;
import com.baosight.hggp.hg.kc.domain.HGKC010;
import com.baosight.hggp.hg.kc.tools.HGKCTools;
import com.baosight.hggp.hg.kc.utils.HGKCUtils;
import com.baosight.hggp.hg.sc.domain.HGSC004A;
import com.baosight.hggp.hg.sc.util.HgScUtils;
import com.baosight.hggp.hg.xs.domain.Company;
import com.baosight.hggp.util.*;
import com.baosight.hggp.util.contants.ACConstants;
import com.baosight.iplat4j.core.ei.EiConstant;
import com.baosight.iplat4j.core.ei.EiInfo;
import com.baosight.iplat4j.core.service.impl.ServiceBase;
import com.baosight.iplat4j.ed.util.SequenceGenerator;
import org.apache.commons.collections.CollectionUtils;
import java.math.BigDecimal;
import java.util.*;
import java.util.stream.Collectors;
/**
* @author:songx
* @date:2024/5/9,11:04
*/
public class ServiceHGKC008D extends ServiceBase {
/**
* 画面初始化
*
* @param inInfo
* @return
*/
@Override
@OperationLogAnnotation(operModul = "产品清单", operType = "查询", operDesc = "初始化")
public EiInfo initLoad(EiInfo inInfo) {
try {
Map map = new HashMap();
map.put("inventTypeDetails", InventTypeDetailEnum.getInentTypeTwo());
map.put(HGKC008.FIELD_ACCOUNT_CODE, UserSessionUtils.getAccountCode());
CommonMethod.initBlock(inInfo, Arrays.asList(DdynamicEnum.COMPANY_BOX_BLOCK_ID,
DdynamicEnum.PROJ_RECORD_BLOCK_ID, DdynamicEnum.PROJ_RECORD_BY_ROLE_BLOCK_ID,
DdynamicEnum.WH_RECORD_BLOCK_ID, DdynamicEnum.USER_BLOCK_ID,
DdynamicEnum.INVENT_TYPE_BLOCK_ID
), map, false
);
EiInfoUtils.addBlock(inInfo, "roleCompany", UserSessionUtils.getRoleCompany(), Company.class);
inInfo.addBlock(EiConstant.resultBlock).addBlockMeta(new HGSC004A().eiMetadata);
} catch (Exception 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);
inInfo = super.query(inInfo, HGSqlConstant.HGSC004A.QUERY_MATERIAL, new HGSC004A());
} catch (Exception e) {
LogUtils.setDetailMsg(inInfo, e, "查询失败");
}
return inInfo;
}
/**
* 确认操作.
*
* @param inInfo
* @return
*/
@OperationLogAnnotation(operModul = "产品清单", operType = "查询", operDesc = "确认")
public EiInfo confirm(EiInfo inInfo) {
try {
String receiveId = inInfo.getCellStr(EiConstant.queryBlock, ACConstants.ROW_CODE_0,
HGKC008A.FIELD_RECEIVE_ID);
List<HGSC004A> hgsc004as = MapUtils.toDaoEPBases(inInfo, HGSC004A.class);
// db数据
Map<Long, HGSC004A> dbSc004aMap = HgScUtils.HgSc004A.lockGetDataEp(hgsc004as);
// 领料明细
List<HGKC008A> dbKc008As = HGKCUtils.HgKc008A.listByPrimaryId(receiveId);
// 领料主信息
HGKC008 hgkc008 = HGKCUtils.HgKc008.get(receiveId);
List<String> inventCodes = new LinkedList<>();
dbSc004aMap.forEach((k,v) ->{
inventCodes.add(v.getProductCode());
});
// 实时库存数据
List<HGKC010> dbKc010s = HGKCTools.HgKc010.getListByBussiness(hgkc008.getCompanyCode(),
hgkc008.getWhCode(), inventCodes);
// 数据校验
this.checkConfirmData(hgsc004as, dbKc008As, dbSc004aMap, hgkc008,dbKc010s);
// 保存数据
this.confirmData(hgsc004as, dbKc010s, hgkc008);
inInfo = this.query(inInfo);
inInfo.setStatus(EiConstant.STATUS_DEFAULT);
inInfo.setMsg("操作成功!本次对[" + hgsc004as.size() + "]条数据保存成功!");
} catch (Exception e) {
LogUtils.setDetailMsg(inInfo, e, "保存失败");
}
return inInfo;
}
/**
* 确认数量
*
* @param hgsc004As
* @param dbKc010s
* @param dbKc008
*/
private void confirmData(List<HGSC004A> hgsc004As, List<HGKC010> dbKc010s, HGKC008 dbKc008) {
for (HGSC004A hgsc004A : hgsc004As) {
HGKC010 dbKc010 = dbKc010s.stream().filter(o -> o.getInventCode().equals(hgsc004A.getProductCode())).findAny().orElse(null);
HGKC008A newKc008A = BeanUtils.copy(dbKc010, HGKC008A.class);
newKc008A.setApplyCode(dbKc008.getApplyCode());
newKc008A.setApplyLineCode(SequenceGenerator.getNextSequence(HGConstant.SequenceId.SC_APPLY_LINE_CODE,
new String[]{dbKc008.getApplyCode()}));
newKc008A.setProjCode(dbKc008.getProjCode());
newKc008A.setProjName(dbKc008.getProjName());
newKc008A.setCompanyCode(dbKc008.getCompanyCode());
newKc008A.setCompanyName(dbKc008.getCompanyName());
newKc008A.setReceiveId(dbKc008.getId());
newKc008A.setInvId(dbKc010.getId());
newKc008A.setInvQty(hgsc004A.getApplyQty());
newKc008A.setInvWeight(hgsc004A.getApplyQty().multiply(dbKc010.getInvUnitWeight()));
newKc008A.setInvWidth(dbKc010.getWidth());
newKc008A.setInvLength(dbKc010.getLength());
newKc008A.setInvThick(dbKc010.getThick());
newKc008A.setInvSpec(dbKc010.getSpec());
newKc008A.setInvSpecId(dbKc010.getSpecId());
newKc008A.setDeleteFlag(DeleteFlagEnum.UN_REMOVE.getCode());
newKc008A.setAccountCode("");
newKc008A.setDepCode("");
newKc008A.setMatId(hgsc004A.getMaterialId());
newKc008A.setMatDetailId(hgsc004A.getId());
newKc008A.setDataSource(HGConstant.ReceiveDataSource.S2);
DaoUtils.insert(HGKC008A.INSERT, newKc008A);
}
}
/**
* 数据校验
*
* @param sc004As
* @param dbKc008As
* @param dbSc004Map
* @param dbKc008
*/
private void checkConfirmData(List<HGSC004A> sc004As, List<HGKC008A> dbKc008As, Map<Long, HGSC004A> dbSc004Map,
HGKC008 dbKc008,List<HGKC010> dbKc010s) {
AssertUtils.isEquals(dbKc008.getStatus(), HGConstant.ProductStatus.YTJ, "领料单已提交,不可修改");
for (HGSC004A sc004A : sc004As) {
HGKC010 hgkc010 = dbKc010s.stream().filter(o -> o.getInventCode().equals(sc004A.getProductCode())).findAny().orElse(null);
AssertUtils.isNull(hgkc010, String.format("库存【%s】不存在",
sc004A.getProductCode()));
AssertUtils.isGe(BigDecimal.ZERO, sc004A.getApplyQty(), String.format("库存【%s】申请数量必须大于0",
sc004A.getProductCode()));
// 查询已申请未提交的领料数量
List<HGKC008A> qtyKc008As = HGKCTools.HgKc008A.listByInv(hgkc010.getCompanyCode(), hgkc010.getWhCode(),
hgkc010.getInventCode());
BigDecimal applyQtySum = CollectionUtils.isEmpty(qtyKc008As) ? BigDecimal.ZERO
: qtyKc008As.stream().filter(item -> HgKcConst.HgKc008.Status.S0.equals(item.getStatus()))
.map(HGKC008A::getInvQty).reduce(BigDecimal.ZERO, BigDecimal::add);
BigDecimal totalApplyQty = applyQtySum.add(sc004A.getApplyQty());
AssertUtils.isGt(totalApplyQty, hgkc010.getInvQty(), String.format("存货【%s(%s)】累计申请数量【%s】超过库存数量【%s】",
hgkc010.getInventCode(), hgkc010.getInventName(),
totalApplyQty.stripTrailingZeros().toPlainString(), hgkc010.getInvQty()));
HGKC008A hgkc008a = dbKc008As.stream().filter(o -> o.getMatDetailId().intValue() == sc004A.getId().intValue()).findAny().orElse(null);
AssertUtils.isNotNull(hgkc008a,String.format("此领料单已选择存货:%s", sc004A.getProductCode()));
}
}
}
package com.baosight.hggp.hg.kc.service;
import com.baosight.hggp.common.DdynamicEnum;
import com.baosight.hggp.core.constant.CommonConstant;
import com.baosight.hggp.core.security.UserSessionUtils;
import com.baosight.hggp.hg.kc.domain.HGKC010;
import com.baosight.hggp.hg.kc.domain.HGKC016;
import com.baosight.hggp.hg.xs.domain.Company;
import com.baosight.hggp.util.*;
import com.baosight.hggp.util.contants.ACConstants;
import com.baosight.iplat4j.core.ei.EiConstant;
import com.baosight.iplat4j.core.ei.EiInfo;
import com.baosight.iplat4j.core.service.impl.ServiceEPBase;
import java.util.Arrays;
/**
* @author LiuYang
* @version 1.0 2024/10/24
* @description
*/
public class ServiceHGKC016 extends ServiceEPBase {
@Override
public EiInfo initLoad(EiInfo inInfo) {
try {
//Map<String, Object> paramMap = new HashMap<>();
//paramMap.put("inventTypeDetails", InventTypeDetailEnum.getInentTypeTwo());
CommonMethod.initBlock(inInfo, Arrays.asList(DdynamicEnum.PROJ_RECORD_BLOCK_ID,DdynamicEnum.USER_BLOCK_ID,DdynamicEnum.WH_RECORD_BLOCK_ID));
CommonMethod.initBlock(inInfo, Arrays.asList(DdynamicEnum.INVENT_CODE_BOX_BLOCK_ID,DdynamicEnum.INVENT_TYPE_BLOCK_ID),null, false);
EiInfoUtils.addBlock(inInfo,"roleCompany", UserSessionUtils.getRoleCompany(), Company.class);
inInfo.addBlock(EiConstant.resultBlock).addBlockMeta(new HGKC016().eiMetadata);
} catch (Exception e) {
LogUtils.setDetailMsg(inInfo, e, "初始化失败");
}
return inInfo;
}
@Override
public EiInfo query(EiInfo inInfo) {
inInfo.setCell(EiConstant.queryBlock, ACConstants.ROW_CODE_0, HGKC016.FIELD_DELETE_FLAG, CommonConstant.YesNo.NO_0);
return super.query(inInfo,HGKC016.QUERY,new HGKC016());
}
}
package com.baosight.hggp.hg.kc.service;
import com.baosight.hggp.common.DdynamicEnum;
import com.baosight.hggp.core.constant.CommonConstant;
import com.baosight.hggp.core.security.UserSessionUtils;
import com.baosight.hggp.hg.kc.domain.HGKC016A;
import com.baosight.hggp.hg.xs.domain.Company;
import com.baosight.hggp.util.CommonMethod;
import com.baosight.hggp.util.EiInfoUtils;
import com.baosight.hggp.util.LogUtils;
import com.baosight.hggp.util.contants.ACConstants;
import com.baosight.iplat4j.core.ei.EiConstant;
import com.baosight.iplat4j.core.ei.EiInfo;
import com.baosight.iplat4j.core.service.impl.ServiceEPBase;
import java.util.Arrays;
/**
* @author LiuYang
* @version 1.0 2024/10/24
* @description
*/
public class ServiceHGKC016A extends ServiceEPBase {
@Override
public EiInfo initLoad(EiInfo inInfo) {
try {
CommonMethod.initBlock(inInfo, Arrays.asList(DdynamicEnum.PROJ_RECORD_BLOCK_ID,DdynamicEnum.USER_BLOCK_ID,DdynamicEnum.WH_RECORD_BLOCK_ID));
CommonMethod.initBlock(inInfo, Arrays.asList(DdynamicEnum.INVENT_CODE_BOX_BLOCK_ID),null, false);
EiInfoUtils.addBlock(inInfo,"roleCompany", UserSessionUtils.getRoleCompany(), Company.class);
inInfo.addBlock(EiConstant.resultBlock).addBlockMeta(new HGKC016A().eiMetadata);
} catch (Exception e) {
LogUtils.setDetailMsg(inInfo, e, "初始化失败");
}
return inInfo;
}
@Override
public EiInfo query(EiInfo inInfo) {
inInfo.setCell(EiConstant.queryBlock, ACConstants.ROW_CODE_0, HGKC016A.FIELD_DELETE_FLAG, CommonConstant.YesNo.NO_0);
inInfo.setCell(EiConstant.queryBlock, ACConstants.ROW_CODE_0, "isInvQty", true);
return super.query(inInfo,HGKC016A.QUERY,new HGKC016A());
}
}
package com.baosight.hggp.hg.kc.service;
import com.baosight.hggp.common.DdynamicEnum;
import com.baosight.hggp.core.constant.CommonConstant;
import com.baosight.hggp.core.dao.DaoBase;
import com.baosight.hggp.core.dao.DaoUtils;
import com.baosight.hggp.core.security.UserSessionUtils;
import com.baosight.hggp.hg.kc.domain.HGKC010;
import com.baosight.hggp.hg.kc.domain.HGKC016A;
import com.baosight.hggp.hg.xs.domain.Company;
import com.baosight.hggp.util.CommonMethod;
import com.baosight.hggp.util.EiInfoUtils;
import com.baosight.hggp.util.LogUtils;
import com.baosight.hggp.util.MapUtils;
import com.baosight.hggp.util.contants.ACConstants;
import com.baosight.iplat4j.core.ei.EiConstant;
import com.baosight.iplat4j.core.ei.EiInfo;
import com.baosight.iplat4j.core.resource.I18nMessages;
import com.baosight.iplat4j.core.service.impl.ServiceEPBase;
import java.util.ArrayList;
import java.util.Arrays;
import java.util.List;
import java.util.Map;
/**
* @author LiuYang
* @version 1.0 2024/10/26
* @description
*/
public class ServiceHGKC016B extends ServiceEPBase {
@Override
public EiInfo initLoad(EiInfo inInfo) {
try {
CommonMethod.initBlock(inInfo, Arrays.asList(DdynamicEnum.INVENT_CODE_BOX_BLOCK_ID),null, false);
EiInfoUtils.addBlock(inInfo,"roleCompany", UserSessionUtils.getRoleCompany(), Company.class);
inInfo.addBlock(EiConstant.resultBlock).addBlockMeta(new HGKC016A().eiMetadata);
} catch (Exception e) {
LogUtils.setDetailMsg(inInfo, e, "初始化失败");
}
return inInfo;
}
@Override
public EiInfo query(EiInfo inInfo) {
inInfo.setCell(EiConstant.queryBlock, ACConstants.ROW_CODE_0, HGKC016A.FIELD_DELETE_FLAG, CommonConstant.YesNo.NO_0);
inInfo = super.query(inInfo,HGKC016A.QUERY,new HGKC016A());
List<Map> list = inInfo.addBlock(EiConstant.resultBlock).getRows();
List<HGKC016A> hgkc016As = new ArrayList<>();
for (Map map: list) {
HGKC016A hgkc016A = new HGKC016A();
hgkc016A.fromMap(map);
hgkc016A.setId(null);
hgkc016As.add(hgkc016A);
}
inInfo.getBlock(EiConstant.resultBlock).setRows(hgkc016As);
return inInfo;
}
public EiInfo save(EiInfo inInfo) {
try {
Map paramMap = EiInfoUtils.getFirstRow(inInfo);
List<Map> list = inInfo.getBlock(EiConstant.resultBlock).getRows();
for (Map map: list) {
HGKC016A hgkc016A = new HGKC016A();
hgkc016A.fromMap(map);
DaoUtils.insert(HGKC016A.INSERT, hgkc016A);
}
DaoUtils.update(HGKC016A.DELETE, paramMap);
inInfo.setStatus(EiConstant.STATUS_SUCCESS);
inInfo.setMsgByKey("ep.1000", new String[]{String.valueOf(list.size()), I18nMessages.getText("label.update", "保存")});
}catch (Exception e){
LogUtils.setDetailMsg(inInfo, e, "保存失败");
}
return inInfo;
}
}
package com.baosight.hggp.hg.kc.service;
import com.baosight.hggp.aspect.annotation.OperationLogAnnotation;
import com.baosight.hggp.common.DdynamicEnum;
import com.baosight.hggp.common.InventTypeDetailEnum;
import com.baosight.hggp.core.constant.CommonConstant;
import com.baosight.hggp.core.dao.DaoBase;
import com.baosight.hggp.core.dao.DaoUtils;
import com.baosight.hggp.core.security.UserSessionUtils;
import com.baosight.hggp.hg.kc.constant.HgKcConst;
import com.baosight.hggp.hg.kc.domain.HGKC010;
import com.baosight.hggp.hg.kc.domain.HGKC017;
import com.baosight.hggp.hg.kc.domain.HGKC017A;
import com.baosight.hggp.hg.kc.tools.HGKCTools;
import com.baosight.hggp.hg.xs.domain.Company;
import com.baosight.hggp.util.*;
import com.baosight.hggp.util.contants.ACConstants;
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.resource.I18nMessages;
import com.baosight.iplat4j.core.service.impl.ServiceEPBase;
import com.baosight.iplat4j.ed.util.SequenceGenerator;
import org.apache.commons.collections4.CollectionUtils;
import java.math.BigDecimal;
import java.math.MathContext;
import java.math.RoundingMode;
import java.util.*;
/**
* @author LiuYang
* @version 1.0 2024/10/24
* @description
*/
public class ServiceHGKC017A extends ServiceEPBase {
@Override
public EiInfo initLoad(EiInfo inInfo) {
try {
Map<String, Object> paramMap = new HashMap<>();
//paramMap.put("inventTypeDetails", InventTypeDetailEnum.getInentTypeTwo());
CommonMethod.initBlock(inInfo, Arrays.asList(DdynamicEnum.PROJ_RECORD_BLOCK_ID,DdynamicEnum.USER_BLOCK_ID));
CommonMethod.initBlock(inInfo, Arrays.asList(DdynamicEnum.INVENT_TYPE_BLOCK_ID,DdynamicEnum.INVENT_CODE_BOX_BLOCK_ID),paramMap);
EiInfoUtils.addBlock(inInfo,"roleCompany", UserSessionUtils.getRoleCompany(), Company.class);
inInfo.addBlock(EiConstant.resultBlock).addBlockMeta(new HGKC017A().eiMetadata);
} catch (Exception e) {
LogUtils.setDetailMsg(inInfo, e, "初始化失败");
}
return inInfo;
}
@Override
public EiInfo query(EiInfo inInfo) {
Map queryMap = EiInfoUtils.getFirstRow(inInfo);
queryMap.put(HGKC017A.FIELD_DELETE_FLAG, CommonConstant.YesNo.NO_0);
inInfo = super.query(inInfo,HGKC017A.QUERY,new HGKC017A());
List<HGKC017A> hgkc017AList = new ArrayList<>();
if (inInfo.getBlock(EiConstant.resultBlock).getRows().size() == 0) {
HGKC017 hgkc017 = HGKCTools.HgKc017.getById(Long.parseLong(queryMap.get(HGKC017A.FIELD_PARENT_ID).toString()));
HGKC010 hgkc010 = HGKCTools.HgKc010.get(hgkc017.getCompanyCode(), hgkc017.getWhCode(), hgkc017.getInventCode());
if (CollectionUtils.isNotEmpty(Collections.singleton(hgkc010))){
BigDecimal invQty = hgkc010.getInvQty();
BigDecimal packNum = hgkc017.getInvQty();
MathContext mc = new MathContext(0, RoundingMode.HALF_UP);
BigDecimal[] result = invQty.divideAndRemainder(packNum, mc);
for (int i = 0; i < result[0].intValue(); i++) {
HGKC017A hgkc017a = new HGKC017A();
hgkc017a.fromMap(hgkc010.toMap());
hgkc017a.setInvQty(packNum);
hgkc017a.setInvUnitWeight(hgkc010.getInvUnitWeight());
hgkc017a.setInvWeight(hgkc017.getInvQty().multiply(hgkc010.getInvUnitWeight()));
hgkc017a.setUnit(hgkc017.getUnit());
hgkc017a.setPackWay(hgkc017.getPackWay());
hgkc017a.setPackQuantity(BigDecimal.ONE);
hgkc017a.setId(null);
hgkc017AList.add(hgkc017a);
}
if (result[1].compareTo(BigDecimal.ZERO) > 0){
HGKC017A hgkc017a = new HGKC017A();
hgkc017a.fromMap(hgkc010.toMap());
hgkc017a.setInvQty(result[1]);
hgkc017a.setInvUnitWeight(hgkc010.getInvUnitWeight());
hgkc017a.setInvWeight(hgkc017.getInvQty().multiply(hgkc010.getInvUnitWeight()));
hgkc017a.setUnit(hgkc017.getUnit());
hgkc017a.setPackWay(hgkc017.getPackWay());
hgkc017a.setPackQuantity(BigDecimal.ONE);
hgkc017a.setId(null);
hgkc017AList.add(hgkc017a);
}
}
inInfo.getBlock(EiConstant.resultBlock).setRows(hgkc017AList);
}
return inInfo;
}
@OperationLogAnnotation(operModul = "打包单",operType = "删除",operDesc = "删除操作")
@Override
public EiInfo delete(EiInfo inInfo) {
try {
Map queryMap = EiInfoUtils.getFirstRow(inInfo);
HGKC017 hgkc017 = HGKCTools.HgKc017.getById(Long.parseLong(queryMap.get(HGKC017A.FIELD_PARENT_ID).toString()));
if (hgkc017 != null){
AssertUtils.isTrue(hgkc017.getStatus().equals(HgKcConst.HgKc017.Status.S1), "打包单已提交,不能删除!");
}
List<HGKC017A> hgkc017aList = MapUtils.toDaoEPBases(inInfo, EiConstant.resultBlock, HGKC017A.class);
for (HGKC017A hgkc017a : hgkc017aList) {
DaoUtils.update(HGKC017A.DELETE, hgkc017a);
}
inInfo.setStatus(EiConstant.STATUS_SUCCESS);
inInfo.setMsgByKey("ep.1000", new String[]{String.valueOf(hgkc017aList.size()), I18nMessages.getText("label.delete", "删除")});
} catch (PlatException e) {
LogUtils.setDetailMsg(inInfo, e, "删除失败");
}
return inInfo;
}
@OperationLogAnnotation(operModul = "打包单",operType = "保存",operDesc = "保存操作")
public EiInfo save(EiInfo inInfo) {
try {
Map queryMap = EiInfoUtils.getFirstRow(inInfo);
List<HGKC017A> hgkc017AList = MapUtils.toDaoEPBases(inInfo,HGKC017A.class);
// 写入数据
for (HGKC017A hgkc017A : hgkc017AList) {
if (hgkc017A.getId() == null || hgkc017A.getId() == 0) {
hgkc017A.setParentId(Long.parseLong(queryMap.get(HGKC017A.FIELD_PARENT_ID).toString()));
hgkc017A.setPackCode(queryMap.get(HGKC017A.FIELD_PACK_CODE).toString());
this.add(hgkc017A);
} else {
this.modify(hgkc017A);
}
}
inInfo.setStatus(EiConstant.STATUS_DEFAULT);
inInfo.setMsg("操作成功!本次对[" + hgkc017AList.size() + "]条数据保存成功!");
} catch (Exception e) {
LogUtils.setDetailMsg(inInfo, e, "保存失败");
}
return inInfo;
}
/**
* 新增操作
*/
public void add(HGKC017A hgkc017a) {
DaoUtils.insert(HGKC017A.INSERT, hgkc017a);
}
/**
* 修改操作
*/
public void modify(HGKC017A hgkc017a) {
DaoUtils.update(HGKC017A.UPDATE, hgkc017a);
}
public EiInfo getOnt(EiInfo inInfo) {
Map queryMap = EiInfoUtils.getFirstRow(inInfo);
List<HGKC010> list = DaoBase.getInstance().query(HGKC010.QUERY, queryMap);
inInfo.addBlock(CommonConstant.Field.DETAIL).setRows(list);
return inInfo;
}
}
......@@ -31,7 +31,9 @@
PARENT_ID as "parentId", <!-- 销售出库单ID -->
PRICE as "price", <!-- 单价 -->
AMOUNT as "amount", <!-- 金额 -->
INVENT_TYPE_DETAIL as "inventTypeDetail"
INVENT_TYPE_DETAIL as "inventTypeDetail",
SOURCE as "source",
SOURCE_ID as "sourceId"
</sql>
<sql id="condition">
......@@ -117,6 +119,12 @@
<isNotEmpty prepend=" AND " property="inventTypeDetail">
INVENT_TYPE_DETAIL = #inventTypeDetail#
</isNotEmpty>
<isNotEmpty prepend=" AND " property="source">
SOURCE = #source#
</isNotEmpty>
<isNotEmpty prepend=" AND " property="sourceId">
SOURCE_ID = #sourceId#
</isNotEmpty>
</sql>
<select id="query" parameterClass="HashMap" resultClass="HGKC004A">
......@@ -167,9 +175,14 @@
PARENT_ID, <!-- 销售出库单ID -->
PRICE, <!-- 单价 -->
AMOUNT, <!-- 金额 -->
INVENT_TYPE_DETAIL
INVENT_TYPE_DETAIL,
SOURCE,
SOURCE_ID
)
VALUES (#id#, #accountCode#, #depCode#, #createdBy#, #createdName#, #createdTime#, #updatedBy#, #updatedName#, #updatedTime#, #deleteFlag#, #companyCode#, #companyName#, #inventRecordId#, #inventType#, #inventCode#, #inventName#, #spec#, #length#, #width#, #thick#, #quantity#, #unitWeight#, #weight#, #parentId#, #price#, #amount#,#inventTypeDetail#)
VALUES (#id#, #accountCode#, #depCode#, #createdBy#, #createdName#, #createdTime#, #updatedBy#, #updatedName#,
#updatedTime#, #deleteFlag#, #companyCode#, #companyName#, #inventRecordId#, #inventType#, #inventCode#,
#inventName#, #spec#, #length#, #width#, #thick#, #quantity#, #unitWeight#, #weight#, #parentId#, #price#,
#amount#,#inventTypeDetail#, #source#, #sourceId#)
</insert>
<delete id="delete">
......@@ -216,7 +229,9 @@
PARENT_ID = #parentId#, <!-- 销售出库单ID -->
PRICE = #price#, <!-- 单价 -->
AMOUNT = #amount#, <!-- 金额 -->
INVENT_TYPE_DETAIL = #inventTypeDetail#
INVENT_TYPE_DETAIL = #inventTypeDetail#,
SOURCE = #source#,
SOURCE_ID = #sourceId#
WHERE
ID = #id#
</update>
......@@ -231,6 +246,8 @@
b.WH_CODE AS "whCode",
b.PROJ_CODE AS "projCode",
a.INVENT_CODE AS "inventCode",
a.SOURCE as "source",
a.SOURCE_ID as "sourceId",
COALESCE(SUM(QUANTITY), 0) AS "quantity",
COALESCE(SUM(WEIGHT), 0) AS "weight"
FROM ${hggpSchema}.HGKC004A a LEFT JOIN ${hggpSchema}.HGKC004 b on a.PARENT_ID = b.ID
......@@ -238,7 +255,7 @@
<isNotEmpty prepend=" AND " property="createdTimeFrom">
a.CREATED_TIME BETWEEN #createdTimeFrom# AND #createdTimeTo#
</isNotEmpty>
GROUP BY a.ACCOUNT_CODE,a.COMPANY_CODE,a.COMPANY_NAME, a.DEP_CODE, b.WH_CODE, b.PROJ_CODE, a.INVENT_CODE
GROUP BY a.ACCOUNT_CODE,a.COMPANY_CODE,a.COMPANY_NAME, a.DEP_CODE, b.WH_CODE, b.PROJ_CODE, a.INVENT_CODE, a.SOURCE, a.SOURCE_ID
</select>
<select id="queryDetail" resultClass="com.baosight.hggp.hg.kc.domain.HGKC004A">
......@@ -252,6 +269,8 @@
a.INVENT_CODE AS "inventCode",
a.SPEC as "spec",
a.INVENT_TYPE_DETAIL as "inventTypeDetail",
a.SOURCE as "source",
a.SOURCE_ID as "sourceId",
COALESCE(SUM(a.QUANTITY), 0) AS "quantity",
COALESCE(SUM(a.WEIGHT), 0) AS "weight",
COALESCE(SUM(a.AMOUNT)) as "amount"
......@@ -278,7 +297,7 @@
<isEmpty prepend=" AND " property="submitStatus">
b.STATUS = 1
</isEmpty>
GROUP BY a.ACCOUNT_CODE, a.DEP_CODE, a.COMPANY_CODE, b.WH_CODE, a.INVENT_RECORD_ID, a.INVENT_TYPE, a.INVENT_CODE, a.SPEC,a.INVENT_TYPE_DETAIL
GROUP BY a.ACCOUNT_CODE, a.DEP_CODE, a.COMPANY_CODE, b.WH_CODE, a.INVENT_RECORD_ID, a.INVENT_TYPE, a.INVENT_CODE, a.SPEC,a.INVENT_TYPE_DETAIL, a.SOURCE, a.SOURCE_ID
</select>
</sqlMap>
......@@ -24,7 +24,8 @@
PROJ_NAME as "projName", <!-- 项目名称 -->
RECEIVE_TYPE as "receiveType", <!-- 领料单类型 0:正常,1:退库 -->
RECEIVE_USER_ID as "receiveUserId", <!-- 领料人ID -->
RECEIVE_USER_NAME as "receiveUserName" <!-- 领料人姓名 -->
RECEIVE_USER_NAME as "receiveUserName", <!-- 领料人姓名 -->
DATA_SOURCE as "dataSource" <!-- 数据来源 1存货 2产品清单 -->
</sql>
<sql id="condition">
......@@ -87,6 +88,9 @@
<isNotEmpty prepend=" AND " property="projName">
PROJ_NAME like ('%$projName$%')
</isNotEmpty>
<isNotEmpty prepend=" AND " property="dataSource">
DATA_SOURCE = #dataSource#
</isNotEmpty>
</sql>
<sql id="customCondition">
......@@ -154,11 +158,12 @@
STATUS, <!-- 状态 0未提交,1已提交 -->
RECEIVE_TYPE, <!-- 领料单类型 0:正常,1:退库 -->
RECEIVE_USER_ID,
RECEIVE_USER_NAME
RECEIVE_USER_NAME,
DATA_SOURCE
) VALUES (
#projCode#, #projName#, #accountCode#, #depCode#, #createdBy#, #createdName#, #createdTime#,
#deleteFlag#, #companyCode#, #companyName#, #receiptDate#,
#applyCode#, #whCode#, #whName#, #status#, #receiveType#, #receiveUserId#, #receiveUserName#)
#applyCode#, #whCode#, #whName#, #status#, #receiveType#, #receiveUserId#, #receiveUserName#, #dataSource#)
<selectKey resultClass="long" keyProperty="id">
SELECT MAX(ID) AS "id" FROM ${hggpSchema}.HGKC008
</selectKey>
......
......@@ -39,7 +39,10 @@
AMOUNT as "amount", <!-- 金额 -->
INVENT_TYPE_DETAIL as "inventTypeDetail", <!-- 存货类型大类 -->
QUALITY_NO as "qualityNo", <!-- 质检单号 -->
INV_ID as "invId" <!-- 库存ID -->
INV_ID as "invId", <!-- 库存ID -->
MAT_ID as "matId", <!-- 物料清单ID -->
MAT_DETAIL_ID as "matDetailId", <!-- 物料清单明细ID -->
DATA_SOURCE as "dataSource" <!-- 数据来源 1存货 2产品清单 -->
</sql>
<sql id="condition">
......@@ -130,6 +133,16 @@
<isNotEmpty prepend=" AND " property="invId">
INV_ID = #invId#
</isNotEmpty>
<isNotEmpty prepend=" AND " property="matId">
MAT_ID = #matId#
</isNotEmpty>
<isNotEmpty prepend=" AND " property="matDetailId">
MAT_DETAIL_ID = #matDetailId#
</isNotEmpty>
<isNotEmpty prepend=" AND " property="dataSource">
DATA_SOURCE = #dataSource#
</isNotEmpty>
</sql>
<sql id="idCondition">
......@@ -236,12 +249,15 @@
AMOUNT, <!-- 金额 -->
INVENT_TYPE_DETAIL,
QUALITY_NO,
INV_ID
INV_ID,
MAT_ID,
MAT_DETAIL_ID,
DATA_SOURCE
) VALUES (#accountCode#,#projCode#, #projName#, #depCode#, #createdBy#, #createdName#, #createdTime#,
#deleteFlag#, #status#, #applyLineCode#, #applyCode#, #receiveId#, #companyCode#, #companyName#, #whCode#,
#whName#, #inventRecordId#, #inventType#, #inventCode#, #inventName#, #invSpecId#,#invSpec#, #invLength#,
#invWidth#, #invThick#, #invQty#, #invUnitWeight#, #invWeight#, #price#, #amount#, #inventTypeDetail#,
#qualityNo#, #invId#)
#qualityNo#, #invId#, #matId#, #matDetailId#, #dataSource#)
</insert>
<delete id="delete">
......
......@@ -331,13 +331,14 @@
LENGTH as "length", <!-- 长度 -->
WIDTH as "width", <!-- 宽度 -->
THICK as "thick", <!-- 厚度 -->
INV_QTY as "invQty", <!-- 库存数量 -->
SUM(INV_QTY) as "invQty", <!-- 库存数量 -->
INV_UNIT_WEIGHT as "invUnitWeight", <!-- 库存单重 -->
INV_WEIGHT as "invWeight", <!-- 库存重量 -->
SUM(INV_WEIGHT) as "invWeight", <!-- 库存重量 -->
INVENT_TYPE_DETAIL as "inventTypeDetail"
FROM ${hggpSchema}.HGKC010
WHERE 1=1
<include refid="condition"/>
group by INVENT_TYPE, INVENT_CODE, INVENT_NAME, SPEC_ID, SPEC, LENGTH, WIDTH, THICK, INV_UNIT_WEIGHT, INVENT_TYPE_DETAIL
</select>
<!--规格下拉框-->
......
......@@ -66,6 +66,7 @@ public class HGSC004A extends DaoEPBase {
public static final String FIELD_invent_source = "inventSource"; /* 物料来源 1加工 2外购*/
public static final String COL_id = "id"; /* 主键*/
public static final String COL_company_code = "company_code"; /* 公司编码(预留)*/
public static final String COL_company_name = "company_name"; /* 公司名称(预留)*/
......@@ -176,6 +177,11 @@ public class HGSC004A extends DaoEPBase {
private String projCodePrefix = " "; /*项目前缀*/
@ExcelAnno(index = 15)
private String projNamePrefix = " ";
//生产领料申请
public static final String FIELD_APPLY_QTY = "applyQty"; /* 申请数量*/
public static final String COL_APPLY_QTY = "APPLY_QTY"; /* 申请数量*/
private BigDecimal applyQty = new BigDecimal(0.000); /* 申请数量*/
/**
* initialize the metadata.
*/
......@@ -407,6 +413,13 @@ public class HGSC004A extends DaoEPBase {
eiColumn = new EiColumn(FIELD_invent_source);
eiColumn.setDescName("物料来源 1加工 2外购");
eiMetadata.addMeta(eiColumn);
eiColumn = new EiColumn(FIELD_APPLY_QTY);
eiColumn.setType("N");
eiColumn.setScaleLength(0);
eiColumn.setFieldLength(15);
eiColumn.setDescName("申请数量");
eiMetadata.addMeta(eiColumn);
}
/**
......@@ -973,7 +986,13 @@ public class HGSC004A extends DaoEPBase {
public void setInventSource(Integer inventSource) {
this.inventSource = inventSource;
}
public BigDecimal getApplyQty() {
return applyQty;
}
public void setApplyQty(BigDecimal applyQty) {
this.applyQty = applyQty;
}
/**
* get the value from Map.
*
......@@ -1023,6 +1042,8 @@ public class HGSC004A extends DaoEPBase {
setProjCodePrefix(StringUtils.defaultIfEmpty(StringUtils.toString(map.get(FIELD_proj_code_prefix)), projCodePrefix));
setProjNamePrefix(StringUtils.defaultIfEmpty(StringUtils.toString(map.get(FIELD_proj_name_prefix)), projNamePrefix));
setInventSource(NumberUtils.toInteger(StringUtils.toString(map.get(FIELD_invent_source)), inventSource));
setApplyQty(NumberUtils.toBigDecimal(StringUtils.toString(map.get(FIELD_APPLY_QTY)), applyQty));
}
/**
......@@ -1073,6 +1094,8 @@ public class HGSC004A extends DaoEPBase {
map.put(FIELD_proj_code_prefix, StringUtils.toString(projCodePrefix, eiMetadata.getMeta(FIELD_proj_code_prefix)));
map.put(FIELD_proj_name_prefix, StringUtils.toString(projNamePrefix, eiMetadata.getMeta(FIELD_proj_name_prefix)));
map.put(FIELD_invent_source, StringUtils.toString(inventSource, eiMetadata.getMeta(FIELD_invent_source)));
map.put(FIELD_APPLY_QTY, StringUtils.toString(applyQty, eiMetadata.getMeta(FIELD_APPLY_QTY)));
return map;
}
}
......@@ -281,7 +281,7 @@ public class ServiceHGSC004A extends ServiceBase {
*/
private void submitPlanEntity(HGSC004 hgsc004, Boolean flag, List<HGSC004A> hgsc004AList) {
List<String> inventCodes = hgsc004AList.stream().map(HGSC004A::getProductCode).collect(Collectors.toList());
List<HGPZ005> hgpz005List = HGPZTools.HgPz005.listByInventCodes(inventCodes);
List<HGPZ005> hgpz005List = HGPZTools.HgPz005.listByInventCodes(inventCodes);
//第一次全部提交
if(flag){
//主表
......@@ -295,6 +295,8 @@ public class ServiceHGSC004A extends ServiceBase {
//加工的才生成生产计划
mapA.put("inventSource", HGConstant.InventSource.JG);
hgsc004AList = dao.query(HGSC004A.QUERY_BY_MATERIAL_ID,mapA, 0, -999999);
inventCodes = hgsc004AList.stream().map(HGSC004A::getProductCode).collect(Collectors.toList());
hgpz005List = HGPZTools.HgPz005.listByInventCodes(inventCodes);
List<HGSC005A> hgsc005AList = new LinkedList<>();
for(HGSC004A hgsc004A : hgsc004AList){
//全部提交后的增加、修改
......
......@@ -39,8 +39,8 @@ public class ServiceHGSC013 extends ServiceEPBase {
public EiInfo query(EiInfo inInfo) {
try {
Map queryMap = EiInfoUtils.getFirstRow(inInfo);
if (queryMap.containsKey("contractDate")){
queryMap.put("contractDate", DateUtils.formatShort(queryMap.get("contractDate")));
if (queryMap.containsKey("receiptDate")){
queryMap.put("receiptDate", DateUtils.formatShort(queryMap.get("receiptDate")));
}
List<Map> list = DaoBase.getInstance().query("HGSC013.query", queryMap);
inInfo.set(EiConstant.resultBlock, list);
......
......@@ -164,6 +164,15 @@
</isNotEmpty>
</sql>
<sql id="idCondition">
<isNotEmpty prepend=" AND " property="id">
ID = #id#
</isNotEmpty>
<isNotEmpty prepend=" AND " property="ids">
ID IN <iterate open="(" close=")" conjunction="," property="ids">#ids[]#</iterate>
</isNotEmpty>
</sql>
<select id="query" parameterClass="java.util.HashMap"
resultClass="com.baosight.hggp.hg.sc.domain.HGSC004A">
SELECT
......@@ -518,6 +527,94 @@
</update>
<select id="queryMaterial" parameterClass="java.util.HashMap"
resultClass="com.baosight.hggp.hg.sc.domain.HGSC004A">
SELECT
a.id as "id", <!-- 主键 -->
a.company_code as "companyCode", <!-- 公司编码(预留) -->
a.company_name as "companyName", <!-- 公司名称(预留) -->
a.dep_code as "depCode", <!-- 部门编号(预留) -->
a.dep_name as "depName", <!-- 部门名称(预留) -->
a.proj_code as "projCode", <!-- 项目编码(预留) -->
a.proj_name as "projName", <!-- 项目名称(预留) -->
a.parent_prod_code as "parentProdCode", <!-- 父节点-产品编码 -->
a.parent_prod_name as "parentProdName", <!-- 父节点-产品名称 -->
a.material_id as "materialId", <!-- 物料清单id -->
a.product_id as "productId", <!-- 产品id -->
a.product_type as "productType", <!-- 产品类别 -->
a.product_code as "productCode", <!-- 产品编号 -->
a.product_name as "productName", <!-- 产品名称 -->
a.invent_type as "inventType", <!-- 档案类型 -->
a.invent_source as "inventSource", <!-- 物料来源 1加工 2外购 -->
a.spec as "spec",
a.length as "length", <!-- 长 -->
a.width as "width", <!-- 宽 -->
a.thick as "thick", <!-- 厚 -->
a.product_status as "productStatus", <!-- 产品状态 0:未提交,1:已提交 -->
a.change_type as "changeType", <!-- 变更类型:默认0,1:增加,2:替换,3:删除 -->
a.quantity as "quantity", <!-- 数量 -->
a.single_weight as "singleWeight", <!-- 单重 -->
a.total_weight as "totalWeight", <!-- 总重 -->
a.approval_status as "approvalStatus", <!-- 审批状态 0:待审;1:审核中;2:已审 -->
a.leaf as "leaf", <!-- 是否有叶子节点 -->
a.sort as "sort", <!-- 排序字段 -->
a.lv as "lv", <!-- 层级 -->
a.account_code as "accountCode", <!-- 帐套 -->
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" <!-- 更新时间 -->
FROM ${hggpSchema}.HGSC004A a
left join ${hggpSchema}.HGSC004 b on a.material_id = b.id
WHERE 1=1
and a.lv = 4
and b.material_status = 2
<isNotEmpty prepend=" AND " property="projName">
a.proj_name like CONCAT('%', #projName#, '%')
</isNotEmpty>
<isNotEmpty prepend=" AND " property="projCode">
a.proj_code = #projCode#
</isNotEmpty>
<isNotEmpty prepend=" AND " property="companyCode">
a.company_code = #companyCode#
</isNotEmpty>
<!-- 材料名称查询 -->
<isNotEmpty prepend=" AND " property="materialName">
a.product_name like CONCAT('%', #materialName#, '%')
</isNotEmpty>
<!-- 产品名称查询 -->
<isNotEmpty prepend=" AND " property="productName">
a.parent_prod_name like CONCAT('%', #productName#, '%')
</isNotEmpty>
<isNotEmpty prepend=" AND " property="id">
a.id = #id#
</isNotEmpty>
<isNotEmpty prepend=" AND " property="ids">
a.id IN <iterate close=")" open="(" conjunction="," property="ids">#ids[]#</iterate>
</isNotEmpty>
<dynamic prepend="ORDER BY">
<isNotEmpty property="orderBy">
$orderBy$
</isNotEmpty>
</dynamic>
<dynamic prepend="ORDER BY">
<isNotEmpty property="orderBy">
$orderBy$
</isNotEmpty>
<isEmpty property="orderBy">
a.CREATED_TIME desc
</isEmpty>
</dynamic>
</select>
<!-- 锁 -->
<update id="locks">
UPDATE ${hggpSchema}.HGSC004A
SET CREATED_TIME = CREATED_TIME
WHERE 1=1
<include refid="idCondition"/>
</update>
</sqlMap>
......@@ -13,8 +13,8 @@
h.INVENT_CODE as "lcinventCode", <!-- 原料编码 -->
h.INVENT_NAME as "lcinventName", <!-- 原料名称 -->
h.SPEC_CL as "lcspec",
h.OUT_QTY as "jhckQty", <!-- 出库数量 -->
h.OUT_WEIGHT as "jhckWeight", <!-- 出库重量 -->
h.PCS_QTY as "jhckQty", <!-- 加工数量 -->
h.PCS_WEIGHT as "jhckWeight", <!-- 加工重量 -->
hd.OUT_DATE as "outDate", <!-- 出库日期 -->
hd.OUT_QTY as "sjckoutQty", <!-- 出库数量 -->
hd.OUT_WEIGHT as "sjckoutWeight", <!-- 出库重量 -->
......@@ -28,26 +28,26 @@
hc.DEPOSIT_WEIGHT as "depositWeight" <!-- 实际入库重量 -->
from (
select
h.COMPANY_CODE ,
h.COMPANY_NAME ,
h.CONTRACT_DATE ,
h.CONTRACT_CODE ,
h.SUP_CODE ,
h.SUP_NAME ,
h.SUB_STATUS,
hb.INVENT_CODE ,
hb.INVENT_NAME ,
hb.SPEC as "SPEC_CL",
hb.OUT_QTY ,
hb.OUT_WEIGHT ,
ha.PRODUCT_CODE ,
ha.PRODUCT_NAME ,
ha.SPEC as "SPEC_CP",
ha.DEPOSIT_QTY ,
ha.DEPOSIT_WEIGHT
from hggp.hgsc010 h
left join hggp.hgsc010a ha on h.ID = ha.PARENT_ID AND h.ACCOUNT_CODE = ha.ACCOUNT_CODE
left join hggp.hgsc010b hb on h.ID = hb.PARENT_ID AND h.ACCOUNT_CODE = ha.ACCOUNT_CODE and ha.INVENT_CODE = hb.INVENT_CODE
h.COMPANY_CODE ,
h.COMPANY_NAME ,
h.CONTRACT_DATE ,
h.CONTRACT_CODE ,
h.SUP_CODE ,
h.SUP_NAME ,
h.SUB_STATUS,
hb.INVENT_CODE ,
hb.INVENT_NAME ,
hb.SPEC as "SPEC_CL",
hb.PCS_QTY ,
hb.PCS_WEIGHT ,
ha.PRODUCT_CODE ,
ha.PRODUCT_NAME ,
ha.SPEC as "SPEC_CP",
ha.PCS_QTY as DEPOSIT_QTY ,
ha.PCS_WEIGHT DEPOSIT_WEIGHT
from hggp.hgsc010 h
left join hggp.hgsc010a ha on h.ID = ha.PARENT_ID AND h.ACCOUNT_CODE = ha.ACCOUNT_CODE
left join hggp.hgsc010b hb on h.ID = hb.PARENT_ID AND h.ACCOUNT_CODE = ha.ACCOUNT_CODE and ha.INVENT_CODE = hb.INVENT_CODE
where h.SUB_STATUS = 1
<isNotEmpty prepend=" AND " property="accountCode">
h.ACCOUNT_CODE = #accountCode#
......
......@@ -399,6 +399,46 @@ public class HGSCTools {
}
public static class THGSC004A{
/**
* 锁
*
* @param ids
* @return
*/
public static void lock(List<Long> ids) {
if (CollectionUtils.isEmpty(ids)) {
return;
}
Map paramMap = new HashMap();
paramMap.put("ids", ids);
DaoBase.getInstance().update(HGSqlConstant.HGSC004A.LOCKS, paramMap);
}
/**
* 查询
*
* @param ids
* @return
*/
public static Map<Long, HGSC004A> map(List<Long> ids) {
List<HGSC004A> results = list(ids);
return results.stream().collect(Collectors.toMap(HGSC004A::getId, item -> item));
}
/**
* 查询
*
* @param ids
* @return
*/
public static List<HGSC004A> list(List<Long> ids) {
AssertUtils.isEmpty(ids, "物料ID不能为空");
Map<String, Object> paramMap = new HashMap();
paramMap.put("ids", ids);
return DaoBase.getInstance().query(HGSC004A.QUERY, paramMap);
}
public static void checkFatherSubmitStatus(Long matId) {
HGSC005 hgsc005 = THGSC005.queryByMatId(matId);
AssertUtils.isTrue(hgsc005.getCommitStatus().compareTo(CommonConstant.YesNo.NO_0)==1, "生产计划已提交,不能操作!");
......
......@@ -4,7 +4,10 @@ import com.baosight.hggp.core.constant.CommonConstant;
import com.baosight.hggp.core.dao.DaoUtils;
import com.baosight.hggp.core.enums.DeleteFlagEnum;
import com.baosight.hggp.core.security.UserSessionUtils;
import com.baosight.hggp.hg.kc.domain.HGKC010;
import com.baosight.hggp.hg.kc.tools.HGKCTools;
import com.baosight.hggp.hg.sc.constant.HgScSqlConstant;
import com.baosight.hggp.hg.sc.domain.HGSC004A;
import com.baosight.hggp.hg.sc.domain.HGSC007;
import com.baosight.hggp.hg.sc.domain.HGSC007B;
import com.baosight.hggp.hg.sc.domain.HGSC010A;
......@@ -29,11 +32,40 @@ import java.util.stream.Collectors;
public class HgScUtils {
/**
* @author:jhs
* @date:2024/10/27,16:17
*/
public static class HgSc004A {
/**
* 锁并且获取数据
*
* @param sc004a
* @return
*/
public static Map<Long, HGSC004A> lockGetDataEp(List<? extends HGSC004A> sc004a) {
return lockGetData(ObjectUtils.listEpKey(sc004a, HGSC004A.FIELD_id));
}
/**
* 锁并且获取数据
*
* @param ids
* @return
*/
public static Map<Long, HGSC004A> lockGetData(List<Long> ids) {
// 锁
HGSCTools.THGSC004A.lock(ids);
// db数据
return HGSCTools.THGSC004A.map(ids);
}
}
/**
* @author:songx
* @date:2024/8/22,16:17
*/
public static class HgSc007 {
/**
* 设置组织机构查询条件
*
......@@ -65,7 +97,7 @@ public class HgScUtils {
queryMap.put("enableRoleAuth", CommonConstant.YesNo.NO_0);
}
}
/**
* HGSC007B 定义
*
......@@ -73,7 +105,7 @@ public class HgScUtils {
* @date:2024/9/14,14:35
*/
public static class HgSc007B {
/**
* 新增组人员
*
......@@ -94,7 +126,7 @@ public class HgScUtils {
}).collect(Collectors.toList());
DaoUtils.batchInsert(HgScSqlConstant.HgSc007B.BATCH_INSERT, newSc007Bs);
}
/**
* 更新组人员
*
......@@ -117,15 +149,15 @@ public class HgScUtils {
}).collect(Collectors.toList());
DaoUtils.batchInsert(HgScSqlConstant.HgSc007B.BATCH_INSERT, newSc007Bs);
}
}
/**
* @author:songx
* @date:2024/8/22,16:17
*/
public static class HgSc010A {
/**
* 锁并获取数据
*
......
......@@ -284,7 +284,7 @@ public class ServiceHGWD001 extends ServiceEPBase {
strFileName.append("本次上传文件名称:");
List<Map> resultRows = inInfo.getBlock(EiConstant.resultBlock).getRows();
HGWD001 hgwd001 = HGWDTools.HgWd001.get(inInfo.getCellStr(EiConstant.queryBlock, ACConstants.ROW_CODE_0, HGWD001.FIELD_FILE_ID));
List<HGWD099> hgwd099List = HGWDTools.HgWd099.queryByBiz("WD");
List<HGWD099> hgwd099List = HGWDTools.HgWd099.queryByBiz("WD", hgwd001.getFileId());
for (Map resultRow : resultRows) {
String ndocId = resultRow.get("ndocId").toString();
List<HGWD099> hgwd099s = hgwd099List.stream().filter(hgwd099 -> hgwd099.getDocId().equals(ndocId)).collect(Collectors.toList());
......
......@@ -46,6 +46,8 @@ public class HGYX001A extends DaoEPBase {
public static final String FIELD_WEIGHT = "weight"; /* 发货重量*/
public static final String FIELD_PARENT_ID = "parentId"; /* 销售发货ID*/
public static final String FIELD_INVENT_TYPE_DETAIL = "inventTypeDetail"; /*存货类型明细*/
public static final String FIELD_SOURCE = "source"; /* 数据来源*/
public static final String FIELD_SOURCE_ID = "sourceId"; /* 数据来源*/
public static final String COL_ID = "ID"; /* ID*/
public static final String COL_ACCOUNT_CODE = "ACCOUNT_CODE"; /* 企业编码*/
......@@ -103,6 +105,8 @@ public class HGYX001A extends DaoEPBase {
private BigDecimal weight = new BigDecimal("0"); /* 发货重量*/
private Long parentId = new Long(0); /* 销售发货ID*/
private String inventTypeDetail; /*存货类型明细 1:构建 2:零件*/
private Integer source; /* 数据来源*/
private Long sourceId = new Long(0); /* 数据来源*/
/**
* initialize the metadata.
......@@ -225,6 +229,13 @@ public class HGYX001A extends DaoEPBase {
eiColumn.setDescName("存货类型明细");
eiMetadata.addMeta(eiColumn);
eiColumn = new EiColumn(FIELD_SOURCE);
eiColumn.setDescName("数据来源");
eiMetadata.addMeta(eiColumn);
eiColumn = new EiColumn(FIELD_SOURCE_ID);
eiColumn.setDescName("数据来源ID");
eiMetadata.addMeta(eiColumn);
}
/**
......@@ -597,6 +608,22 @@ public class HGYX001A extends DaoEPBase {
this.inventTypeDetail = inventTypeDetail;
}
public Integer getSource() {
return source;
}
public void setSource(Integer source) {
this.source = source;
}
public Long getSourceId() {
return sourceId;
}
public void setSourceId(Long sourceId) {
this.sourceId = sourceId;
}
/**
* get the value from Map.
*
......@@ -629,6 +656,8 @@ public class HGYX001A extends DaoEPBase {
setWeight(NumberUtils.toBigDecimal(StringUtils.toString(map.get(FIELD_WEIGHT)), weight));
setParentId(NumberUtils.toLong(StringUtils.toString(map.get(FIELD_PARENT_ID)), parentId));
setInventTypeDetail(StringUtils.defaultIfEmpty(StringUtils.toString(map.get(FIELD_INVENT_TYPE_DETAIL)), inventTypeDetail));
setSource(NumberUtils.toInteger(StringUtils.toString(map.get(FIELD_SOURCE)), source));
setSourceId(NumberUtils.toLong(StringUtils.toString(map.get(FIELD_SOURCE_ID)), sourceId));
}
/**
......@@ -662,6 +691,8 @@ public class HGYX001A extends DaoEPBase {
map.put(FIELD_WEIGHT, StringUtils.toString(weight, eiMetadata.getMeta(FIELD_WEIGHT)));
map.put(FIELD_PARENT_ID, StringUtils.toString(parentId, eiMetadata.getMeta(FIELD_PARENT_ID)));
map.put(FIELD_INVENT_TYPE_DETAIL,StringUtils.toString(inventTypeDetail, eiMetadata.getMeta(FIELD_INVENT_TYPE_DETAIL)));
map.put(FIELD_SOURCE, StringUtils.toString(source, eiMetadata.getMeta(FIELD_SOURCE)));
map.put(FIELD_SOURCE_ID, StringUtils.toString(sourceId, eiMetadata.getMeta(FIELD_SOURCE_ID)));
return map;
}
......
......@@ -53,6 +53,7 @@ public class HGYX001C extends DaoEPBase {
public static final String FIELD_FACTORY_CODE = "factoryCode"; /* 厂区编码*/
public static final String FIELD_FACTORY_NAME = "factoryName"; /* 厂区名称*/
public static final String FIELD_INVENT_TYPE_DETAIL = "inventTypeDetail"; /*存货类型明细*/
public static final String FIELD_SOURCE = "source"; /* 数据来源*/
public static final String COL_ID = "ID";
public static final String COL_ACCOUNT_CODE = "ACCOUNT_CODE"; /* 企业编码*/
......@@ -120,6 +121,7 @@ public class HGYX001C extends DaoEPBase {
private String factoryCode = " "; /* 厂区编码*/
private String factoryName = " "; /* 厂区名称*/
private String inventTypeDetail; /*存货类型明细 1:构建 2:零件*/
private Integer source; /* 数据来源*/
/**
* initialize the metadata.
......@@ -265,6 +267,10 @@ public class HGYX001C extends DaoEPBase {
eiColumn = new EiColumn(FIELD_INVENT_TYPE_DETAIL);
eiColumn.setDescName("存货类型明细");
eiMetadata.addMeta(eiColumn);
eiColumn = new EiColumn(FIELD_SOURCE);
eiColumn.setDescName("数据来源");
eiMetadata.addMeta(eiColumn);
}
/**
......@@ -731,6 +737,14 @@ public class HGYX001C extends DaoEPBase {
this.inventTypeDetail = inventTypeDetail;
}
public Integer getSource() {
return source;
}
public void setSource(Integer source) {
this.source = source;
}
/**
* get the value from Map.
*
......@@ -769,6 +783,7 @@ public class HGYX001C extends DaoEPBase {
setFactoryCode(StringUtils.defaultIfEmpty(StringUtils.toString(map.get(FIELD_FACTORY_CODE)), factoryCode));
setFactoryName(StringUtils.defaultIfEmpty(StringUtils.toString(map.get(FIELD_FACTORY_NAME)), factoryName));
setInventTypeDetail(StringUtils.defaultIfEmpty(StringUtils.toString(map.get(FIELD_INVENT_TYPE_DETAIL)), inventTypeDetail));
setSource(NumberUtils.toInteger(StringUtils.toString(map.get(FIELD_SOURCE)), source));
}
/**
......@@ -808,6 +823,7 @@ public class HGYX001C extends DaoEPBase {
map.put(FIELD_FACTORY_CODE, StringUtils.toString(factoryCode, eiMetadata.getMeta(FIELD_FACTORY_CODE)));
map.put(FIELD_FACTORY_NAME, StringUtils.toString(factoryName, eiMetadata.getMeta(FIELD_FACTORY_NAME)));
map.put(FIELD_INVENT_TYPE_DETAIL,StringUtils.toString(inventTypeDetail, eiMetadata.getMeta(FIELD_INVENT_TYPE_DETAIL)));
map.put(FIELD_SOURCE, StringUtils.toString(source, eiMetadata.getMeta(FIELD_SOURCE)));
return map;
}
......
......@@ -48,6 +48,8 @@ public class HGYX002A extends DaoEPBase {
public static final String FIELD_RETURN_WEIGHT = "returnWeight"; /* 退货重量*/
public static final String FIELD_PARENT_ID = "parentId"; /* 销售退货ID*/
public static final String FIELD_INVENT_TYPE_DETAIL = "inventTypeDetail"; /*存货类型明细*/
public static final String FIELD_SOURCE = "source"; /* 数据来源*/
public static final String FIELD_SOURCE_ID = "sourceId"; /* 数据来源*/
public static final String COL_ID = "ID"; /* ID*/
public static final String COL_ACCOUNT_CODE = "ACCOUNT_CODE"; /* 企业编码*/
......@@ -109,6 +111,8 @@ public class HGYX002A extends DaoEPBase {
private BigDecimal returnWeight = new BigDecimal(0.000); /* 退货重量*/
private Long parentId = new Long(0); /* 销售退货ID*/
private String inventTypeDetail; /*存货类型明细 1:构建 2:零件*/
private Integer source; /* 数据来源*/
private Long sourceId = new Long(0); /* 数据来源*/
/**
* initialize the metadata.
......@@ -244,6 +248,14 @@ public class HGYX002A extends DaoEPBase {
eiColumn = new EiColumn(FIELD_INVENT_TYPE_DETAIL);
eiColumn.setDescName("存货类型明细");
eiMetadata.addMeta(eiColumn);
eiColumn = new EiColumn(FIELD_SOURCE);
eiColumn.setDescName("数据来源");
eiMetadata.addMeta(eiColumn);
eiColumn = new EiColumn(FIELD_SOURCE_ID);
eiColumn.setDescName("数据来源ID");
eiMetadata.addMeta(eiColumn);
}
/**
......@@ -655,6 +667,22 @@ public class HGYX002A extends DaoEPBase {
this.inventTypeDetail = inventTypeDetail;
}
public Integer getSource() {
return source;
}
public void setSource(Integer source) {
this.source = source;
}
public Long getSourceId() {
return sourceId;
}
public void setSourceId(Long sourceId) {
this.sourceId = sourceId;
}
/**
* get the value from Map.
*
......@@ -689,6 +717,8 @@ public class HGYX002A extends DaoEPBase {
setReturnWeight(NumberUtils.toBigDecimal(StringUtils.toString(map.get(FIELD_RETURN_WEIGHT)), returnWeight));
setParentId(NumberUtils.toLong(StringUtils.toString(map.get(FIELD_PARENT_ID)), parentId));
setInventTypeDetail(StringUtils.defaultIfEmpty(StringUtils.toString(map.get(FIELD_INVENT_TYPE_DETAIL)), inventTypeDetail));
setSource(NumberUtils.toInteger(StringUtils.toString(map.get(FIELD_SOURCE)), source));
setSourceId(NumberUtils.toLong(StringUtils.toString(map.get(FIELD_SOURCE_ID)), sourceId));
}
/**
......@@ -724,6 +754,8 @@ public class HGYX002A extends DaoEPBase {
map.put(FIELD_RETURN_WEIGHT, StringUtils.toString(returnWeight, eiMetadata.getMeta(FIELD_RETURN_WEIGHT)));
map.put(FIELD_PARENT_ID, StringUtils.toString(parentId, eiMetadata.getMeta(FIELD_PARENT_ID)));
map.put(FIELD_INVENT_TYPE_DETAIL,StringUtils.toString(inventTypeDetail, eiMetadata.getMeta(FIELD_INVENT_TYPE_DETAIL)));
map.put(FIELD_SOURCE, StringUtils.toString(source, eiMetadata.getMeta(FIELD_SOURCE)));
map.put(FIELD_SOURCE_ID, StringUtils.toString(sourceId, eiMetadata.getMeta(FIELD_SOURCE_ID)));
return map;
}
......
package com.baosight.hggp.hg.yx.service;
import com.baosight.hggp.common.DdynamicEnum;
import com.baosight.hggp.common.InventTypeDetailEnum;
import com.baosight.hggp.core.constant.CommonConstant;
import com.baosight.hggp.core.dao.DaoBase;
import com.baosight.hggp.hg.kc.domain.HGKC010;
import com.baosight.hggp.hg.kc.domain.HGKC016;
import com.baosight.hggp.hg.kc.domain.HGKC016A;
import com.baosight.hggp.hg.kc.domain.HGKC017;
import com.baosight.hggp.hg.pz.domain.HGPZ004;
import com.baosight.hggp.hg.pz.domain.HGPZ006;
import com.baosight.hggp.hg.pz.tools.HGPZTools;
import com.baosight.hggp.hg.sc.domain.HGSC004;
import com.baosight.hggp.hg.yx.domain.HGYX001;
import com.baosight.hggp.hg.yx.domain.HGYX001C;
import com.baosight.hggp.util.CommonMethod;
import com.baosight.hggp.util.EiInfoUtils;
import com.baosight.hggp.util.StringUtils;
import com.baosight.hggp.util.contants.ACConstants;
import com.baosight.iplat4j.core.ei.EiConstant;
import com.baosight.iplat4j.core.ei.EiInfo;
import com.baosight.iplat4j.core.service.impl.ServiceEPBase;
import java.util.*;
import java.util.stream.Collectors;
/**
* @author LiuYang
* @version 1.0 2024/10/26
* @description
*/
public class ServiceHGYX001D extends ServiceEPBase {
@Override
public EiInfo initLoad(EiInfo inInfo) {
CommonMethod.initBlock(inInfo,
Arrays.asList(
DdynamicEnum.INVENT_TYPE_BLOCK_ID,
DdynamicEnum.INVENT_RECORD_BLOCK_ID,
DdynamicEnum.SPEC_NAME_BLOCK_ID),
new HashMap<String, Object>(){{
put(HGPZ004.FIELD_INVENT_TYPE_DETAILS, InventTypeDetailEnum.getProdTypeFour());
}});
inInfo.addBlock(EiConstant.resultBlock).addBlockMeta(new HGYX001C().eiMetadata);
return inInfo;
}
@Override
public EiInfo query(EiInfo inInfo) {
Map qaramMap = EiInfoUtils.getFirstRow(inInfo);
qaramMap.put(HGYX001.FIELD_DELETE_FLAG, CommonConstant.YesNo.NO_0);
//qaramMap.put(HGPZ004.FIELD_INVENT_TYPE_DETAILS, InventTypeDetailEnum.getProdTypeFour());
if (qaramMap.containsKey("specIds")) {
String[] specIdArray = qaramMap.get("specIds").toString().split(",");
qaramMap.put("notSpecIds",specIdArray);
}
return super.query(inInfo, "HGYX001D.query");
}
}
......@@ -242,6 +242,8 @@ public class ServiceHGYX002 extends ServiceEPBase {
hgkc004A.setWeight(hgyx002A.getReturnWeight());
hgkc004A.setParentId(hgkc004.getId());
hgkc004A.setInventTypeDetail(hgyx002A.getInventTypeDetail());
hgkc004A.setSource(hgyx002A.getSource());
hgkc004A.setSourceId(hgyx002A.getSourceId());
DaoUtils.insert(HGKC004A.INSERT, hgkc004A);
}
......
......@@ -27,7 +27,9 @@
UNIT_WEIGHT as "unitWeight", <!-- 发货单重 -->
WEIGHT as "weight", <!-- 发货重量 -->
PARENT_ID as "parentId", <!-- 销售发货ID -->
INVENT_TYPE_DETAIL as "inventTypeDetail"
INVENT_TYPE_DETAIL as "inventTypeDetail",
SOURCE as "source",
SOURCE_ID as "sourceId"
</sql>
<sql id="condition">
......@@ -101,6 +103,12 @@
<isNotEmpty prepend=" AND " property="inventTypeDetails">
INVENT_TYPE_DETAIL IN <iterate close=")" open="(" conjunction="," property="inventTypeDetails">#inventTypeDetails[]#</iterate>
</isNotEmpty>
<isNotEmpty prepend=" AND " property="source">
SOURCE = #source#
</isNotEmpty>
<isNotEmpty prepend=" AND " property="sourceId">
SOURCE_ID = #sourceId#
</isNotEmpty>
</sql>
<select id="query" parameterClass="java.util.HashMap" resultClass="HGYX001A">
......@@ -148,12 +156,14 @@
UNIT_WEIGHT, <!-- 发货单重 -->
WEIGHT, <!-- 发货重量 -->
PARENT_ID, <!-- 销售发货ID -->
INVENT_TYPE_DETAIL
INVENT_TYPE_DETAIL,
SOURCE,
SOURCE_ID
)
VALUES (#id#, #accountCode#, #depCode#, #createdBy#, #createdName#, #createdTime#, #updatedBy#,
#updatedName#, #updatedTime#, #deleteFlag#, #inventRecordId#, #inventType#, #inventCode#,
#inventName#, #specId#, #spec#, #length#, #width#, #thick#, #quantity#, #unitWeight#,
#weight#, #parentId#,#inventTypeDetail#)
#weight#, #parentId#,#inventTypeDetail#, #source#, #sourceId#)
</insert>
<delete id="delete">
......@@ -184,29 +194,31 @@
<update id="update">
UPDATE ${hggpSchema}.HGYX001A
SET
ACCOUNT_CODE = #accountCode#, <!-- 企业编码 -->
DEP_CODE = #depCode#, <!-- 部门编码 -->
CREATED_BY = #createdBy#, <!-- 记录创建者 -->
CREATED_NAME = #createdName#, <!-- 记录创建名称 -->
CREATED_TIME = #createdTime#, <!-- 记录创建时间 -->
UPDATED_BY = #updatedBy#, <!-- 记录修改者 -->
UPDATED_NAME = #updatedName#, <!-- 记录修改名称 -->
UPDATED_TIME = #updatedTime#, <!-- 记录修改时间 -->
DELETE_FLAG = #deleteFlag#, <!-- 0-未删除,1-已删除 -->
INVENT_RECORD_ID = #inventRecordId#, <!-- 存货档案id -->
INVENT_TYPE = #inventType#, <!-- 存货类型 -->
INVENT_CODE = #inventCode#, <!-- 存货编码 -->
INVENT_NAME = #inventName#, <!-- 存货名称 -->
SPEC = #spec#, <!-- 规格 -->
LENGTH = #length#, <!-- 长 -->
WIDTH = #width#, <!-- 宽 -->
THICK = #thick#, <!-- 厚 -->
QUANTITY = #quantity#, <!-- 发货数量 -->
UNIT_WEIGHT = #unitWeight#, <!-- 发货单重 -->
WEIGHT = #weight#, <!-- 发货重量 -->
PARENT_ID = #parentId#, <!-- 销售发货ID -->
INVENT_TYPE_DETAIL = #inventTypeDetail#
WHERE
ACCOUNT_CODE = #accountCode#, <!-- 企业编码 -->
DEP_CODE = #depCode#, <!-- 部门编码 -->
CREATED_BY = #createdBy#, <!-- 记录创建者 -->
CREATED_NAME = #createdName#, <!-- 记录创建名称 -->
CREATED_TIME = #createdTime#, <!-- 记录创建时间 -->
UPDATED_BY = #updatedBy#, <!-- 记录修改者 -->
UPDATED_NAME = #updatedName#, <!-- 记录修改名称 -->
UPDATED_TIME = #updatedTime#, <!-- 记录修改时间 -->
DELETE_FLAG = #deleteFlag#, <!-- 0-未删除,1-已删除 -->
INVENT_RECORD_ID = #inventRecordId#, <!-- 存货档案id -->
INVENT_TYPE = #inventType#, <!-- 存货类型 -->
INVENT_CODE = #inventCode#, <!-- 存货编码 -->
INVENT_NAME = #inventName#, <!-- 存货名称 -->
SPEC = #spec#, <!-- 规格 -->
LENGTH = #length#, <!-- 长 -->
WIDTH = #width#, <!-- 宽 -->
THICK = #thick#, <!-- 厚 -->
QUANTITY = #quantity#, <!-- 发货数量 -->
UNIT_WEIGHT = #unitWeight#, <!-- 发货单重 -->
WEIGHT = #weight#, <!-- 发货重量 -->
PARENT_ID = #parentId#, <!-- 销售发货ID -->
INVENT_TYPE_DETAIL = #inventTypeDetail#,
SOURCE = #source#,
SOURCE_ID = #sourceId#
WHERE
ID = #id#
</update>
......
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE sqlMap PUBLIC "-//ibatis.apache.org//DTD SQL Map 2.0//EN" "http://ibatis.apache.org/dtd/sql-map-2.dtd">
<sqlMap namespace="HGYX001D">
<sql id="column">
A.ID as "id",
A.PARENT_ID as "parentId", <!-- 打包库存ID -->
A.PACK_CODE as "packCode", <!-- 打包单号 -->
A.INVENT_TYPE as "inventType", <!-- 存货类型 -->
A.INVENT_CODE as "inventCode", <!-- 存货编码 -->
A.INVENT_NAME as "inventName", <!-- 存货名称 -->
A.SPEC_ID as "specId", <!-- 规格ID -->
A.SPEC as "spec", <!-- 规格 -->
A.MATERIAL as "material", <!-- 材质 -->
A.UNIT as "unit", <!-- 单位 -->
A.LENGTH as "length", <!-- 长度 -->
A.WIDTH as "width", <!-- 宽度 -->
A.THICK as "thick", <!-- 厚度 -->
A.PACK_WAY as "packWay", <!-- 打包方式 -->
A.INV_QTY as "consQuantity", <!-- 库存数量 -->
A.INV_UNIT_WEIGHT as "consUnitWeight", <!-- 库存单重 -->
A.INV_WEIGHT as "consWeight", <!-- 库存重量 -->
A.INVENT_TYPE_DETAIL as "inventTypeDetail" <!-- 存货类型大类 -->
</sql>
<sql id="condition">
<isNotEmpty prepend=" AND " property="id">
A.ID = #id#
</isNotEmpty>
<isNotEmpty prepend=" AND " property="accountCode">
B.ACCOUNT_CODE = #accountCode#
</isNotEmpty>
<isNotEmpty prepend=" AND " property="depCode">
B.DEP_CODE = #depCode#
</isNotEmpty>
<isNotEmpty prepend=" AND " property="deleteFlag">
B.DELETE_FLAG = #deleteFlag#
</isNotEmpty>
<isNotEmpty prepend=" AND " property="companyCode">
B.COMPANY_CODE = #companyCode#
</isNotEmpty>
<isNotEmpty prepend=" AND " property="companyName">
B.COMPANY_NAME = #companyName#
</isNotEmpty>
<isNotEmpty prepend=" AND " property="whCode">
B.WH_CODE = #whCode#
</isNotEmpty>
<isNotEmpty prepend=" AND " property="whName">
B.WH_NAME = #whName#
</isNotEmpty>
<isNotEmpty prepend=" AND " property="inventType">
B.INVENT_TYPE = #inventType#
</isNotEmpty>
<isNotEmpty prepend=" AND " property="inventCode">
B.INVENT_CODE = #inventCode#
</isNotEmpty>
<isNotEmpty prepend=" AND " property="inventName">
B.INVENT_NAME = #inventName#
</isNotEmpty>
<isNotEmpty prepend=" AND " property="specId">
B.SPEC_ID = #specId#
</isNotEmpty>
<isNotEmpty prepend=" AND " property="spec">
B.SPEC = #spec#
</isNotEmpty>
<isNotEmpty prepend=" AND " property="unit">
B.UNIT = #unit#
</isNotEmpty>
<isNotEmpty prepend=" AND " property="length">
B.LENGTH = #length#
</isNotEmpty>
<isNotEmpty prepend=" AND " property="width">
B.WIDTH = #width#
</isNotEmpty>
<isNotEmpty prepend=" AND " property="thick">
B.THICK = #thick#
</isNotEmpty>
<isNotEmpty prepend=" AND " property="invQty">
INV_QTY = #invQty#
</isNotEmpty>
<isNotEmpty prepend=" AND " property="invUnitWeight">
INV_UNIT_WEIGHT = #invUnitWeight#
</isNotEmpty>
<isNotEmpty prepend=" AND " property="invWeight">
INV_WEIGHT = #invWeight#
</isNotEmpty>
<isNotEmpty prepend=" AND " property="inventTypeDetail">
B.INVENT_TYPE_DETAIL = #inventTypeDetail#
</isNotEmpty>
</sql>
<sql id="idCondition">
<isNotEmpty prepend=" AND " property="ids">
A.ID IN <iterate close=")" open="(" conjunction="," property="ids">#ids[]#</iterate>
</isNotEmpty>
<isNotEmpty prepend=" AND " property="notSpecIds">
B.SPEC_ID NOT IN <iterate close=")" open="(" conjunction="," property="notSpecIds">#notSpecIds[]#</iterate>
</isNotEmpty>
<isNotEmpty prepend=" AND " property="inventCodes">
B.INVENT_CODE IN <iterate close=")" open="(" conjunction="," property="inventCodes">#inventCodes[]#</iterate>
</isNotEmpty>
<isNotEmpty prepend=" AND " property="inventTypeDetails">
B.INVENT_TYPE_DETAIL IN <iterate close=")" open="(" conjunction="," property="inventTypeDetails">#inventTypeDetails[]#</iterate>
</isNotEmpty>
</sql>
<select id="query" parameterClass="java.util.HashMap" resultClass="com.baosight.hggp.hg.yx.domain.HGYX001C">
SELECT
<include refid="column"/>
FROM ${hggpSchema}.HGKC016A A
JOIN ${hggpSchema}.HGKC016 B ON A.PARENT_ID = B.ID
WHERE 1=1
<include refid="condition" />
<dynamic prepend="ORDER BY">
<isNotEmpty property="orderBy">
$orderBy$
</isNotEmpty>
<isEmpty property="orderBy">
A.ID asc
</isEmpty>
</dynamic>
</select>
<select id="count" resultClass="int">
SELECT COUNT(*)
FROM ${hggpSchema}.HGKC016A A
JOIN ${hggpSchema}.HGKC016 B ON A.PARENT_ID = B.ID
WHERE 1=1
<include refid="condition" />
</select>
</sqlMap>
\ No newline at end of file
......@@ -30,7 +30,9 @@
RETURN_QUANTITY as "returnQuantity", <!-- 退货数量 -->
RETURN_WEIGHT as "returnWeight", <!-- 退货重量 -->
PARENT_ID as "parentId", <!-- 销售退货ID -->
INVENT_TYPE_DETAIL as "inventTypeDetail"
INVENT_TYPE_DETAIL as "inventTypeDetail",
SOURCE as "source",
SOURCE_ID as "sourceId"
</sql>
<sql id="condition">
......@@ -116,6 +118,12 @@
<isNotEmpty prepend=" AND " property="inventTypeDetails">
INVENT_TYPE_DETAIL IN <iterate close=")" open="(" conjunction="," property="inventTypeDetails">#inventTypeDetails[]#</iterate>
</isNotEmpty>
<isNotEmpty prepend=" AND " property="source">
SOURCE = #source#
</isNotEmpty>
<isNotEmpty prepend=" AND " property="sourceId">
SOURCE_ID = #sourceId#
</isNotEmpty>
</sql>
<select id="query" parameterClass="HashMap" resultClass="HGYX002A">
......@@ -165,12 +173,14 @@
RETURN_QUANTITY, <!-- 退货数量 -->
RETURN_WEIGHT, <!-- 退货重量 -->
PARENT_ID, <!-- 销售退货ID -->
INVENT_TYPE_DETAIL
INVENT_TYPE_DETAIL,
SOURCE,
SOURCE_ID
)
VALUES (#id#, #accountCode#, #depCode#, #createdBy#, #createdName#, #createdTime#, #updatedBy#, #updatedName#,
#updatedTime#, #deleteFlag#, #inventRecordId#, #inventType#, #inventCode#, #inventName#, #specId#, #spec#, #length#,
#width#, #thick#, #quantity#, #unitWeight#, #weight#, #returnQuantity#, #returnWeight#,
#parentId#,#inventTypeDetail#)
#parentId#,#inventTypeDetail#, #source#, #sourceId#)
</insert>
<delete id="delete">
......@@ -204,7 +214,9 @@
RETURN_QUANTITY = #returnQuantity#, <!-- 退货数量 -->
RETURN_WEIGHT = #returnWeight#, <!-- 退货重量 -->
PARENT_ID = #parentId#, <!-- 销售退货ID -->
INVENT_TYPE_DETAIL = #inventTypeDetail#
INVENT_TYPE_DETAIL = #inventTypeDetail#,
SOURCE = #source#,
SOURCE_ID = #sourceId#
WHERE
ID = #id#
</update>
......
......@@ -27,7 +27,9 @@
'0' as "returnQuantity", <!-- 退货数量 -->
'0' as "returnWeight", <!-- 退货重量 -->
A.PARENT_ID as "parentId", <!-- 销售退货ID -->
A.INVENT_TYPE_DETAIL as "inventTypeDetail"
A.INVENT_TYPE_DETAIL as "inventTypeDetail",
A.SOURCE as "source",
A.SOURCE_ID as "sourceId"
</sql>
<sql id="authCondition">
<!-- 无权限时使用 -->
......@@ -125,6 +127,12 @@
<isNotEmpty prepend=" AND " property="inventTypeDetails">
A.INVENT_TYPE_DETAIL IN <iterate close=")" open="(" conjunction="," property="inventTypeDetails">#inventTypeDetails[]#</iterate>
</isNotEmpty>
<isNotEmpty prepend=" AND " property="source">
A.SOURCE = #source#
</isNotEmpty>
<isNotEmpty prepend=" AND " property="sourceId">
A.SOURCE_ID = #sourceId#
</isNotEmpty>
</sql>
<select id="query" parameterClass="java.util.HashMap" resultClass="HGYX002C">
......
......@@ -18,7 +18,7 @@ spring.servlet.multipart.file-size-threshold=0
componentEname=hggp
projectName=hggp
moduleName=ep
projectEnv=dev
projectEnv=run
platSchema=iplat_hggp
eplatSchema=eplat_hggp
lowcodedbSchema=lowcodedb_hggp
......
......@@ -94,11 +94,15 @@ function updateFunc() {
}
function windowCallback() {
// 刷新列表
resultGrid.dataSource.page(1);
// 关闭弹窗
JSColorbox.close();
function windowCallback(ei) {
if (ei !=null && ei.getStatus() < 0) {
}else {
// 刷新列表
resultGrid.dataSource.page(1);
// 关闭弹窗
JSColorbox.close();
}
}
function contractDetailFunc(id) {
......
......@@ -10,6 +10,11 @@
<EF:EFPage title="新增合同">
<EF:EFRegion id="inqu1" title="基本信息">
<div class="row">
<EF:EFSelect cname="合同类型" ename="result-0-contractType" colWidth="4" filter="contains" required="true">
<EF:EFOption label="-- 请选择 --" value=""/>
<EF:EFCodeOption codeName="hggp.cw.contractType" condition="ITEM_CODE IN ('1', '2', '3', '5')"/>
</EF:EFSelect>
<EF:EFSelect cname="项目编号" ename="projCodeBox" colWidth="4" required="true" filter="contains">
<EF:EFOption label="-- 请选择 --" value="" />
<EF:EFOptions
......@@ -17,14 +22,11 @@
</EF:EFSelect>
<EF:EFInput ename="result-0-projCode" cname="项目编号" type="hidden"/>
<EF:EFInput ename="result-0-projName" cname="项目简称" colWidth="4" readonly="true"/>
<EF:EFInput ename="result-0-contractNumber" cname="合同号" colWidth="4" readonly="false" />
</div>
<div class="row">
<EF:EFInput ename="result-0-contractNumber" cname="合同号" colWidth="4" readonly="false" />
<EF:EFInput ename="result-0-contractName" cname="合同名称" colWidth="4" required="true"/>
<EF:EFSelect cname="合同类型" ename="result-0-contractType" colWidth="4" filter="contains" required="true">
<EF:EFOption label="-- 请选择 --" value=""/>
<EF:EFCodeOption codeName="hggp.cw.contractType" condition="ITEM_CODE IN ('1', '2', '3', '5')"/>
</EF:EFSelect>
<EF:EFInput ename="result-0-contractCategory" cname="合同类别" type="hidden"/>
<EF:EFInput ename="contractCategory" cname="合同类别" colWidth="4" readonly="true"/>
......
......@@ -13,7 +13,10 @@
<EF:EFRegion id="inqu1" title="基本信息">
<div class="row">
<EF:EFInput ename="result-0-id" cname="id" type="hidden"/>
<EF:EFSelect cname="合同类型" ename="result-0-contractType" colWidth="4" filter="contains" required="true">
<EF:EFOption label="-- 请选择 --" value=""/>
<EF:EFCodeOption codeName="hggp.cw.contractType" condition="ITEM_CODE IN ('1', '2', '3', '5')"/>
</EF:EFSelect>
<EF:EFSelect cname="项目编号" ename="projCodeBox" colWidth="4" required="true" filter="contains">
<EF:EFOption label="-- 请选择 --" value="" />
<EF:EFOptions
......@@ -21,14 +24,11 @@
</EF:EFSelect>
<EF:EFInput ename="result-0-projCode" cname="项目编号" type="hidden"/>
<EF:EFInput ename="result-0-projName" cname="项目简称" colWidth="4" readonly="true"/>
<EF:EFInput ename="result-0-contractNumber" cname="合同号" colWidth="4" readonly="true" />
</div>
<div class="row">
<EF:EFInput ename="result-0-contractNumber" cname="合同号" colWidth="4" readonly="false" />
<EF:EFInput ename="result-0-contractName" cname="合同名称" colWidth="4" required="true"/>
<EF:EFSelect cname="合同类型" ename="result-0-contractType" colWidth="4" filter="contains" required="true">
<EF:EFOption label="-- 请选择 --" value=""/>
<EF:EFCodeOption codeName="hggp.cw.contractType" condition="ITEM_CODE IN ('1', '2', '3', '5')"/>
</EF:EFSelect>
<EF:EFInput ename="result-0-contractCategory" cname="合同类别" type="hidden"/>
<EF:EFInput ename="contractCategory" cname="合同类别" colWidth="4" readonly="true"/>
......
......@@ -13,16 +13,17 @@
<EF:EFRegion id="inqu1" title="基本信息">
<div class="row">
<EF:EFInput ename="result-0-id" cname="id" type="hidden"/>
<EF:EFSelect cname="合同类型" ename="result-0-contractType" colWidth="4" filter="contains" readonly="true" enable="false">
<EF:EFOption label="-- 请选择 --" value=""/>
<EF:EFCodeOption codeName="hggp.cw.contractType" condition="ITEM_CODE IN ('1', '2', '3', '5')"/>
</EF:EFSelect>
<EF:EFInput ename="result-0-projCode" cname="项目编号" colWidth="4" readonly="true"/>
<EF:EFInput ename="result-0-projName" cname="项目简称" colWidth="4" readonly="true"/>
<EF:EFInput ename="result-0-contractNumber" cname="合同号" colWidth="4" readonly="true" />
</div>
<div class="row">
<EF:EFInput ename="result-0-contractName" cname="合同名称" colWidth="4" readonly="true"/>
<EF:EFSelect cname="合同类型" ename="result-0-contractType" colWidth="4" filter="contains" readonly="true" enable="false">
<EF:EFOption label="-- 请选择 --" value=""/>
<EF:EFCodeOption codeName="hggp.cw.contractType" condition="ITEM_CODE IN ('1', '2', '3', '5')"/>
</EF:EFSelect>
<EF:EFInput ename="result-0-contractNumber" cname="合同号" colWidth="4" readonly="true" />
<EF:EFSelect cname="合同类别" ename="result-0-contractCategory" colWidth="4" filter="contains" readonly="true" enable="false">
<EF:EFOption label="-- 请选择 --" value=""/>
<EF:EFCodeOption codeName="hggp.cw.contractCategory"/>
......
......@@ -93,7 +93,7 @@ $(function() {
break;
}
}
loadChange(grid,e,"billNumber");
loadChange(grid,e,"branchUnit");
}
if (e.field === "projCode"){
let projCode = item.projCode;
......
......@@ -75,6 +75,66 @@ function btnSaveFunc(btnNode, gridNode) {
return;
}
let flag = true;
if(gridNode == 'result'){
$.each(rows, function(index, item) {
let saveInvoiceQty = item['saveInvoiceQty'];
let depositQty = item['depositQty'];
let invoiceRemainingQty = item['invoiceRemainingQty'];
if (!isNumber(saveInvoiceQty) && !isPositiveNumber(saveInvoiceQty)) {
message("勾选的第" + (index + 1) + "行收票数量必须是大于0的数字");
flag = false;
return false;
}
if (parseFloat(saveInvoiceQty) > parseFloat(depositQty)) {
message("第" + (index + 1) + "行收票数量不能大于数量");
flag = false;
return false;
}
if (parseFloat(saveInvoiceQty) > parseFloat(invoiceRemainingQty)) {
message("第" + (index + 1) + "行收票数量不能大于收票剩余数量");
flag = false;
return false;
}
let saveInvoiceWeight = item['saveInvoiceWeight'];
let receiveWeight = item['receiveWeight'];
let invoiceRemainingWeight = item['invoiceRemainingWeight'];
if (!isNumber(saveInvoiceWeight) && !isPositiveNumber(saveInvoiceWeight)) {
message("勾选的第" + (index + 1) + "行收票重量必须是大于0的数字");
flag = false;
return false;
}
if (parseFloat(saveInvoiceWeight) > parseFloat(receiveWeight)) {
message("第" + (index + 1) + "行收票重量不能大于重量");
flag = false;
return false;
}
if (parseFloat(saveInvoiceWeight) > parseFloat(invoiceRemainingWeight)) {
message("第" + (index + 1) + "行收票重量不能大于收票剩余重量");
flag = false;
return false;
}
let thisSettlementAmount = item['thisSettlementAmount'];
let amount = item['amount'];
let invoiceRemainingAmount = item['invoiceRemainingAmount'];
if (!isNumber(thisSettlementAmount) && !isPositiveNumber(thisSettlementAmount)) {
message("勾选的第" + (index + 1) + "行发票总额必须是大于0的数字");
flag = false;
return false;
}
if (parseFloat(thisSettlementAmount) > parseFloat(amount)) {
message("第" + (index + 1) + "行发票总额不能大于收货金额");
flag = false;
return false;
}
if (parseFloat(thisSettlementAmount) > parseFloat(invoiceRemainingAmount)) {
message("第" + (index + 1) + "行发票总额不能大于收票剩余金额");
flag = false;
return false;
}
})
}
if(gridNode == 'resultA'){
$.each(rows, function(index, item) {
let thisAmount = item['thisAmount'];
......@@ -222,7 +282,7 @@ $(function () {
field: "depositQty",
title: "数量",
headerTemplate: "<span style='color: '>数量 </span>",
format:"{0:N0}",
format:"{0:N2}",
align:"right",
enable: false,
locked: false
......@@ -243,7 +303,7 @@ $(function () {
editType: "date",
parseFormats:"['yyyyMMdd']",
dateFormat:"yyyy-MM-dd",
enable: true,
enable: false,
locked: false,
template: function (date) {
if (date.receiveDate instanceof Date){
......@@ -271,18 +331,104 @@ $(function () {
format:"{0:C2}",
align:"right",
locked: false,
attributes: {required: true},
template: function (item) {
if (isBlank(item.thisSettlementAmount)){
//剩余金额大于0,默认为剩余金额
if (item.isInvoicing == 0 && item.invoiceRemainingAmount > 0 && isBlank(item.thisSettlementAmount)){
item.thisSettlementAmount = item.invoiceRemainingAmount;
}else if (isBlank(item.thisSettlementAmount)){
item.thisSettlementAmount = item.taxIncludeAmount;
resultGrid.setCellValue(item, "thisSettlementAmount", item.taxIncludeAmount)
}
item.saveInvoiceAmount = item.thisSettlementAmount;
return kendo.format("{0:C2}",parseFloat(item.thisSettlementAmount));
}
},
{
field: "saveInvoiceQty",
title: "收票数量",
headerTemplate: "<span style='color: '>收票数量 </span>",
format:"{0:N2}",
align:"right",
enable: true,
locked: false,
attributes: {required: true},
template: function (item) {
if (item.isInvoicing == 0 && item.invoiceRemainingQty > 0 && isBlank(item.saveInvoiceQty)){
item.saveInvoiceQty = item.invoiceRemainingQty;
}else if (item.isInvoicing == 0 && isBlank(item.saveInvoiceQty)){
item.saveInvoiceQty = item.depositQty;
}
return kendo.format("{0:N2}",parseFloat(item.saveInvoiceQty));
}
},
{
field: "saveInvoiceWeight",
title: "收票重量",
headerTemplate: "<span style='color: '>收票重量 </span>",
format:"{0:N2}",
align:"right",
enable: true,
locked: false,
attributes: {required: true},
template: function (item) {
if (item.isInvoicing == 0 && item.invoiceRemainingWeight > 0 && isBlank(item.saveInvoiceWeight)){
item.saveInvoiceWeight = item.invoiceRemainingWeight;
}else if (item.isInvoicing == 0 && isBlank(item.saveInvoiceWeight)){
item.saveInvoiceWeight = item.receiveWeight;
}
return kendo.format("{0:N2}",parseFloat(item.saveInvoiceWeight));
}
},
{
field: "invoiceRemainingQty",
title: "收票剩余数量",
headerTemplate: "<span style='color: '>收票剩余数量 </span>",
format:"{0:N2}",
align:"right",
enable: false,
locked: false,
template: function (item) {
if (item.isInvoicing == 0 && item.invoiceRemainingQty == 0){
item.invoiceRemainingQty = item.depositQty;
}
return kendo.format("{0:N2}",parseFloat(item.invoiceRemainingQty));
}
},
{
field: "invoiceRemainingWeight",
title: "收票剩余重量",
headerTemplate: "<span style='color: '>收票剩余重量 </span>",
format:"{0:N2}",
align:"right",
enable: false,
locked: false,
template: function (item) {
if (item.isInvoicing == 0 && item.invoiceRemainingWeight == 0){
item.invoiceRemainingWeight = item.receiveWeight;
}
return kendo.format("{0:N2}",parseFloat(item.invoiceRemainingWeight));
}
},
{
field: "invoiceRemainingAmount",
title: "收票剩余金额",
headerTemplate: "<span style='color: '>收票剩余金额 </span>",
format:"{0:C2}",
align:"right",
enable: false,
locked: false,
template: function (item) {
if (item.isInvoicing == 0 && item.invoiceRemainingAmount == 0){
item.invoiceRemainingAmount = item.amount;
}
return kendo.format("{0:N2}",parseFloat(item.invoiceRemainingAmount));
}
}],
loadComplete: function(grid) {
// 此 grid 对象
$("#info-tab-1").on("click", function () {
grid.dataSource.page(1);
});
},
dataBound: function (e) {
......
......@@ -69,6 +69,11 @@
displayType="0.000" sort="true" align="right" maxLength="17" required="false" defaultValue="0"
data-regex="/^-?[0-9]{1,17}([.][0-9]{1,3})?$/"
data-errorprompt="请输入数字,该值最大可设置17位整数和3位小数!"/>
<EF:EFComboColumn ename="source" cname="数据来源" width="120" align="center" filter="contains">
<EF:EFOption label="综合库存" value="1"/>
<EF:EFOption label="打包单" value="2"/>
</EF:EFComboColumn>
<EF:EFColumn ename="sourceId" cname="数据来源ID" hidden="true"/>
</EF:EFGrid>
</EF:EFRegion>
......
......@@ -36,7 +36,7 @@ $(function (){
template += '<a style="cursor: pointer;display: inline-flex;justify-content: center;margin:auto 5px" '
+ 'onclick="showApplyUser(\'' + item.applyCode + '\')" >添加人员</a>';
if (status == 0) {
template += '<br/><a style="cursor: pointer;display: inline-flex;justify-content: center;margin:auto 5px" '
template += '<a style="cursor: pointer;display: inline-flex;justify-content: center;margin:auto 5px" '
+ 'onclick="updateStatus(' + item.id + ',\'' + item.applyCode + '\')" >提交</a>';
}
}
......
......@@ -43,10 +43,13 @@
<EF:EFRegion id="result" title="记录集">
<EF:EFGrid blockId="result" autoDraw="no" isFloat="true" copyToAdd="false">
<EF:EFColumn ename="id" cname="主键" hidden="true"/>
<EF:EFColumn ename="operator" cname="操作" locked="true" enable="false" width="140" align="left"/>
<EF:EFColumn ename="operator" cname="操作" locked="true" enable="false" width="160" align="left"/>
<EF:EFComboColumn cname="类型" ename="receiveType" width="80" align="center" required="false" enable="false">
<EF:EFCodeOption codeName="hggp.receiveType"/>
</EF:EFComboColumn>
<EF:EFComboColumn cname="领料来源" ename="dataSource" width="80" align="center" required="true" enable="true" >
<EF:EFCodeOption codeName="hggp.receiveDataSource"/>
</EF:EFComboColumn>
<EF:EFComboColumn ename="companyCode" cname="公司名称"
columnTemplate="#=textField#" itemTemplate="#=textField#"
textField="textField" valueField="valueField"
......
......@@ -5,6 +5,7 @@ $(function (){
$(".row").children().attr("class", "col-md-3");
$("#QUERY").on("click", query);
var receiveDataSource = $("#main-0-dataSource").val();
/* 页面查询框的尺寸设置 */
$.extend(true, IPLATUI.Config, {
EFGrid: {
......@@ -18,6 +19,13 @@ $(function (){
pageSize: 10,
pageSizes: [10, 20, 50, 100],
},
toolbarConfig: {
// hidden: false, // true时,不显示功能按钮,但保留setting导出按钮
add: receiveDataSource === 2 ? false : true, // 不显示新增按钮
add: receiveDataSource === 2 ? false : true, // 不显示取消按钮
save: receiveDataSource === 2 ? false : true // 不显示保存按钮
// delete: false, // 显示删除按钮
},
beforeEdit: function (e) {
var status = $("#inqu_status-0-status").val();
//如果提交了,则不能修改
......@@ -137,8 +145,12 @@ $(function (){
},
}
}
// 选择合同
$("#SELECT_INVENT").on("click", selectInvent);
// 选择产品清单
$("#SELECT_MBOM").on("click", selectMbom);
downKeyUp();
})
......@@ -148,17 +160,27 @@ $(function (){
* 页面加载时执行
*/
$(window).load(function () {
// 按钮显示
let status = $("#main-0-status").val();
//如果提交了,则不能修改
if (isBlank(status) || status != "0") {
$('#add').hide();
$('#save-changes').hide();
$('#cancel-changes').hide();
$('#delete').hide();
}
let receiveDataSource = $("#main-0-dataSource").val();
//选择产品时
if(receiveDataSource == 2){
$("#SELECT_INVENT").hide();
$('#add').hide();
$('#save-changes').hide();
$('#cancel-changes').hide();
}else{
$("#SELECT_MBOM").hide();
}
// 查询
query();
// 按钮显示
let status = $("#main-0-status").val();
//如果提交了,则不能修改
if (isBlank(status) || status != "0") {
$('#add').hide();
$('#save-changes').hide();
$('#cancel-changes').hide();
$('#delete').hide();
}
});
/**
......@@ -240,6 +262,29 @@ let selectInvent = function () {
}
/**
* 选择
*/
let selectMbom = function () {
let params = {
"inqu_status-0-receiveId": $("#inqu_status-0-receiveId").val(),
"inqu_status-0-companyCode": $("#main-0-companyCode").val(),
"inqu_status-0-whCode": $("#main-0-whCode").val(),
"inqu_status-0-whName": $("#main-0-whName").val(),
"inqu_status-0-companyName": $("#main-0-companyName").val(),
"inqu_status-0-projCode": $("#main-0-projCode").val(),
"inqu_status-0-projName": $("#main-0-projName").val()
}
JSColorbox.open({
href: "HGKC008D",
title: "<div style='text-align: center;'>产品清单</div>",
width: "90%",
height: "90%",
params: params,
callbackName: selectInventCallback
});
}
/**
* 选择回调
*/
let selectInventCallback = function () {
......
......@@ -12,8 +12,13 @@
<EF:EFInput ename="main-0-applyCode" cname="领料单号" colWidth="3" type="hidden"/>
<EF:EFInput ename="main-0-status" cname="状态" colWidth="3" type="hidden"/>
<EF:EFInput ename="main-0-whCode" cname="仓库编码" colWidth="3" type="hidden"/>
<EF:EFInput ename="main-0-companyCode" cname="公司编码" colWidth="3" type="hidden"/>
<EF:EFRegion id="inqu" title="查询条件">
<EF:EFInput ename="main-0-whName" cname="仓库名称" colWidth="3" type="hidden"/>
<EF:EFInput ename="main-0-companyCode" cname="公司编码" colWidth="3" type="hidden"/>
<EF:EFInput ename="main-0-companyName" cname="公司名称" colWidth="3" type="hidden"/>
<EF:EFInput ename="main-0-projCode" cname="项目编码" colWidth="3" type="hidden"/>
<EF:EFInput ename="main-0-projName" cname="项目名称" colWidth="3" type="hidden"/>
<EF:EFInput ename="main-0-dataSource" cname="领料来源" colWidth="3" type="hidden"/>
<EF:EFRegion id="inqu" title="查询条件">
<EF:EFInput ename="inqu_status-0-applyCode" cname="申请编码" colWidth="3" type="hidden"/>
<EF:EFInput ename="inqu_status-0-receiveId" cname="领料单id" colWidth="3" type="hidden"/>
<div class="row">
......
$(function () {
IPLATUI.EFGrid = {
"result": {
exportGrid: false, // 隐藏右侧自定义导出按钮
columns: [{
field: "whCode",
template: function (dataItem) {
return $("#inqu_status-0-whCode").val();
}
},
{
field: "whCode",
template: function (dataItem) {
return $("#inqu_status-0-whCode").val();
}
},
{
field: "whName",
template: function (dataItem) {
return $("#inqu_status-0-whName").val();
}
},
{
field: "companyCode",
template: function (dataItem) {
return $("#inqu_status-0-companyCode").val();
}
},
{
field: "companyName",
template: function (dataItem) {
return $("#inqu_status-0-companyName").val();
}
},
{
field: "projCode",
template: function (dataItem) {
return $("#inqu_status-0-projCode").val();
}
},
{
field: "projName",
template: function (dataItem) {
return $("#inqu_status-0-projName").val();
}
}
// {
// field: "productCode",
// template: function (dataItem) {
// let lv = dataItem.lv;
// let template = dataItem.productCode;
// if(lv == 4){
// template = dataItem.parentProdCode;
// }
// return template;
// }
// },
// {
// field: "productName",
// template: function (dataItem) {
// let lv = dataItem.lv;
// let template = dataItem.productName;
// if(lv == 4){
// template = dataItem.parentProdName;
// }
// return template;
// }
// },
// {
// field: "materialCode",
// template: function (dataItem) {
// let lv = dataItem.lv;
// let template = '';
// if(lv == 4){
// template = dataItem.productCode;
// }
// return template;
// }
// },
// {
// field: "materialtName",
// template: function (dataItem) {
// let lv = dataItem.lv;
// let template = '';
// if(lv == 4){
// template = dataItem.productName;
// }
// return template;
// }
// }
]
},
};
// 查询
$("#QUERY").on("click", query);
// 确认
$("#CONFIRM").on("click", confirm);
});
/**
* 页面加载时执行
*/
$(window).load(function () {
// 查询
query();
//存货编号查询条件
// initInventCode();
});
/**
* 查询
*/
let query = function () {
resultGrid.dataSource.page(1); // 点击查询按钮,从第1页开始查询
}
/**
* 选择
*/
let confirm = function () {
let rows = resultGrid.getCheckedRows();
if (rows.length < 1) {
message("请选择数据")
return;
}
for (let i = 0; i < rows.length; i++) {
let applyQty = rows[i]['applyQty'];
let invQty = rows[i]['invQty'];
if (!isPositiveNumber(applyQty)) {
message("勾选的第" + (i + 1) + "行申请数量必须大于0");
return;
}
if (parseFloat(invQty) < parseFloat(applyQty)) {
message("勾选的第" + (i + 1) + "行申请数量不能大于库存数量");
return;
}
}
JSUtils.confirm("确定对勾选的[" + rows.length + "]条数据进行\"生产领料\"操作吗? ", {
ok: function () {
JSUtils.submitGridsData("result", "HGKC008D", "confirm",
true, function (e) {
var status = e.getStatus();
if (status !== -1) {
parent.JSColorbox.setValueCallback();
}
}
);
}
});
}
/**
* 存货编号
*/
let initInventCode = function () {
//物料信息下拉
var inInfo=new EiInfo();
EiCommunicator.send("HGPZ005", "queryComboBox", inInfo, {
onSuccess: function (ei) {
let dataSource;
var input=$("#inqu_status-0-inventCode");
dataSource=ei.getBlock("invent_record_block_id").getMappedRows();
input.kendoDropDownList({
valuePrimitive: true,
dataTextField: "textField",
dataValueField: "valueField",
optionLabel:"请选择",
dataSource: dataSource,
template: "[#:valueField#]#:textField#|#:param2Field#",
filter: "contains"
});
}, onFail: function (ei) {
}
}, {async: false});
}
<!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="查询条件">
<EF:EFInput ename="inqu_status-0-companyCode" cname="公司编号" colWidth="3" type="hidden"/>
<EF:EFInput ename="inqu_status-0-companyName" cname="公司编号" colWidth="3" type="hidden"/>
<EF:EFInput ename="inqu_status-0-receiveId" cname="领料单id" colWidth="3" type="hidden"/>
<EF:EFInput ename="inqu_status-0-projCode" cname="项目编号" colWidth="3" type="hidden"/>
<EF:EFInput ename="inqu_status-0-whName" cname="仓库名称" colWidth="3" type="hidden"/>
<div class="row">
<EF:EFInput cname="项目名称" ename="projName" blockId="inqu_status" row="0" colWidth="3" readonly="true"/>
<EF:EFInput cname="仓库名称" ename="whName" blockId="inqu_status" row="0" colWidth="3" readonly="true"/>
<EF:EFInput cname="材料名称" ename="materialName" blockId="inqu_status" row="0" colWidth="3"/>
<EF:EFInput cname="成品名称" ename="productName" blockId="inqu_status" row="0" colWidth="3"/>
</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="companyCode" cname="公司编码" enable="false" width="100" align="center" hidden="true"/>
<EF:EFColumn ename="companyName" cname="公司名称" enable="false" width="130" align="center" hidden="true"/>
<EF:EFColumn ename="projCode" cname="项目编码" enable="false" width="100" align="center" hidden="true"/>
<EF:EFColumn ename="projName" cname="项目名称" enable="false" width="130" align="center" hidden="true"/>
<EF:EFColumn ename="whCode" cname="仓库编号" enable="false" width="130" align="center" hidden="true"/>
<EF:EFColumn ename="whName" cname="仓库名称" enable="false" width="130" align="center" />
<EF:EFComboColumn ename="inventType" cname="存货类型" enable="false" width="100" align="center"
blockName="invent_type_block_id" textField="textField" valueField="valueField">
</EF:EFComboColumn>
<EF:EFColumn ename="parentProdCode" cname="成品编码" enable="false" width="100" align="center"/>
<EF:EFColumn ename="parentProdName" cname="成品名称" enable="false" width="100" align="center"/>
<EF:EFColumn ename="materialCode" cname="材料编码" enable="false" width="100" align="center"/>
<EF:EFColumn ename="materialtName" cname="材料名称" enable="false" width="100" align="center"/>
<EF:EFColumn ename="spec" cname="规格" enable="false" width="120" align="center"/>
<EF:EFColumn ename="applyQty" cname="申请数量" width="120" align="right" format="{0:N3}" required="true"/>
<EF:EFColumn ename="quantity" cname="数量" enable="false" width="120" align="right" format="{0:N3}"/>
<EF:EFColumn ename="totalWeight" cname="重量(KG)" enable="false" width="120" align="right" format="{0:N3}"/>
<EF:EFColumn ename="material" cname="材质" enable="false" width="80" align="center"/>
<EF:EFColumn ename="length" cname="长(MM)" width="80" align="right" format="{0:N3}"/>
<EF:EFColumn ename="width" cname="宽(MM)" width="80" align="right" format="{0:N3}"/>
<EF:EFColumn ename="thick" cname="厚(MM)" width="80" 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:EFColumn ename="updatedName" cname="更新人" enable="false" width="100" align="center"/>
<EF:EFColumn ename="updatedTime" cname="更新时刻" enable="false" width="140" align="center"
editType="datetime" parseFormats="['yyyyMMddHHmmss']"/>
</EF:EFGrid>
</EF:EFRegion>
</EF:EFPage>
$(function () {
IPLATUI.EFGrid = {
"result": {
exportGrid: false, // 隐藏右侧自定义导出按钮
columns: [ {
field: "operator",
title: "操作",
template: function (item) {
let template = '';
if (item.companyCode) {
template += '<a style="cursor: pointer;display: inline-flex;justify-content: center;margin:auto 5px" '
+ 'onclick="showDetail(' + item.id + ',\''+item.inventCode+'\')" >详情</a>';
}
return template;
}
}]
},
};
// 查询
$("#QUERY").on("click", query);
});
/**
* 页面加载时执行
*/
$(window).load(function () {
// 查询
query();
//存货编号查询条件
initInventCode();
});
/**
* 查询
*/
let query = function () {
resultGrid.dataSource.page(1); // 点击查询按钮,从第1页开始查询
}
/**
* 存货编号
*/
let initInventCode = function () {
//物料信息下拉
var inInfo=new EiInfo();
EiCommunicator.send("HGPZ005", "queryComboBox", inInfo, {
onSuccess: function (ei) {
let dataSource;
var input=$("#inqu_status-0-inventCode");
dataSource=ei.getBlock("invent_record_block_id").getMappedRows();
input.kendoDropDownList({
valuePrimitive: true,
dataTextField: "textField",
dataValueField: "valueField",
optionLabel:"请选择",
dataSource: dataSource,
template: "[#:valueField#]#:textField#|#:param2Field#",
filter: "contains"
});
}, onFail: function (ei) {
}
}, {async: false});
}
/**
* 显示详情
*/
function showDetail(id,inventCode) {
JSColorbox.open({
href: "HGKC016A?methodName=initLoad&inqu_status-0-inventCode="+inventCode+"&inqu_status-0-parentId="+id,
title: "<div style='text-align: center;'>详情</div>",
width: "80%",
height: "80%",
});
}
\ No newline at end of file
<%--
Created by IntelliJ IDEA.
User: 1
Date: 2024/10/24
Time: 18:20
To change this template use File | Settings | File Templates.
--%>
<!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="companyCode" row="0" colWidth="3"
filter="contains" optionLabel="全部" defultValue="">
<EF:EFOptions blockId="roleCompany" valueField="companyCode" textField="companyName"/>
</EF:EFSelect>
<EF:EFSelect cname="仓库名称" blockId="inqu_status" ename="whCode" row="0" colWidth="3"
optionLabel="全部" defultValue="" filter="contains">
<EF:EFOptions blockId="wh_record_block_id" textField="textField" valueField="valueField"/>
</EF:EFSelect>
<EF:EFSelect cname="存货类型" blockId="inqu_status" ename="inventType" row="0" colWidth="3"
optionLabel="全部" defultValue="" filter="contains">
<EF:EFOptions blockId="invent_type_block_id" textField="textField" valueField="valueField"/>
</EF:EFSelect>
<EF:EFSelect cname="存货编号" blockId="inqu_status" ename="inventCode" row="0" colWidth="3"
filter="contains" optionLabel="全部" defultValue="" template="[#=valueField#]#=textField#">
<EF:EFOptions blockId="invent_record_block_id" textField="textField" valueField="valueField"/>
</EF:EFSelect>
</div>
<%-- <div class="row">--%>
<%-- <EF:EFSelect cname="规格" blockId="inqu_status" ename="spec" row="0" colWidth="3"--%>
<%-- optionLabel="全部" defultValue="" filter="contains">--%>
<%-- <EF:EFOptions blockId="spec_name_block_id" textField="textField" valueField="valueField"/>--%>
<%-- </EF:EFSelect>--%>
<%-- </div>--%>
</EF:EFRegion>
<EF:EFRegion id="result" title="明细信息">
<EF:EFGrid blockId="result" autoDraw="override" isFloat="true" checkMode="row">
<EF:EFColumn ename="id" cname="内码" hidden="true"/>
<EF:EFColumn ename="operator" cname="操作" locked="true" width="120" enable="false" align="center"/>
<EF:EFColumn ename="companyCode" cname="公司编码" enable="false" width="100" align="center" hidden="true"/>
<EF:EFColumn ename="companyName" cname="公司名称" enable="false" width="130" align="center"/>
<EF:EFComboColumn ename="whCode" cname="仓库名称" enable="false" width="120" align="center"
blockName="wh_record_block_id" textField="textField" valueField="valueField">
</EF:EFComboColumn>
<EF:EFComboColumn ename="inventType" cname="存货类型" enable="false" width="100" align="center"
blockName="invent_type_block_id" textField="textField" valueField="valueField">
</EF:EFComboColumn>
<EF:EFColumn ename="inventCode" cname="存货编码" enable="false" width="100" align="center"/>
<EF:EFColumn ename="inventName" cname="存货名称" enable="false" width="100" align="center"/>
<EF:EFColumn ename="specId" cname="规格ID" enable="false" width="100" align="center" hidden="true"/>
<EF:EFColumn ename="spec" cname="规格" enable="false" width="120" align="center"/>
<EF:EFColumn ename="invQty" cname="库存数量" enable="false" width="120" align="right" format="{0:N3}"
sumType="page"/>
<EF:EFColumn ename="invUnitWeight" cname="单重(KG)" enable="false" width="120" align="right" format="{0:N3}"/>
<EF:EFColumn ename="invWeight" cname="库存总重(KG)" enable="false" width="120" align="right" format="{0:N3}"
sumType="page"/>
<EF:EFColumn ename="material" cname="材质" enable="false" width="80" align="center" hidden="true"/>
<EF:EFColumn ename="unit" cname="单位" enable="false" width="80" align="center"/>
<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" width="100" align="center"/>
<EF:EFColumn ename="updatedTime" cname="更新时刻" enable="false" width="140" align="center"
editType="datetime" parseFormats="['yyyyMMddHHmmss']"/>
</EF:EFGrid>
</EF:EFRegion>
</EF:EFPage>
$(function () {
$(".row").children().attr("class", "col-md-3");
$("#QUERY").on("click", query);
IPLATUI.EFGrid= {
"result": {
pageable: {
pageSize: 10,
pageSizes: [10, 20, 50, 100],
},
columns: [{
field: "operator",
title: "操作",
template: function (item) {
let template = '';
if (!isBlank(item.parentId)) {
template += '<a style="cursor: pointer;display: inline-flex;justify-content: center;margin:auto 5px" '
+ 'onclick="showDetail(' + item.id + ',' + item.invQty + ')" >拆单</a>';
}
return template;
}
}],
exportGrid: {
exportFileName: function (gridInstance) {
// 导出的文件名包含时间戳 yyyy-MM-dd HH:mm:ss
return "打包单详情" + kendo.toString(new Date(), IPLAT.FORMAT.DATE_14_PR);
},
exportFileType: "xls", // 默认值是xls,可选值为pdf[规划中]
exportBlockId: "result", // 默认值和blockId相同,导出的EiInfo中的指定数据块被导出
},
loadComplete: function(grid) {
//console.log(dayjs,"dayjs")
// 此 grid 对象
// 处理父子级联动,通过监听 change 事件,判断父级节点是否发生变化
grid.dataSource.bind("change", function(e) {
// 判断父级节点是否发生变化
if (e.field === "invQty") {
let item = e.items[0];
let invWeight = item.invQty * item.invUnitWeight;
resultGrid.setCellValue(item, 'invWeight', invWeight);
}
});
},
onSave: function (e) {
// 阻止默认请求,使用自定义保存
e.preventDefault();
let btnNode = $(this);
//禁用按钮
btnNode.attr("disabled", true);
save(btnNode);
},
onDelete: function (e) {
// 阻止默认请求,使用自定义删除
//e.preventDefault();
//deleteFunc();
},
onSuccess: function (e) {
if (e.eiInfo.extAttr.methodName == 'save' || e.eiInfo.extAttr.methodName == 'delete') {
query();
}
},
onRowClick: function (e) {
}
}
}
IPLATUI.EFWindow = {
"HGKC016B": {
close: function (e) {
// 刷新结果列表
query();
}
}
}
downKeyUp();
});
/**
* 页面加载时执行
*/
$(window).load(function () {
// 查询
query();
});
let query = function () {
resultGrid.dataSource.page(1);
}
/**
* 显示详情
*/
function showDetail(id, invQty) {
JSColorbox.open({
href: "HGKC016B?methodName=initLoad&inqu_status-0-id="+id+"&inqu_status-0-invQty="+invQty,
title: "<div style='text-align: center;'>拆单</div>",
width: "80%",
height: "80%",
callbackName: Callback
});
}
/**
* 挑选库存回调
*/
let Callback = function () {
// 刷新页面
query();
// 关闭弹窗
JSColorbox.close();
}
/**
* 保存
*/
let save = function (btnNode) {
let rows = resultGrid.getCheckedRows();
if (rows.length < 1) {
message("请选择数据");
return;
}
let flag = true;
$.each(rows, function(index, item) {
let invQty = item.get("invQty");
if(isBlank(invQty) || !isNumber(invQty) || invQty <= 0){
message("选中的第"+(index+1)+"行\"数量\",不能为空并且大于0!");
flag = false;
return false;
}
});
if(flag) {
JSUtils.confirm("确定对勾选中的[" + rows.length + "]条数据做\"保存\"操作? ", {
ok: function () {
JSUtils.submitGridsData("result", "HGKC016A", "save", true,
function (e) {
if (e.getStatus()!==-1){
btnNode.attr("disabled", false);
query();
}
});
}
});
}
}
\ No newline at end of file
<%--
Created by IntelliJ IDEA.
User: 1
Date: 2024/10/24
Time: 18:21
To change this template use File | Settings | File Templates.
--%>
<!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}"/>
<script>
var ctx = "${ctx}";
</script>
<EF:EFPage title="打包库存明细">
<EF:EFRegion id="result" title="记录集">
<EF:EFInput blockId="inqu_status" row="0" ename="parentId" cname="父级ID" type="hidden" colWidth="3"/>
<EF:EFInput blockId="inqu_status" row="0" ename="inventCode" cname="产品编码" type="hidden" colWidth="3"/>
<EF:EFGrid blockId="result" autoDraw="override" isFloat="true">
<EF:EFColumn ename="id" cname="主键" hidden="true"/>
<EF:EFColumn ename="operator" cname="操作" locked="true" width="120" enable="false" align="center"/>
<EF:EFColumn ename="inventType" cname="存货类型" hidden="true"/>
<EF:EFColumn ename="inventTypeDetail" cname="存货类型大类" hidden="true"/>
<EF:EFColumn ename="inventCode" cname="产品编码" enable="false" width="120"/>
<EF:EFColumn ename="inventName" cname="产品名称" enable="false" width="120"/>
<EF:EFColumn ename="spec" cname="规格" enable="false" width="120"/>
<EF:EFColumn ename="specId" cname="规格ID" width="120" enable="true" readonly="true" align="center" hidden="true" />
<EF:EFColumn ename="length" cname="长度(MM)" enable="true" readonly="false" width="100" align="right" format="{0:N3}"/>
<EF:EFColumn ename="width" cname="宽度(MM)" enable="true" readonly="false" width="100" align="right" format="{0:N3}" />
<EF:EFColumn ename="thick" cname="厚度(MM)" enable="true" readonly="false" width="100" align="right" format="{0:N3}" />
<EF:EFColumn ename="unit" cname="打包单位" enable="true" readonly="false" width="100" align="right" format="{0:N3}" />
<EF:EFColumn ename="invQty" cname="数量" width="120" enable="true" format="{0:N0}" editType="text"
displayType="0.000" sort="true" align="right" readonly="true"
data-regex="/^-?[0-9]{1,15}?$/" maxLength="15" required="true"
data-errorprompt="请输入数字,该值最大可设置15位整数!"/>
<EF:EFColumn ename="invUnitWeight" cname="单重(KG)" width="120" enable="true" format="{0:N3}" editType="text" hidden="true"
displayType="0.000" sort="true" align="right" readonly="true"
data-regex="/^-?[0-9]{1,20}([.][0-9]{1,3})?$/" maxLength="20" required="true"
data-errorprompt="请输入数字,该值最大可设置15位整数和3位小数!"/>
<EF:EFColumn ename="invWeight" cname="打包重量(KG)" width="120" enable="false" format="{0:N3}" editType="text" hidden="true"
displayType="0.000" sort="true" align="right"
data-regex="/^-?[0-9]{1,15}([.][0-9]{1,3})?$/" maxLength="15" required="true"
data-errorprompt="请输入数字,该值最大可设置15位整数和3位小数!"/>
</EF:EFGrid>
</EF:EFRegion>
</EF:EFPage>
$(function () {
$(".row").children().attr("class", "col-md-3");
$("#QUERY").on("click", query);
IPLATUI.EFGrid= {
"result": {
pageable: {
pageSize: 10,
pageSizes: [10, 20, 50, 100],
},
columns: [
],
exportGrid: {
exportFileName: function (gridInstance) {
// 导出的文件名包含时间戳 yyyy-MM-dd HH:mm:ss
return "打包单详情" + kendo.toString(new Date(), IPLAT.FORMAT.DATE_14_PR);
},
exportFileType: "xls", // 默认值是xls,可选值为pdf[规划中]
exportBlockId: "result", // 默认值和blockId相同,导出的EiInfo中的指定数据块被导出
},
loadComplete: function(grid) {
//console.log(dayjs,"dayjs")
// 此 grid 对象
// 处理父子级联动,通过监听 change 事件,判断父级节点是否发生变化
grid.dataSource.bind("change", function(e) {
// 判断父级节点是否发生变化
if (e.field === "invQty") {
let item = e.items[0];
let invWeight = item.invQty * item.invUnitWeight;
resultGrid.setCellValue(item, 'invWeight', invWeight);
}
});
},
onAdd: function (e) {
let list = resultGrid.getDataItems();
$.each(e.items, function (index, item) {
let num= list.length;
if (num > 0){
item['id'] = 0;
item['inventType'] = list[num-1].inventType;
item['inventTypeDetail'] = list[num-1].inventTypeDetail;
item['inventCode'] = list[num-1].inventCode;
item['inventName'] = list[num-1].inventName;
item['spec'] = list[num-1].spec;
item['specId'] = list[num-1].specId;
item['length'] = list[num-1].length;
item['width'] = list[num-1].width;
item['thick'] = list[num-1].thick;
item['unit'] = list[num-1].unit;
item['invQty'] = 0;
item['invUnitWeight'] = list[num-1].invUnitWeight;
item['invWeight'] = 0;
item['parentId'] = list[num-1].parentId;
item['packCode'] = list[num-1].packCode;
}
});
},
onSave: function (e) {
// 阻止默认请求,使用自定义保存
e.preventDefault();
let btnNode = $(this);
//禁用按钮
btnNode.attr("disabled", true);
save(btnNode);
},
onDelete: function (e) {
// 阻止默认请求,使用自定义删除
//e.preventDefault();
//deleteFunc();
},
onSuccess: function (e) {
if (e.eiInfo.extAttr.methodName == 'save' || e.eiInfo.extAttr.methodName == 'delete') {
query();
}
},
onRowClick: function (e) {
}
}
}
downKeyUp();
});
/**
* 页面加载时执行
*/
$(window).load(function () {
// 查询
query();
});
let query = function () {
resultGrid.dataSource.page(1);
}
/**
* 保存
*/
let save = function (btnNode) {
let rows = resultGrid.getCheckedRows();
if (rows.length < 1) {
message("请选择数据");
return;
}
let flag = true;
let invQty = $("#inqu_status-0-invQty").val();
let sum = 0;
$.each(rows, function(index, item) {
let invQty = item.get("invQty");
if(isBlank(invQty) || !isNumber(invQty) || invQty <= 0){
message("选中的第"+(index+1)+"行\"数量\",不能为空并且大于0!");
flag = false;
return false;
}
sum += parseFloat(invQty);
});
if (sum > invQty || sum < invQty){
message("选中的总数量不能大于或小于" + invQty);
flag = false;
}
if(flag) {
JSUtils.confirm("确定对勾选中的[" + rows.length + "]条数据做\"保存\"操作? ", {
ok: function () {
JSUtils.submitGridsData("result", "HGKC016B", "save", true,
function (e) {
if (e.getStatus()!==-1){
parent.JSColorbox.setValueCallback(e);
}
});
}
});
}
}
\ No newline at end of file
<%--
Created by IntelliJ IDEA.
User: 1
Date: 2024/10/26
Time: 9:06
To change this template use File | Settings | File Templates.
--%>
<!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}"/>
<script>
var ctx = "${ctx}";
</script>
<EF:EFPage title="打包库存明细拆单">
<EF:EFRegion id="inqu" title="基本信息">
<div class="row">
<EF:EFInput ename="inqu_status-0-invQty" cname="拆单数量" colWidth="3" type="text" />
<EF:EFInput blockId="inqu_status" row="0" ename="id" cname="id" type="hidden" colWidth="3"/>
</div>
</EF:EFRegion>
<EF:EFRegion id="result" title="记录集">
<EF:EFGrid blockId="result" autoDraw="override" isFloat="true">
<EF:EFColumn ename="id" cname="主键" hidden="true"/>
<EF:EFColumn ename="inventType" cname="存货类型" hidden="true"/>
<EF:EFColumn ename="inventTypeDetail" cname="存货类型大类" hidden="true"/>
<EF:EFColumn ename="inventCode" cname="产品编码" enable="false" width="120"/>
<EF:EFColumn ename="inventName" cname="产品名称" enable="false" width="120"/>
<EF:EFColumn ename="spec" cname="规格" enable="false" width="120"/>
<EF:EFColumn ename="specId" cname="规格ID" width="120" enable="true" readonly="true" align="center" hidden="true" />
<EF:EFColumn ename="length" cname="长度(MM)" enable="true" readonly="false" width="100" align="right" format="{0:N3}"/>
<EF:EFColumn ename="width" cname="宽度(MM)" enable="true" readonly="false" width="100" align="right" format="{0:N3}" />
<EF:EFColumn ename="thick" cname="厚度(MM)" enable="true" readonly="false" width="100" align="right" format="{0:N3}" />
<EF:EFColumn ename="unit" cname="打包单位" enable="true" readonly="false" width="100" align="right" format="{0:N3}" />
<EF:EFColumn ename="invQty" cname="数量" width="120" enable="true" format="{0:N0}" editType="text"
displayType="0.000" sort="true" align="right" sumType="page"
data-regex="/^-?[0-9]{1,15}?$/" maxLength="15" required="true"
data-errorprompt="请输入数字,该值最大可设置15位整数!"/>
<EF:EFColumn ename="invUnitWeight" cname="单重(KG)" width="120" enable="true" format="{0:N3}" editType="text" hidden="true"
displayType="0.000" sort="true" align="right" readonly="true"
data-regex="/^-?[0-9]{1,20}([.][0-9]{1,3})?$/" maxLength="20" required="true"
data-errorprompt="请输入数字,该值最大可设置15位整数和3位小数!"/>
<EF:EFColumn ename="invWeight" cname="打包重量(KG)" width="120" enable="false" format="{0:N3}" editType="text" hidden="true"
displayType="0.000" sort="true" align="right"
data-regex="/^-?[0-9]{1,15}([.][0-9]{1,3})?$/" maxLength="15" required="true"
data-errorprompt="请输入数字,该值最大可设置15位整数和3位小数!"/>
</EF:EFGrid>
</EF:EFRegion>
</EF:EFPage>
<%@ page import="com.baosight.iplat4j.core.web.threadlocal.UserSession" %><%--
Created by IntelliJ IDEA.
User: 1
Date: 2024/10/24
Time: 18:21
To change this template use File | Settings | File Templates.
--%>
<!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" %>
<%
String loginName = UserSession.getLoginName();
%>
<c:set var="ctx" value="${pageContext.request.contextPath}"/>
<c:set var="loginName" value="<%=loginName%>" />
<EF:EFPage title="打包单">
<EF:EFRegion id="inqu" title="查询条件">
<div class="row">
<EF:EFSelect cname="公司名称" blockId="inqu_status" ename="companyCode" row="0" colWidth="3"
filter="contains" optionLabel="全部" defultValue="">
<EF:EFOptions blockId="roleCompany" valueField="companyCode" textField="companyName"/>
</EF:EFSelect>
<EF:EFSelect cname="项目名称" blockId="inqu_status" ename="whCode" row="0" colWidth="3"
optionLabel="全部" defultValue="" filter="contains">
<EF:EFOptions blockId="proj_record_block_id" textField="textField" valueField="valueField"/>
</EF:EFSelect>
<EF:EFDatePicker blockId="inqu_status" row="0" ename="packDate" cname="打包日期" role="date"
format="yyyy-MM-dd" parseFormats="['yyyyMMdd']" colWidth="3"/>
<EF:EFInput blockId="inqu_status" row="0" ename="packCode" cname="打包单号" placeholder="模糊查询" colWidth="3"/>
<EF:EFInput blockId="inqu_status" row="0" ename="packUserName" cname="打包人员" placeholder="模糊查询" colWidth="3"/>
</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="accountCode" cname="账套" hidden="true"/>
<EF:EFColumn ename="operator" cname="操作" locked="true" width="120" enable="false" align="center"/>
<EF:EFComboColumn ename="companyCode" cname="公司名称" enable="true" width="160" align="center" required="true"
blockName="roleCompany" textField="companyName" valueField="companyCode">
</EF:EFComboColumn>
<EF:EFColumn ename="companyName" cname="公司名称" enable="true" width="130" align="center" hidden="true"/>
<EF:EFComboColumn ename="projCode" cname="项目名称" enable="true" width="160" align="center" required="true"
blockName="proj_record_block_id" textField="textField" valueField="valueField">
</EF:EFComboColumn>
<EF:EFColumn ename="projName" cname="项目名称" enable="true" width="130" align="center" hidden="true"/>
<EF:EFComboColumn ename="whCode" cname="仓库名称" enable="true" width="160" align="center" required="true"
blockName="wh_record_block_id" textField="textField" valueField="valueField">
</EF:EFComboColumn>
<EF:EFColumn ename="whName" cname="仓库名称" enable="true" width="130" align="center" hidden="true"/>
<EF:EFColumn ename="packDate" cname="打包日期" enable="true" width="100" align="center" editType="date" required="true"
dateFormat="yyyy-MM-dd" parseFormats="['yyyyMMdd']"/>
<EF:EFColumn ename="packCode" cname="打包单号" enable="false" width="130" align="center"/>
<EF:EFComboColumn cname="打包类型" ename="packType" width="100" align="center" required="false" enable="true" defaultValue="1">
<EF:EFCodeOption codeName="hggp.kc.packType" />
</EF:EFComboColumn>
<EF:EFColumn ename="inventCode" cname="产品编码" width="120" align="center" required="true"/>
<EF:EFColumn ename="inventName" cname="产品名称" enable="true" width="140" align="center"/>
<EF:EFColumn ename="specId" cname="规格ID" enable="true" width="100" align="center" hidden="true"/>
<EF:EFColumn ename="spec" cname="规格" enable="false" width="120" align="center"/>
<EF:EFColumn ename="length" cname="长(MM)" enable="false" width="80" align="right" format="{0:N3}"/>
<EF:EFColumn ename="width" cname="宽(MM)" enable="false" width="80" align="right" format="{0:N3}"/>
<EF:EFColumn ename="thick" cname="厚(MM)" enable="false" width="80" align="right" format="{0:N3}"/>
<EF:EFColumn ename="unit" cname="打包单位" enable="true" width="80" align="center"/>
<EF:EFColumn ename="invQty" cname="打包数量" enable="true" width="120" align="right" format="{0:N0}" required="true"/>
<EF:EFColumn ename="invUnitWeight" cname="单重(KG)" enable="true" width="120" align="right" format="{0:N3}" hidden="true"/>
<EF:EFColumn ename="invWeight" cname="打包总重(KG)" enable="true" width="120" align="right" format="{0:N3}" hidden="true"/>
<EF:EFComboColumn ename="packUserId" cname="打包人员" enable="true" width="100" align="center" defaultValue="${loginName}" required="true"
blockName="user_block_id" textField="textField" valueField="valueField"/>
<EF:EFColumn ename="packUserName" cname="打包人员名称" enable="true" width="120" align="center" hidden="true"/>
<EF:EFComboColumn cname="提交状态" ename="status" width="90" align="center" required="false" enable="false" defaultValue="0">
<EF:EFCodeOption codeName="hggp.sc.productStatus" />
</EF:EFComboColumn>
</EF:EFGrid>
</EF:EFRegion>
</EF:EFPage>
$(function () {
var companyCodeBox = __eiInfo.getBlock("roleCompany").getMappedRows();
var projRecordBox = __eiInfo.getBlock("proj_record_block_id").getMappedRows();
var userIdBox = __eiInfo.getBlock("user_block_id").getMappedRows();
var inventRecordBox = __eiInfo.getBlock("invent_code_box_block_id").getMappedRows();
$(".row").children().attr("class", "col-md-3");
$("#QUERY").on("click", query);
IPLATUI.EFGrid= {
"result": {
pageable: {
pageSize: 10,
pageSizes: [10, 20, 50, 100],
},
columns: [
],
exportGrid: {
exportFileName: function (gridInstance) {
// 导出的文件名包含时间戳 yyyy-MM-dd HH:mm:ss
return "打包单详情" + kendo.toString(new Date(), IPLAT.FORMAT.DATE_14_PR);
},
exportFileType: "xls", // 默认值是xls,可选值为pdf[规划中]
exportBlockId: "result", // 默认值和blockId相同,导出的EiInfo中的指定数据块被导出
},
loadComplete: function(grid) {
//console.log(dayjs,"dayjs")
// 此 grid 对象
// 处理父子级联动,通过监听 change 事件,判断父级节点是否发生变化
grid.dataSource.bind("change", function(e) {
// 判断父级节点是否发生变化
if (e.field === "invQty") {
let item = e.items[0];
let invWeight = item.invQty * item.invUnitWeight;
resultGrid.setCellValue(item, 'invWeight', invWeight);
}
});
},
onAdd: function (e) {
let info = new EiInfo();
info.set("inqu_status-0-inventCode", $("#inqu_status-0-inventCode").val())
info.set("inqu_status-0-whCode", $("#inqu_status-0-whCode").val());
info.set("inqu_status-0-companyCode", $("#inqu_status-0-companyCode").val());
EiCommunicator.send("HGKC017A", "getOnt", info, {
onSuccess: function (ei) {
if (ei.getStatus() >= 0) {
$.each(e.items, function (index, item) {
let list = ei.getBlock("detail").getMappedRows();
if (list.length > 0){
item['inventType'] = list[0].inventType;
item['inventTypeDetail'] = list[0].inventTypeDetail;
item['inventCode'] = list[0].inventCode;
item['inventName'] = list[0].inventName;
item['spec'] = list[0].spec;
item['specId'] = list[0].specId;
item['length'] = list[0].length;
item['width'] = list[0].width;
item['thick'] = list[0].thick;
item['unit'] = $("#inqu_status-0-unit").val();
item['invQty'] = 0;
item['invUnitWeight'] = list[0].invUnitWeight;
item['invWeight'] = 0;
item['packQuantity'] = 1;
}
item['parentId'] = $("#inqu_status-0-parentId").val();
});
} else {
NotificationUtil(ei, "error");
}
},
onFail: function (ei) {
NotificationUtil("操作失败,原因[" + ei + "]", "error");
}
},{async: false});
},
onSave: function (e) {
// 阻止默认请求,使用自定义保存
e.preventDefault();
let btnNode = $(this);
//禁用按钮
btnNode.attr("disabled", true);
save(btnNode);
},
onDelete: function (e) {
// 阻止默认请求,使用自定义删除
//e.preventDefault();
//deleteFunc();
},
onSuccess: function (e) {
if (e.eiInfo.extAttr.methodName == 'save' || e.eiInfo.extAttr.methodName == 'delete') {
query();
}
},
onRowClick: function (e) {
}
}
}
downKeyUp();
});
/**
* 页面加载时执行
*/
$(window).load(function () {
// 查询
query();
});
let query = function () {
resultGrid.dataSource.page(1);
}
/**
* 保存
*/
let save = function (btnNode) {
let rows = resultGrid.getCheckedRows();
if (rows.length < 1) {
message("请选择数据");
return;
}
let flag = true;
$.each(rows, function(index, item) {
let invQty = item.get("invQty");
if(isBlank(invQty) || !isNumber(invQty) || invQty <= 0){
message("选中的第"+(index+1)+"行\"数量\",不能为空并且大于0!");
flag = false;
return false;
}
});
if(flag) {
JSUtils.confirm("确定对勾选中的[" + rows.length + "]条数据做\"保存\"操作? ", {
ok: function () {
JSUtils.submitGridsData("result", "HGKC017A", "save", true,
function (e) {
if (e.getStatus()!==-1){
btnNode.attr("disabled", false);
query();
}
});
}
});
}
}
\ No newline at end of file
<%--
Created by IntelliJ IDEA.
User: 1
Date: 2024/10/24
Time: 18:21
To change this template use File | Settings | File Templates.
--%>
<!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}"/>
<script>
var ctx = "${ctx}";
</script>
<EF:EFPage title="打包详情">
<EF:EFRegion id="result" title="记录集">
<EF:EFInput blockId="inqu_status" row="0" ename="parentId" cname="父级ID" type="hidden" colWidth="3"/>
<EF:EFInput blockId="inqu_status" row="0" ename="packCode" cname="打包单号" type="hidden" colWidth="3"/>
<EF:EFInput blockId="inqu_status" row="0" ename="inventCode" cname="产品编码" type="hidden" colWidth="3"/>
<EF:EFInput blockId="inqu_status" row="0" ename="whCode" cname="仓库编码" type="hidden" colWidth="3"/>
<EF:EFInput blockId="inqu_status" row="0" ename="companyCode" cname="公司名称" type="hidden" colWidth="3"/>
<EF:EFInput blockId="inqu_status" row="0" ename="unit" cname="打包方式" type="hidden" colWidth="3"/>
<EF:EFGrid blockId="result" autoDraw="override" isFloat="true">
<EF:EFColumn ename="id" cname="主键" hidden="true"/>
<EF:EFColumn ename="inventType" cname="存货类型" hidden="true"/>
<EF:EFColumn ename="inventTypeDetail" cname="存货类型大类" hidden="true"/>
<EF:EFColumn ename="inventCode" cname="产品编码" enable="false" width="120"/>
<EF:EFColumn ename="inventName" cname="产品名称" enable="false" width="120"/>
<EF:EFColumn ename="spec" cname="规格" enable="false" width="120"/>
<EF:EFColumn ename="specId" cname="规格ID" width="120" enable="true" readonly="true" align="center" hidden="true" />
<EF:EFColumn ename="length" cname="长度(MM)" enable="true" readonly="false" width="100" align="right" format="{0:N3}"/>
<EF:EFColumn ename="width" cname="宽度(MM)" enable="true" readonly="false" width="100" align="right" format="{0:N3}" />
<EF:EFColumn ename="thick" cname="厚度(MM)" enable="true" readonly="false" width="100" align="right" format="{0:N3}" />
<EF:EFColumn ename="unit" cname="打包单位" enable="true" readonly="false" width="100" align="right" format="{0:N3}" />
<EF:EFColumn ename="invQty" cname="数量" width="120" enable="true" format="{0:N0}" editType="text"
displayType="0.000" sort="true" align="right" readonly="true"
data-regex="/^-?[0-9]{1,15}?$/" maxLength="15" required="true"
data-errorprompt="请输入数字,该值最大可设置15位整数!"/>
<EF:EFColumn ename="invUnitWeight" cname="单重(KG)" width="120" enable="true" format="{0:N3}" editType="text" hidden="true"
displayType="0.000" sort="true" align="right" readonly="true"
data-regex="/^-?[0-9]{1,20}([.][0-9]{1,3})?$/" maxLength="20" required="true"
data-errorprompt="请输入数字,该值最大可设置15位整数和3位小数!"/>
<EF:EFColumn ename="invWeight" cname="打包重量(KG)" width="120" enable="false" format="{0:N3}" editType="text" hidden="true"
displayType="0.000" sort="true" align="right"
data-regex="/^-?[0-9]{1,15}([.][0-9]{1,3})?$/" maxLength="15" required="true"
data-errorprompt="请输入数字,该值最大可设置15位整数和3位小数!"/>
<EF:EFColumn ename="packQuantity" cname="打包数量" width="120" enable="true" format="{0:N0}" editType="text"
displayType="0" sort="true" align="right" readonly="true" hidden="true"
data-regex="/^-?[0-9]{1,15}?$/" maxLength="15" required="true"
data-errorprompt="请输入数字,该值最大可设置15位整数!"/>
</EF:EFGrid>
</EF:EFRegion>
</EF:EFPage>
......@@ -46,8 +46,8 @@
<EF:EFGrid blockId="result" autoDraw="override" isFloat="true" checkMode="row">
<EF:EFColumn ename="id" cname="主键" hidden="true"/>
<EF:EFColumn ename="lv" cname="层级" hidden="true"/>
<EF:EFColumn enable="false" ename="parentProdCode" hidden="true" cname="上级产品编号"/>
<EF:EFColumn enable="false" ename="parentProdName" hidden="true" cname="上级产品名称"/>
<EF:EFColumn enable="false" ename="parentProdCode" hidden="false" cname="上级产品编号"/>
<EF:EFColumn enable="false" ename="parentProdName" hidden="false" cname="上级产品名称"/>
<EF:EFColumn enable="false" ename="productId" hidden="true" cname="产品id"/>
<EF:EFColumn enable="false" ename="productType" hidden="true" cname="产品类型"/>
<EF:EFColumn enable="false" ename="inventType" hidden="true" cname="库存类型"/>
......
......@@ -51,82 +51,102 @@ $(function () {
columns2:[
{
label:'公司名称',
align:'left',
value:'companyName'
},
{
label:'委外加工日期',
align:'left',
value:'contractDate'
},
{
label:'委外加工单号',
align:'left',
value:'contractCode'
},
{
label:'供应商名称',
align:'left',
value:'supName'
},
{
label:'材料编码',
align:'left',
value:'lcinventCode'
},
{
label:'材料名称',
align:'left',
value:'lcinventName'
},
{
label:'材料规格',
align:'left',
value:'lcspec'
},
{
label:'计划出库数量',
align:'right',
value:'jhckQty'
},
{
label:'计划出库重量',
align:'right',
value:'jhckWeight'
},
{
label:'出库日期',
align:'left',
value:'outDate'
},
{
label:'实际出库数量',
align:'right',
value:'sjckoutQty'
},
{
label:'实际出库重量',
align:'right',
value:'sjckoutWeight'
},
{
label:'成品编码',
align:'left',
value:'productCode'
},
{
label:'成品名称',
align:'left',
value:'productName'
},
{
label:'成品规格',
align:'left',
value:'rkspec'
},
{
label:'计划入库数量',
align:'right',
value:'jhrkdepositQty'
},
{
label:'计划入库重量',
align:'right',
value:'jhrkdepositWeight'
},
{
label:'入库日期',
align:'left',
value:'depositDate'
},
{
label:'实际入库数量',
align:'right',
value:'actualQty'
},
{
label:'实际入库重量',
align:'right',
value:'depositWeight'
}
],
......@@ -234,15 +254,19 @@ $(function () {
let productCodeObj = {}
g.forEach(item3 =>{
productCodeObj[item3.productCode.value] = '';
let valStr = item3.productCode.value + item3.outDate.value
productCodeObj[valStr] = '';
})
let gList = Object.keys(productCodeObj)
let Hlist = gList.map(item4 => {
let d = g.filter(val7 => val7.productCode.value === item4);
return d.map((val6,i5) => {
let d = g.filter(val7 => {
let val2Str = val7.productCode.value + val7.outDate.value
return val2Str === item4
});
let arrFinal = d.map((val6,i5) => {
return {
...val6,
productCode:{
......@@ -269,12 +293,31 @@ $(function () {
...val6.jhrkdepositWeight,
rowspan: d.length,
show: !i5
},
outDate:{
...val6.outDate,
rowspan: d.length,
show: !i5
},
sjckoutQty:{
...val6.sjckoutQty,
value: i5 && val6.sjckoutQty.value? (Number(val6.sjckoutQty.value||0)+Number(d[i5-1].sjckoutQty.value)): Number(val6.sjckoutQty.value||0),
rowspan: d.length,
show: !i5
},
sjckoutWeight:{
...val6.sjckoutWeight,
value: i5 && val6.sjckoutWeight.value? (Number(val6.sjckoutWeight.value||0)+Number(d[i5-1].sjckoutWeight.value)): Number(val6.sjckoutWeight.value||0),
rowspan: d.length,
show: !i5
}
}
});
arrFinal[0].sjckoutQty.value = arrFinal[arrFinal.length-1].sjckoutQty.value;
arrFinal[0].sjckoutWeight.value = arrFinal[arrFinal.length-1].sjckoutWeight.value;
return arrFinal
})
let finalArr = []
Hlist.forEach(item6=>{
finalArr.push(...item6);
......@@ -287,7 +330,7 @@ $(function () {
a = fList;
}
return a.map((val3,i3) => {
return a.map((val3,i3) => {
return {
...val3,
companyName:{
......@@ -316,8 +359,8 @@ $(function () {
arr1.forEach(item=>{
that.list.push(...item);
})
}else {
that.list = [];
}
},
onFail: (err) => {
......
......@@ -97,7 +97,7 @@
</thead>
<tbody>
<tr v-for="(valObj,i) in list" :key="i">
<td v-for="(item,k) in columns2" :key="k" v-if="valObj[item.value].show" :rowspan="valObj[item.value].rowspan" :class="i/2%1?'bg-blue':''">
<td v-for="(item,k) in columns2" :key="k" v-if="valObj[item.value].show" :rowspan="valObj[item.value].rowspan" :class="i/2%1?'bg-blue':''" :style="{textAlign:item.align}">
<span>{{valObj[item.value].value}}</span>
</td>
</tr>
......
......@@ -68,7 +68,7 @@
<EF:EFSelect blockId="inqu_status" row="0" ename="companyCode" cname="公司名称" colWidth="3" filter="contains">
<EF:EFOptions blockId="roleCompany" textField="companyName" valueField="companyCode"/>
</EF:EFSelect>
<%-- <EF:EFDatePicker blockId="inqu_status" row="0" ename="contractDate" cname="委外加工日期" role="date" format="yyyy-MM-dd" parseFormats="['yyyyMMdd']" colWidth="3"/>--%>
<EF:EFDatePicker blockId="inqu_status" row="0" ename="depositDate" cname="入库日期" role="date" format="yyyy-MM-dd" parseFormats="['yyyyMMdd']" colWidth="3"/>
<EF:EFInput blockId="inqu_status" row="0" ename="projName" cname="项目名称" placeholder="模糊查询" colWidth="3"/>
<EF:EFInput blockId="inqu_status" row="0" ename="productName" cname="产品名称" placeholder="模糊查询" colWidth="3"/>
......@@ -100,7 +100,7 @@
</thead>
<tbody>
<tr v-for="(valObj,i) in list" :key="i">
<td v-for="(item,k) in columns2" :key="k" v-if="valObj[item.value].show && k>0" :rowspan="valObj[item.value].rowspan" :class="i/2%1?'bg-blue':''">
<td v-for="(item,k) in columns2" :key="k" v-if="valObj[item.value].show && k>0" :rowspan="valObj[item.value].rowspan" :class="i/2%1?'bg-blue':''" :style="{textAlign:item.align}">
<span>{{valObj[item.value].value}}</span>
</td>
</tr>
......
......@@ -785,8 +785,13 @@ function uploadFileCallback(data) {
EiCommunicator.send(serviceName, methodName, inEiInfo, {
onSuccess(response) {
JSColorbox.close();
resultGrid.dataSource.page(1);
if (response.getStatus() == 1){
NotificationUtil(ei, "error");
}else {
JSColorbox.close();
resultGrid.dataSource.page(1);
}
},
onFail(errorMessage, status, e) {
NotificationUtil("执行失败!", "error");
......
......@@ -34,6 +34,8 @@ $(function () {
$(window).load(function () {
// 查询
query();
showAuthButton();
});
/**
......@@ -164,3 +166,42 @@ let checkSelectMain = function () {
}
return true;
}
/**
* 显示授权按钮
*/
let showAuthButton = function () {
let label = IPLAT.EFInput.value($("#inqu_status-0-fileId"))
// C:目录
$("#SAVE").hide();
$("#AUTH").hide();
$("#REMOVE_USER").hide();
$("#COPY_USER").hide();
// 管理员或者是项目经理,才能进行授权和操作用户
let inInfo = new EiInfo();
inInfo.set("inqu_status-0-fileId", label);
EiCommunicator.send('HGWD003', 'isProjectManager', inInfo, {
onSuccess: function (res) {
let status = res.getStatus();
if (status >= 0 && res.extAttr.isManager == 1) {
$("#AUTH").show();
$("#REMOVE_USER").show();
$("#COPY_USER").show();
$("#SAVE").show();
} else if (status >= 0 && res.extAttr.isProjectManager == 1) {
$("#AUTH").show();
$("#REMOVE_USER").show();
$("#COPY_USER").show();
$("#SAVE").hide();
} else {
$("#SAVE").hide();
$("#AUTH").hide();
$("#REMOVE_USER").hide();
$("#COPY_USER").hide();
}
},
onFail: function (res) {
NotificationUtil("操作失败,原因[" + res.getMsg() + "]", "error");
}
});
}
......@@ -46,6 +46,7 @@
filter="contains" readonly="true" required="true">
<EF:EFOptions blockId="roleCompany" textField="companyName" valueField="companyCode"/>
</EF:EFComboColumn>
<EF:EFColumn ename="companyName" cname="公司名称" hidden="true"/>
<EF:EFComboColumn ename="projCode" enable="true" cname="项目名称" width="200" align="center"
filter="contains" readonly="true" required="true">
<EF:EFOptions blockId="proj_record_block_id" valueField="valueField" textField="textField"/>
......@@ -70,6 +71,7 @@
blockName="wh_record_box_block_id" textField="textField" valueField="valueField"
columnTemplate="#=textField#" itemTemplate="#=textField#">
</EF:EFComboColumn>
<EF:EFColumn ename="consWhName" cname="发货仓库" hidden="true"/>
<EF:EFColumn ename="consAddr" cname="发货地址" hidden="true" width="120" align="center"/>
<EF:EFColumn ename="consQuantity" cname="发货数量" enable="true" readonly="true" width="120" align="center" format="{0:N3}" data-rules="number"/>
<EF:EFColumn ename="consWeight" cname="发货重量" width="120" align="center" format="{0:N3}" data-rules="number"/>
......
......@@ -168,6 +168,11 @@ $(function() {
$("#BNT_CHOICE").on("click", detail);
/**
* 选择打包单
*/
$("#BNT_UNPACK").on("click", unpack);
/**
* 保存
*/
$("#btn_save").on("click",function(){
......@@ -373,7 +378,11 @@ function detail() {
}
JSColorbox.open({
href: "HGYX001C?methodName=initLoad&inqu_status-0-companyCode="+consCode+"&inqu_status-0-projCode="+projCode+"&inqu_status-0-whCode="+consWhCode+"&inqu_status-0-specIds="+ids.join(','),
href: "HGYX001C?methodName=initLoad" +
"&inqu_status-0-companyCode="+consCode+"" +
"&inqu_status-0-projCode="+projCode+"" +
"&inqu_status-0-whCode="+consWhCode+"" +
"&inqu_status-0-specIds="+ids.join(','),
title: "<div style='text-align: center;'>选择发货明细</div>",
width: "95%",
height: "95%",
......@@ -397,6 +406,8 @@ function detailCallback(result) {
result[i].unitWeight = result[i].consUnitWeight;
result[i].weight = result[i].consWeight;
result[i].inventRecordId = result[i].specId
result[i].sourceId = result[i].id
result[i].source = "1";
resultGrid.addRows(result[i]);
}
}
......@@ -414,6 +425,78 @@ function detailCallback(result) {
$("#inqu_status-0-consWeight").val(consWeight)
}
let unpack = function () {
let ids = [];
let rows = resultGrid.getDataItems();
if (rows.length > 0){
$.each(rows, function(index, item) {
ids.push(item.inventRecordId)
});
}
let projCode = $("#inqu_status-0-projCode").val();
if(isBlank(projCode)){
message("请选择项目!");
return false;
}
let consCode = $("#inqu_status-0-consCode").val();
if(isBlank(consCode)){
message("请选择发货方!");
return false;
}
let consWhCode = $("#inqu_status-0-consWhCode").val();
if(isBlank(consWhCode)){
message("请选择发货仓库!");
return false;
}
JSColorbox.open({
href: "HGYX001D?methodName=initLoad" +
"&inqu_status-0-companyCode="+consCode+"" +
"&inqu_status-0-projCode="+projCode+"" +
"&inqu_status-0-whCode="+consWhCode+"" +
"&inqu_status-0-specIds="+ids.join(','),
title: "<div style='text-align: center;'>选择打包单明细</div>",
width: "95%",
height: "95%",
callbackName: unpackCallback
});
}
function unpackCallback(result) {
let consQuantity = 0;
let consWeight = 0;
let rows = resultGrid.getDataItems();
if (result.length> 0) {
for (let i = 0; i < result.length; i++) {
let filters = rows.filter(row => row.inventCode == result[i].inventCode
&& row.spec == result[i].spec);
if (filters.length > 0){
message("无法重复添加!");
return false;
}
result[i].quantity = result[i].consQuantity;
result[i].unitWeight = result[i].consUnitWeight;
result[i].weight = result[i].consWeight;
result[i].inventRecordId = result[i].specId
result[i].sourceId = result[i].id
result[i].source = "2";
resultGrid.addRows(result[i]);
}
}
rows = resultGrid.getDataItems();
for (let i = 0; i < rows.length; i++) {
consQuantity += parseInt(rows[i].quantity);
consWeight += parseFloat(rows[i].weight);
}
//获取显示框的值
$("#inqu_status-0-consQuantity_textField").val(consQuantity)
$("#inqu_status-0-consQuantity").val(consQuantity)
$("#inqu_status-0-consWeight_textField").val(consWeight)
$("#inqu_status-0-consWeight").val(consWeight)
}
/**
* 表格变更事件
*/
......
......@@ -98,6 +98,11 @@
displayType="0.000" sort="true" align="right"
data-regex="/^-?[0-9]{1,15}([.][0-9]{1,3})?$/" maxLength="15" required="true"
data-errorprompt="请输入数字,该值最大可设置15位整数和3位小数!"/>
<EF:EFComboColumn ename="source" cname="数据来源" width="120" align="center" filter="contains">
<EF:EFOption label="综合库存" value="1"/>
<EF:EFOption label="打包单" value="2"/>
</EF:EFComboColumn>
<EF:EFColumn ename="sourceId" cname="数据来源ID" hidden="true"/>
</EF:EFGrid>
</EF:EFRegion>
<div class="row" style="display:flex;justify-content:center;">
......
......@@ -111,6 +111,11 @@
displayType="0.000" sort="true" align="right"
data-regex="/^-?[0-9]{1,15}([.][0-9]{1,3})?$/" maxLength="15" required="true"
data-errorprompt="请输入数字,该值最大可设置15位整数和3位小数!"/>
<EF:EFComboColumn ename="source" cname="数据来源" width="120" align="center" filter="contains">
<EF:EFOption label="综合库存" value="1"/>
<EF:EFOption label="打包单" value="2"/>
</EF:EFComboColumn>
<EF:EFColumn ename="sourceId" cname="数据来源ID" hidden="true"/>
</EF:EFGrid>
</EF:EFRegion>
</EF:EFPage>
$(function () {
// 查询
$("#QUERY").on("click", query);
$("#BNT_CHOICE").on("click", choice)
})
/**
* 页面加载时执行
*/
$(window).load(function () {
// 查询
query();
});
/**
* 查询
*/
let query = function () {
resultGrid.dataSource.page(1);
}
let choice = function () {
let rows = resultGrid.getCheckedRows();
if (rows.length < 1) {
message("请选择数据");
return;
}
parent.JSColorbox.setValueCallback(rows);
parent.JSColorbox.close();
}
\ No newline at end of file
<%--
Created by IntelliJ IDEA.
User: 1
Date: 2024/10/26
Time: 11:14
To change this template use File | Settings | File Templates.
--%>
<!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}"/>
<script>
var ctx = "${ctx}";
</script>
<EF:EFPage title="发货明细">
<EF:EFRegion id="inqu" title="查询条件">
<div class="row">
<EF:EFInput blockId="inqu_status" row="0" ename="inventName" cname="物料名称" placeholder="模糊查询" colWidth="3"/>
<EF:EFInput blockId="inqu_status" row="0" ename="spec" cname="规格" placeholder="模糊查询" colWidth="3"/>
<EF:EFInput blockId="inqu_status" row="0" ename="companyCode" cname="公司名称" type="hidden" required="true" colWidth="3"/>
<EF:EFInput blockId="inqu_status" row="0" ename="whCode" cname="仓库名称" type="hidden" required="true" colWidth="3"/>
<EF:EFInput blockId="inqu_status" row="0" ename="whCode" cname="仓库名称" type="hidden" required="true" colWidth="3"/>
</div>
</EF:EFRegion>
<EF:EFRegion id="result" title="记录集">
<EF:EFGrid blockId="result" autoDraw="override" isFloat="true">
<EF:EFColumn ename="id" cname="主键" hidden="true"/>
<EF:EFComboColumn ename="inventType" cname="存货类型" enable="true" width="120" align="center" required="true"
blockName="invent_type_block_id" textField="textField" valueField="valueField"
columnTemplate="#=textField#" itemTemplate="#=textField#" readonly="true"
filter="contains">
</EF:EFComboColumn>
<EF:EFColumn ename="inventTypeDetail" cname="存货类型大类" hidden="true"/>
<EF:EFColumn ename="inventCode" cname="存货编码" enable="false" width="120"/>
<EF:EFColumn ename="inventName" cname="存货名称" enable="false" width="120"/>
<EF:EFComboColumn ename="spec" cname="规格" enable="true" width="120" align="center" required="true"
blockName="spec_name_block_id" textField="textField" valueField="valueField"
columnTemplate="#=textField#" itemTemplate="#=textField#" readonly="true"
filter="contains">
</EF:EFComboColumn>
<EF:EFColumn ename="specId" cname="规格ID" width="120" enable="true" readonly="true" align="center" hidden="true" maxLength="50"/>
<EF:EFColumn ename="length" cname="长度(MM)" enable="true" readonly="true" width="100" align="right" format="{0:N3}" maxLength="10"/>
<EF:EFColumn ename="width" cname="宽度(MM)" enable="true" readonly="true" width="100" align="right" format="{0:N3}" maxLength="10"/>
<EF:EFColumn ename="thick" cname="厚度(MM)" enable="true" readonly="true" width="100" align="right" format="{0:N3}" maxLength="10"/>
<EF:EFColumn ename="consQuantity" cname="数量" width="120" enable="true" format="{0:N3}" editType="text"
displayType="0.000" sort="true" align="right" readonly="true"
data-regex="/^-?[0-9]{1,20}([.][0-9]{1,3})?$/" maxLength="20" required="true"
data-errorprompt="请输入数字,该值最大可设置15位整数和3位小数!"/>
<EF:EFColumn ename="consUnitWeight" cname="单重(KG)" width="120" enable="true" format="{0:N3}" editType="text"
displayType="0.000" sort="true" align="right" readonly="true"
data-regex="/^-?[0-9]{1,20}([.][0-9]{1,3})?$/" maxLength="20" required="true"
data-errorprompt="请输入数字,该值最大可设置15位整数和3位小数!"/>
<EF:EFColumn ename="consWeight" cname="重量(KG)" width="120" enable="false" format="{0:N3}" editType="text"
displayType="0.000" sort="true" align="right"
data-regex="/^-?[0-9]{1,15}([.][0-9]{1,3})?$/" maxLength="15" required="true"
data-errorprompt="请输入数字,该值最大可设置15位整数和3位小数!"/>
</EF:EFGrid>
</EF:EFRegion>
</EF:EFPage>
......@@ -56,7 +56,6 @@
<EF:EFComboColumn ename="status" cname="审核状态" width="80" align="center" enable="false" defaultValue="0" required="true">
<EF:EFCodeOption codeName="hggp.hgyx.status" condition="ITEM_CODE IN ('0','1')"/>
</EF:EFComboColumn>
<EF:EFColumn ename="companyCode" cname="公司编码" hidden="true"/>
<EF:EFColumn ename="companyName" cname="公司名称" hidden="true"/>
<EF:EFColumn ename="consWhCode" cname="仓库编码" hidden="true"/>
<EF:EFColumn ename="consWhName" cname="仓库名称" hidden="true"/>
......
......@@ -106,6 +106,12 @@ $(function() {
}
});
},
beforeEdit: function (e) {
let item = e.model;
if(item.source == '2'){
e.preventDefault();
}
},
onSuccess: function (e) {
if(e.eiInfo.extAttr.methodName == 'save'
||e.eiInfo.extAttr.methodName == 'delete' ){
......@@ -430,6 +436,8 @@ function detail() {
}
function detailCallback(result) {
let consQuantity = 0;
let consWeight = 0;
let rows = resultGrid.getDataItems();
if (result.length> 0) {
for (let i = 0; i < result.length; i++) {
......@@ -439,10 +447,29 @@ function detailCallback(result) {
message("无法重复添加!");
return false;
}
result[i].set("returnQuantity", 0);
result[i].set("returnWeight", 0);
if (result[i].source == 2){
result[i].set("returnQuantity", convertToNegative(result[i].quantity));
result[i].set("returnWeight", convertToNegative(result[i].weight));
}else {
result[i].set("returnQuantity", 0);
result[i].set("returnWeight", 0);
}
resultGrid.addRows(result[i]);
}
rows = resultGrid.getDataItems();
for (let i = 0; i < rows.length; i++) {
consQuantity += parseInt(rows[i].returnQuantity);
consWeight += parseFloat(rows[i].returnWeight);
}
//获取显示框的值
$("#inqu_status-0-returnQuantity_textField").val(convertToNegative(consQuantity))
$("#inqu_status-0-returnQuantity").val(convertToNegative(consQuantity))
$("#inqu_status-0-returnWeight_textField").val(convertToNegative(consWeight))
$("#inqu_status-0-returnWeight").val(convertToNegative(consWeight))
}
}
......
......@@ -106,6 +106,11 @@
data-regex="/^-?[0-9]{1,15}$/" maxLength="20" required="true"
data-errorprompt="请输入数字,该值最大可设置15位整数和3位小数!"/>
<EF:EFColumn ename="returnWeight" cname="退货重量(KG)" width="120" defaultValue="0" enable="false" readonly="true" format="{0:N3}" editType="number" required="true"/>
<EF:EFComboColumn ename="source" cname="数据来源" width="120" align="center" filter="contains">
<EF:EFOption label="综合库存" value="1"/>
<EF:EFOption label="打包单" value="2"/>
</EF:EFComboColumn>
<EF:EFColumn ename="sourceId" cname="数据来源ID" hidden="true"/>
</EF:EFGrid>
</EF:EFRegion>
<div class="row" style="display:flex;justify-content:center;">
......
......@@ -99,6 +99,11 @@
displayType="0.000" sort="true" align="right"
data-regex="/^-?[0-9]{1,15}([.][0-9]{1,3})?$/" maxLength="15" required="true"
data-errorprompt="请输入数字,该值最大可设置15位整数和3位小数!"/>
<EF:EFComboColumn ename="source" cname="数据来源" width="120" align="center" filter="contains">
<EF:EFOption label="综合库存" value="1"/>
<EF:EFOption label="打包单" value="2"/>
</EF:EFComboColumn>
<EF:EFColumn ename="sourceId" cname="数据来源ID" hidden="true"/>
</EF:EFGrid>
</EF:EFRegion>
</EF:EFPage>
......@@ -65,6 +65,11 @@
data-regex="/^-?[0-9]{1,15}$/" maxLength="20" required="true"
data-errorprompt="请输入数字,该值最大可设置15位整数和3位小数!"/>
<EF:EFColumn ename="returnWeight" cname="退货重量(KG)" width="120" enable="true" hidden="true" format="{0:N3}" editType="number" required="true"/>
<EF:EFComboColumn ename="source" cname="数据来源" width="120" align="center" filter="contains">
<EF:EFOption label="综合库存" value="1"/>
<EF:EFOption label="打包单" value="2"/>
</EF:EFComboColumn>
<EF:EFColumn ename="sourceId" cname="数据来源ID" hidden="true"/>
</EF:EFGrid>
</EF:EFRegion>
</EF:EFPage>
......@@ -200,6 +200,42 @@ function refreshSelect(container, inInfo) {
}
/**
* 刷新下拉框
*
* @param container
* @param inInfo
*/
function refreshSelect1(container, inInfo) {
let grid = container.closest(".k-grid").data("kendoGrid");
let cellIndex = grid.cellIndex(container);
let input = $('<input />');
let field = inInfo.get("field");
input.attr("name", field);
input.attr("id", field);
input.appendTo(container);
let dataSource;
let serviceName = inInfo.get("serviceName");
let methodName = inInfo.get("methodName");
let blockId = inInfo.get("blockId");
EiCommunicator.send(serviceName, methodName, inInfo, {
onSuccess: function (ei) {
dataSource = ei.getBlock(blockId).getMappedRows();
},
onFail: function (ei) {
}
}, {async: false});
input.kendoDropDownList({
valuePrimitive: true,
dataTextField: "textField",
dataValueField: "valueField",
dataSource: dataSource,
template: "#:valueField#-#:textField#",
filter: "contains"
});
return dataSource;
}
/**
* 刷新下拉框,可手动输入
*
* @param container
......
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