Commit 1a8f1078 by 宋祥

1.生产销售页面下拉联动调整

parent dd8026da
......@@ -22,6 +22,8 @@ public class HPConstant {
public static final String HPZL001_NUMBER = "HPZL001_NUMBER";
// 生产入库单号
public static final String HPKC003_PROD_NO = "HPKC003_PROD_NO";
// 生产销售单号
public static final String HPKC004_SALE_NO = "HPKC004_SALE_NO";
}
/**
......
......@@ -16,74 +16,80 @@ import com.baosight.iplat4j.core.util.StringUtils;
* Copyrigth:Baosight Software LTD.co Copyright (c) 2019. <br>
*
* @version 1.0
* @history 2024-01-11 15:32:36 create
* @history 2024-01-22 11:25:39 create
*/
public class HPKC004 extends DaoEPBase {
private static final long serialVersionUID = 1L;
public static final String FIELD_ID = "id";
public static final String FIELD_ID = "id";
public static final String FIELD_COMPANY_CODE = "companyCode"; /* 企业编码 预留*/
public static final String FIELD_DEP_CODE = "depCode"; /* 部门编码*/
public static final String FIELD_RECEIPT_DATE = "receiptDate"; /* 单据日期*/
public static final String FIELD_SALE_NUMBER = "saleNumber"; /* 销售出库单号*/
public static final String FIELD_SALE_NO = "saleNo"; /* 销售出库单号*/
public static final String FIELD_WH_CODE = "whCode"; /* 仓库编码*/
public static final String FIELD_WH_NAME = "whName"; /* 仓库名称*/
public static final String FIELD_MAT_TYPE = "matType"; /* 物料类型*/
public static final String FIELD_MAT_CODE = "matCode"; /* 物料编码*/
public static final String FIELD_MAT_NAME = "matName"; /* 物料名称*/
public static final String FIELD_INVENT_TYPE = "inventType"; /* 存货类型*/
public static final String FIELD_INVENT_CODE = "inventCode"; /* 存货编码*/
public static final String FIELD_INVENT_NAME = "inventName"; /* 存货名称*/
public static final String FIELD_AMOUNT = "amount"; /* 数量*/
public static final String FIELD_WEIGHT = "weight"; /* 重量*/
public static final String FIELD_STATUS = "status"; /* 单据状态 0待审核 1已审核*/
public static final String FIELD_NOTES = "notes"; /* 备注*/
public static final String FIELD_REMARK = "remark"; /* 备注*/
public static final String FIELD_CREATED_BY = "createdBy"; /* 创建人*/
public static final String FIELD_CREATED_NAME = "createdName"; /* 创建名称*/
public static final String FIELD_CREATED_TIME = "createdTime"; /* 创建时间*/
public static final String FIELD_UPDATED_BY = "updatedBy"; /* 更新人*/
public static final String FIELD_UPDATED_NAME = "updatedName"; /* 更新人名称*/
public static final String FIELD_UPDATED_TIME = "updatedTime"; /* 更新时间*/
public static final String FIELD_DEP_CODE = "depCode"; /* 部门编码*/
public static final String COL_ID = "ID";
public static final String COL_ID = "ID";
public static final String COL_COMPANY_CODE = "COMPANY_CODE"; /* 企业编码 预留*/
public static final String COL_DEP_CODE = "DEP_CODE"; /* 部门编码*/
public static final String COL_RECEIPT_DATE = "RECEIPT_DATE"; /* 单据日期*/
public static final String COL_SALE_NUMBER = "SALE_NUMBER"; /* 销售出库单号*/
public static final String COL_SALE_NO = "SALE_NO"; /* 销售出库单号*/
public static final String COL_WH_CODE = "WH_CODE"; /* 仓库编码*/
public static final String COL_WH_NAME = "WH_NAME"; /* 仓库名称*/
public static final String COL_MAT_TYPE = "MAT_TYPE"; /* 物料类型*/
public static final String COL_MAT_CODE = "MAT_CODE"; /* 物料编码*/
public static final String COL_MAT_NAME = "MAT_NAME"; /* 物料名称*/
public static final String COL_INVENT_TYPE = "INVENT_TYPE"; /* 存货类型*/
public static final String COL_INVENT_CODE = "INVENT_CODE"; /* 存货编码*/
public static final String COL_INVENT_NAME = "INVENT_NAME"; /* 存货名称*/
public static final String COL_AMOUNT = "AMOUNT"; /* 数量*/
public static final String COL_WEIGHT = "WEIGHT"; /* 重量*/
public static final String COL_STATUS = "STATUS"; /* 单据状态 0待审核 1已审核*/
public static final String COL_NOTES = "NOTES"; /* 备注*/
public static final String COL_REMARK = "REMARK"; /* 备注*/
public static final String COL_CREATED_BY = "CREATED_BY"; /* 创建人*/
public static final String COL_CREATED_NAME = "CREATED_NAME"; /* 创建名称*/
public static final String COL_CREATED_TIME = "CREATED_TIME"; /* 创建时间*/
public static final String COL_UPDATED_BY = "UPDATED_BY"; /* 更新人*/
public static final String COL_UPDATED_NAME = "UPDATED_NAME"; /* 更新人名称*/
public static final String COL_UPDATED_TIME = "UPDATED_TIME"; /* 更新时间*/
public static final String COL_DEP_CODE = "DEP_CODE"; /* 部门编码*/
public static final String QUERY = "t_hpkc004.query";
public static final String COUNT = "t_hpkc004.count";
public static final String INSERT = "t_hpkc004.insert";
public static final String UPDATE = "t_hpkc004.update";
public static final String DELETE = "t_hpkc004.delete";
public static final String QUERY = "HPKC004.query";
public static final String COUNT = "HPKC004.count";
public static final String INSERT = "HPKC004.insert";
public static final String UPDATE = "HPKC004.update";
public static final String DELETE = "HPKC004.delete";
private Long id = new Long(0);
private Long id = null;
private String companyCode = " "; /* 企业编码 预留*/
private String depCode = " "; /* 部门编码*/
private String receiptDate = " "; /* 单据日期*/
private String saleNumber = " "; /* 销售出库单号*/
private String saleNo = " "; /* 销售出库单号*/
private String whCode = " "; /* 仓库编码*/
private String whName = " "; /* 仓库名称*/
private String matType = " "; /* 物料类型*/
private String matCode = "0"; /* 物料编码*/
private String matName = "0"; /* 物料名称*/
private Integer inventType; /* 存货类型*/
private String inventCode = " "; /* 存货编码*/
private String inventName = " "; /* 存货名称*/
private BigDecimal amount = new BigDecimal(0.00); /* 数量*/
private BigDecimal weight = new BigDecimal(0.00); /* 重量*/
private int status; /* 单据状态 0待审核 1已审核*/
private String notes = " "; /* 备注*/
private Integer status; /* 单据状态 0待审核 1已审核*/
private String remark = " "; /* 备注*/
private String createdBy = " "; /* 创建人*/
private String createdName = " "; /* 创建名称*/
private String createdTime = " "; /* 创建时间*/
private String updatedBy = " "; /* 更新人*/
private String updatedName = " "; /* 更新人名称*/
private String updatedTime = " "; /* 更新时间*/
private String depCode = " "; /* 部门编码*/
/**
* initialize the metadata.
......@@ -100,11 +106,15 @@ public class HPKC004 extends DaoEPBase {
eiColumn.setDescName("企业编码 预留");
eiMetadata.addMeta(eiColumn);
eiColumn = new EiColumn(FIELD_DEP_CODE);
eiColumn.setDescName("部门编码");
eiMetadata.addMeta(eiColumn);
eiColumn = new EiColumn(FIELD_RECEIPT_DATE);
eiColumn.setDescName("单据日期");
eiMetadata.addMeta(eiColumn);
eiColumn = new EiColumn(FIELD_SALE_NUMBER);
eiColumn = new EiColumn(FIELD_SALE_NO);
eiColumn.setDescName("销售出库单号");
eiMetadata.addMeta(eiColumn);
......@@ -116,16 +126,16 @@ public class HPKC004 extends DaoEPBase {
eiColumn.setDescName("仓库名称");
eiMetadata.addMeta(eiColumn);
eiColumn = new EiColumn(FIELD_MAT_TYPE);
eiColumn.setDescName("物料类型");
eiColumn = new EiColumn(FIELD_INVENT_TYPE);
eiColumn.setDescName("存货类型");
eiMetadata.addMeta(eiColumn);
eiColumn = new EiColumn(FIELD_MAT_CODE);
eiColumn.setDescName("物料编码");
eiColumn = new EiColumn(FIELD_INVENT_CODE);
eiColumn.setDescName("存货编码");
eiMetadata.addMeta(eiColumn);
eiColumn = new EiColumn(FIELD_MAT_NAME);
eiColumn.setDescName("物料名称");
eiColumn = new EiColumn(FIELD_INVENT_NAME);
eiColumn.setDescName("存货名称");
eiMetadata.addMeta(eiColumn);
eiColumn = new EiColumn(FIELD_AMOUNT);
......@@ -146,7 +156,7 @@ public class HPKC004 extends DaoEPBase {
eiColumn.setDescName("单据状态 0待审核 1已审核");
eiMetadata.addMeta(eiColumn);
eiColumn = new EiColumn(FIELD_NOTES);
eiColumn = new EiColumn(FIELD_REMARK);
eiColumn.setDescName("备注");
eiMetadata.addMeta(eiColumn);
......@@ -154,6 +164,10 @@ public class HPKC004 extends DaoEPBase {
eiColumn.setDescName("创建人");
eiMetadata.addMeta(eiColumn);
eiColumn = new EiColumn(FIELD_CREATED_NAME);
eiColumn.setDescName("创建名称");
eiMetadata.addMeta(eiColumn);
eiColumn = new EiColumn(FIELD_CREATED_TIME);
eiColumn.setDescName("创建时间");
eiMetadata.addMeta(eiColumn);
......@@ -162,12 +176,12 @@ public class HPKC004 extends DaoEPBase {
eiColumn.setDescName("更新人");
eiMetadata.addMeta(eiColumn);
eiColumn = new EiColumn(FIELD_UPDATED_TIME);
eiColumn.setDescName("更新时间");
eiColumn = new EiColumn(FIELD_UPDATED_NAME);
eiColumn.setDescName("更新人名称");
eiMetadata.addMeta(eiColumn);
eiColumn = new EiColumn(FIELD_DEP_CODE);
eiColumn.setDescName("部门编码");
eiColumn = new EiColumn(FIELD_UPDATED_TIME);
eiColumn.setDescName("更新时间");
eiMetadata.addMeta(eiColumn);
......@@ -191,7 +205,7 @@ public class HPKC004 extends DaoEPBase {
/**
* set the id .
*
* @param id
* @param id
*/
public void setId(Long id) {
this.id = id;
......@@ -213,6 +227,22 @@ public class HPKC004 extends DaoEPBase {
this.companyCode = companyCode;
}
/**
* get the depCode - 部门编码.
* @return the depCode
*/
public String getDepCode() {
return this.depCode;
}
/**
* set the depCode - 部门编码.
*
* @param depCode - 部门编码
*/
public void setDepCode(String depCode) {
this.depCode = depCode;
}
/**
* get the receiptDate - 单据日期.
* @return the receiptDate
*/
......@@ -229,20 +259,20 @@ public class HPKC004 extends DaoEPBase {
this.receiptDate = receiptDate;
}
/**
* get the saleNumber - 销售出库单号.
* @return the saleNumber
* get the saleNo - 销售出库单号.
* @return the saleNo
*/
public String getSaleNumber() {
return this.saleNumber;
public String getSaleNo() {
return this.saleNo;
}
/**
* set the saleNumber - 销售出库单号.
* set the saleNo - 销售出库单号.
*
* @param saleNumber - 销售出库单号
* @param saleNo - 销售出库单号
*/
public void setSaleNumber(String saleNumber) {
this.saleNumber = saleNumber;
public void setSaleNo(String saleNo) {
this.saleNo = saleNo;
}
/**
* get the whCode - 仓库编码.
......@@ -277,52 +307,52 @@ public class HPKC004 extends DaoEPBase {
this.whName = whName;
}
/**
* get the matType - 物料类型.
* @return the matType
* get the inventType - 存货类型.
* @return the inventType
*/
public String getMatType() {
return this.matType;
public Integer getInventType() {
return this.inventType;
}
/**
* set the matType - 物料类型.
* set the inventType - 存货类型.
*
* @param matType - 物料类型
* @param inventType - 存货类型
*/
public void setMatType(String matType) {
this.matType = matType;
public void setInventType(Integer inventType) {
this.inventType = inventType;
}
/**
* get the matCode - 物料编码.
* @return the matCode
* get the inventCode - 存货编码.
* @return the inventCode
*/
public String getMatCode() {
return this.matCode;
public String getInventCode() {
return this.inventCode;
}
/**
* set the matCode - 物料编码.
* set the inventCode - 存货编码.
*
* @param matCode - 物料编码
* @param inventCode - 存货编码
*/
public void setMatCode(String matCode) {
this.matCode = matCode;
public void setInventCode(String inventCode) {
this.inventCode = inventCode;
}
/**
* get the matName - 物料名称.
* @return the matName
* get the inventName - 存货名称.
* @return the inventName
*/
public String getMatName() {
return this.matName;
public String getInventName() {
return this.inventName;
}
/**
* set the matName - 物料名称.
* set the inventName - 存货名称.
*
* @param matName - 物料名称
* @param inventName - 存货名称
*/
public void setMatName(String matName) {
this.matName = matName;
public void setInventName(String inventName) {
this.inventName = inventName;
}
/**
* get the amount - 数量.
......@@ -360,7 +390,7 @@ public class HPKC004 extends DaoEPBase {
* get the status - 单据状态 0待审核 1已审核.
* @return the status
*/
public int getStatus() {
public Integer getStatus() {
return this.status;
}
......@@ -369,24 +399,24 @@ public class HPKC004 extends DaoEPBase {
*
* @param status - 单据状态 0待审核 1已审核
*/
public void setStatus(int status) {
public void setStatus(Integer status) {
this.status = status;
}
/**
* get the notes - 备注.
* @return the notes
* get the remark - 备注.
* @return the remark
*/
public String getNotes() {
return this.notes;
public String getRemark() {
return this.remark;
}
/**
* set the notes - 备注.
* set the remark - 备注.
*
* @param notes - 备注
* @param remark - 备注
*/
public void setNotes(String notes) {
this.notes = notes;
public void setRemark(String remark) {
this.remark = remark;
}
/**
* get the createdBy - 创建人.
......@@ -405,6 +435,22 @@ public class HPKC004 extends DaoEPBase {
this.createdBy = createdBy;
}
/**
* get the createdName - 创建名称.
* @return the createdName
*/
public String getCreatedName() {
return this.createdName;
}
/**
* set the createdName - 创建名称.
*
* @param createdName - 创建名称
*/
public void setCreatedName(String createdName) {
this.createdName = createdName;
}
/**
* get the createdTime - 创建时间.
* @return the createdTime
*/
......@@ -437,36 +483,36 @@ public class HPKC004 extends DaoEPBase {
this.updatedBy = updatedBy;
}
/**
* get the updatedTime - 更新时间.
* @return the updatedTime
* get the updatedName - 更新人名称.
* @return the updatedName
*/
public String getUpdatedTime() {
return this.updatedTime;
public String getUpdatedName() {
return this.updatedName;
}
/**
* set the updatedTime - 更新时间.
* set the updatedName - 更新人名称.
*
* @param updatedTime - 更新时间
* @param updatedName - 更新人名称
*/
public void setUpdatedTime(String updatedTime) {
this.updatedTime = updatedTime;
public void setUpdatedName(String updatedName) {
this.updatedName = updatedName;
}
/**
* get the depCode - 部门编码.
* @return the depCode
* get the updatedTime - 更新时间.
* @return the updatedTime
*/
public String getDepCode() {
return this.depCode;
public String getUpdatedTime() {
return this.updatedTime;
}
/**
* set the depCode - 部门编码.
* set the updatedTime - 更新时间.
*
* @param depCode - 部门编码
* @param updatedTime - 更新时间
*/
public void setDepCode(String depCode) {
this.depCode = depCode;
public void setUpdatedTime(String updatedTime) {
this.updatedTime = updatedTime;
}
/**
* get the value from Map.
......@@ -478,22 +524,24 @@ public class HPKC004 extends DaoEPBase {
setId(NumberUtils.toLong(StringUtils.toString(map.get(FIELD_ID)), id));
setCompanyCode(StringUtils.defaultIfEmpty(StringUtils.toString(map.get(FIELD_COMPANY_CODE)), companyCode));
setDepCode(StringUtils.defaultIfEmpty(StringUtils.toString(map.get(FIELD_DEP_CODE)), depCode));
setReceiptDate(StringUtils.defaultIfEmpty(StringUtils.toString(map.get(FIELD_RECEIPT_DATE)), receiptDate));
setSaleNumber(StringUtils.defaultIfEmpty(StringUtils.toString(map.get(FIELD_SALE_NUMBER)), saleNumber));
setSaleNo(StringUtils.defaultIfEmpty(StringUtils.toString(map.get(FIELD_SALE_NO)), saleNo));
setWhCode(StringUtils.defaultIfEmpty(StringUtils.toString(map.get(FIELD_WH_CODE)), whCode));
setWhName(StringUtils.defaultIfEmpty(StringUtils.toString(map.get(FIELD_WH_NAME)), whName));
setMatType(StringUtils.defaultIfEmpty(StringUtils.toString(map.get(FIELD_MAT_TYPE)), matType));
setMatCode(StringUtils.defaultIfEmpty(StringUtils.toString(map.get(FIELD_MAT_CODE)), matCode));
setMatName(StringUtils.defaultIfEmpty(StringUtils.toString(map.get(FIELD_MAT_NAME)), matName));
setInventType(NumberUtils.toInteger(StringUtils.toString(map.get(FIELD_INVENT_TYPE)), inventType));
setInventCode(StringUtils.defaultIfEmpty(StringUtils.toString(map.get(FIELD_INVENT_CODE)), inventCode));
setInventName(StringUtils.defaultIfEmpty(StringUtils.toString(map.get(FIELD_INVENT_NAME)), inventName));
setAmount(NumberUtils.toBigDecimal(StringUtils.toString(map.get(FIELD_AMOUNT)), amount));
setWeight(NumberUtils.toBigDecimal(StringUtils.toString(map.get(FIELD_WEIGHT)), weight));
setStatus(NumberUtils.toint(StringUtils.toString(map.get(FIELD_STATUS)), status));
setNotes(StringUtils.defaultIfEmpty(StringUtils.toString(map.get(FIELD_NOTES)), notes));
setStatus(NumberUtils.toInteger(StringUtils.toString(map.get(FIELD_STATUS)), status));
setRemark(StringUtils.defaultIfEmpty(StringUtils.toString(map.get(FIELD_REMARK)), remark));
setCreatedBy(StringUtils.defaultIfEmpty(StringUtils.toString(map.get(FIELD_CREATED_BY)), createdBy));
setCreatedName(StringUtils.defaultIfEmpty(StringUtils.toString(map.get(FIELD_CREATED_NAME)), createdName));
setCreatedTime(StringUtils.defaultIfEmpty(StringUtils.toString(map.get(FIELD_CREATED_TIME)), createdTime));
setUpdatedBy(StringUtils.defaultIfEmpty(StringUtils.toString(map.get(FIELD_UPDATED_BY)), updatedBy));
setUpdatedName(StringUtils.defaultIfEmpty(StringUtils.toString(map.get(FIELD_UPDATED_NAME)), updatedName));
setUpdatedTime(StringUtils.defaultIfEmpty(StringUtils.toString(map.get(FIELD_UPDATED_TIME)), updatedTime));
setDepCode(StringUtils.defaultIfEmpty(StringUtils.toString(map.get(FIELD_DEP_CODE)), depCode));
}
/**
......@@ -505,22 +553,24 @@ public class HPKC004 extends DaoEPBase {
Map map = new HashMap();
map.put(FIELD_ID, StringUtils.toString(id, eiMetadata.getMeta(FIELD_ID)));
map.put(FIELD_COMPANY_CODE, StringUtils.toString(companyCode, eiMetadata.getMeta(FIELD_COMPANY_CODE)));
map.put(FIELD_DEP_CODE, StringUtils.toString(depCode, eiMetadata.getMeta(FIELD_DEP_CODE)));
map.put(FIELD_RECEIPT_DATE, StringUtils.toString(receiptDate, eiMetadata.getMeta(FIELD_RECEIPT_DATE)));
map.put(FIELD_SALE_NUMBER, StringUtils.toString(saleNumber, eiMetadata.getMeta(FIELD_SALE_NUMBER)));
map.put(FIELD_SALE_NO, StringUtils.toString(saleNo, eiMetadata.getMeta(FIELD_SALE_NO)));
map.put(FIELD_WH_CODE, StringUtils.toString(whCode, eiMetadata.getMeta(FIELD_WH_CODE)));
map.put(FIELD_WH_NAME, StringUtils.toString(whName, eiMetadata.getMeta(FIELD_WH_NAME)));
map.put(FIELD_MAT_TYPE, StringUtils.toString(matType, eiMetadata.getMeta(FIELD_MAT_TYPE)));
map.put(FIELD_MAT_CODE, StringUtils.toString(matCode, eiMetadata.getMeta(FIELD_MAT_CODE)));
map.put(FIELD_MAT_NAME, StringUtils.toString(matName, eiMetadata.getMeta(FIELD_MAT_NAME)));
map.put(FIELD_INVENT_TYPE, StringUtils.toString(inventType, eiMetadata.getMeta(FIELD_INVENT_TYPE)));
map.put(FIELD_INVENT_CODE, StringUtils.toString(inventCode, eiMetadata.getMeta(FIELD_INVENT_CODE)));
map.put(FIELD_INVENT_NAME, StringUtils.toString(inventName, eiMetadata.getMeta(FIELD_INVENT_NAME)));
map.put(FIELD_AMOUNT, StringUtils.toString(amount, eiMetadata.getMeta(FIELD_AMOUNT)));
map.put(FIELD_WEIGHT, StringUtils.toString(weight, eiMetadata.getMeta(FIELD_WEIGHT)));
map.put(FIELD_STATUS, StringUtils.toString(status, eiMetadata.getMeta(FIELD_STATUS)));
map.put(FIELD_NOTES, StringUtils.toString(notes, eiMetadata.getMeta(FIELD_NOTES)));
map.put(FIELD_REMARK, StringUtils.toString(remark, eiMetadata.getMeta(FIELD_REMARK)));
map.put(FIELD_CREATED_BY, StringUtils.toString(createdBy, eiMetadata.getMeta(FIELD_CREATED_BY)));
map.put(FIELD_CREATED_NAME, StringUtils.toString(createdName, eiMetadata.getMeta(FIELD_CREATED_NAME)));
map.put(FIELD_CREATED_TIME, StringUtils.toString(createdTime, eiMetadata.getMeta(FIELD_CREATED_TIME)));
map.put(FIELD_UPDATED_BY, StringUtils.toString(updatedBy, eiMetadata.getMeta(FIELD_UPDATED_BY)));
map.put(FIELD_UPDATED_NAME, StringUtils.toString(updatedName, eiMetadata.getMeta(FIELD_UPDATED_NAME)));
map.put(FIELD_UPDATED_TIME, StringUtils.toString(updatedTime, eiMetadata.getMeta(FIELD_UPDATED_TIME)));
map.put(FIELD_DEP_CODE, StringUtils.toString(depCode, eiMetadata.getMeta(FIELD_DEP_CODE)));
return map;
}
......
......@@ -11,6 +11,7 @@ import com.baosight.hpjx.hp.pz.domain.HPPZ009;
import com.baosight.hpjx.hp.pz.domain.THppz004;
import com.baosight.hpjx.hp.pz.tools.HPPZTools;
import com.baosight.hpjx.util.CommonMethod;
import com.baosight.hpjx.util.EiInfoUtils;
import com.baosight.hpjx.util.LogUtils;
import com.baosight.hpjx.util.StringUtil;
import com.baosight.iplat4j.core.ei.EiBlock;
......@@ -20,6 +21,8 @@ import com.baosight.iplat4j.core.exception.PlatException;
import com.baosight.iplat4j.core.service.impl.ServiceBase;
import com.baosight.iplat4j.ed.util.SequenceGenerator;
import org.apache.commons.collections.MapUtils;
import java.util.Arrays;
import java.util.HashMap;
import java.util.List;
......@@ -57,6 +60,10 @@ public class ServiceHPKC003 extends ServiceBase {
@Override
public EiInfo query(EiInfo inInfo) {
try {
Map queryRow = EiInfoUtils.getFirstRow(inInfo);
String receiptDate = MapUtils.getString(queryRow, "documentDate");
queryRow.put("documentDate", StringUtil.removeSpecifiedCharacter(receiptDate,
StringUtil.DEFAULT_CHARACTER_TO_BE_REMOVED));
inInfo = super.query(inInfo, "HPKC003.query", new HPPZ009());
} catch (Exception e) {
LogUtils.setDetailMsg(inInfo, e, "查询失败");
......
package com.baosight.hpjx.hp.kc.service;
import com.baosight.hpjx.common.DdynamicEnum;
import com.baosight.hpjx.core.dao.DaoUtils;
import com.baosight.hpjx.hp.constant.HPConstant;
import com.baosight.hpjx.hp.kc.domain.HPKC003;
import com.baosight.hpjx.hp.kc.domain.HPKC004;
import com.baosight.hpjx.hp.pz.domain.HPPZ007;
import com.baosight.hpjx.hp.pz.domain.HPPZ009;
import com.baosight.hpjx.hp.pz.domain.THppz004;
import com.baosight.hpjx.hp.pz.tools.HPPZTools;
import com.baosight.hpjx.util.CommonMethod;
import com.baosight.hpjx.util.EiInfoUtils;
import com.baosight.hpjx.util.LogUtils;
import com.baosight.hpjx.util.StringUtil;
import com.baosight.hpjx.util.contants.ACConstants;
import com.baosight.iplat4j.core.ei.EiBlock;
......@@ -12,6 +19,9 @@ import com.baosight.iplat4j.core.ei.EiConstant;
import com.baosight.iplat4j.core.ei.EiInfo;
import com.baosight.iplat4j.core.exception.PlatException;
import com.baosight.iplat4j.core.service.impl.ServiceBase;
import com.baosight.iplat4j.ed.util.SequenceGenerator;
import org.apache.commons.collections.MapUtils;
import java.util.*;
import java.util.stream.Collectors;
......@@ -21,104 +31,104 @@ import java.util.stream.Collectors;
* @date 2024年01月09日 10:18
*/
public class ServiceHPKC004 extends ServiceBase {
/**
* 画面初始化.
*/
public EiInfo initLoad(EiInfo inInfo) {
HPKC004 HPKC004 = new HPKC004();
EiInfo outInfo = super.initLoad(inInfo, HPKC004);
outInfo.addBlock(EiConstant.queryBlock).setCell(0,"receiptDate",CommonMethod.getCurrentSameYearMonth());
outInfo.getBlock(EiConstant.resultBlock).getRows().clear();
CommonMethod.initBlock(outInfo, Arrays.asList(DdynamicEnum.WH_RECORD_BLOCK_ID), null);
EiBlock block = outInfo.addBlock(EiConstant.queryBlock);
block.setCell(ACConstants.ROW_CODE_0, ACConstants.PARAM_WH_CODE, outInfo.getBlock(ACConstants.WH_CODE_BLOCK_ID).getRow(ACConstants.ROW_CODE_0).get(ACConstants.FIELD_VALUE));
return outInfo;
}
/**
* 查询操作.
*/
@Override
public EiInfo query(EiInfo inInfo) {
String receiptDate = inInfo.getCellStr(EiConstant.queryBlock,0,"receiptDate");
inInfo.setCell(EiConstant.queryBlock,0,"receiptDate", StringUtil.removeHorizontalLine(receiptDate));
/* 调用EI查询方法.*/
return super.query(inInfo, "HPKC004.query", new HPKC004());
/**
* 画面初始化
*
* @param inInfo
* @return
*/
public EiInfo initLoad(EiInfo inInfo) {
try {
CommonMethod.initBlock(inInfo, Arrays.asList(DdynamicEnum.WH_RECORD_QUERY_BLOCK_ID), null);
CommonMethod.initBlock(inInfo, Arrays.asList(DdynamicEnum.INVENT_NAME_BLOCK_ID), null);
inInfo.addBlock(EiConstant.resultBlock).addBlockMeta(new HPKC004().eiMetadata);
} catch (Exception e) {
LogUtils.setDetailMsg(inInfo, e, "初始化失败");
}
return inInfo;
}
/**
* 查询操作
*
* @param inInfo
* @return
*/
@Override
public EiInfo query(EiInfo inInfo) {
try {
Map queryRow = EiInfoUtils.getFirstRow(inInfo);
String receiptDate = MapUtils.getString(queryRow, "receiptDate");
queryRow.put("receiptDate", StringUtil.removeSpecifiedCharacter(receiptDate,
StringUtil.DEFAULT_CHARACTER_TO_BE_REMOVED));
inInfo = super.query(inInfo, "HPKC004.query", new HPKC004());
} catch (Exception e) {
LogUtils.setDetailMsg(inInfo, e, "查询失败");
}
return inInfo;
}
/**
* 新增操作.
*/
@Override
public EiInfo insert(EiInfo inInfo) {
CommonMethod.creatorInfo(inInfo,EiConstant.resultBlock);
for (int i = 0; i < inInfo.getBlock(EiConstant.resultBlock).getRowCount(); i++) {
String receiptDate = inInfo.getCellStr(EiConstant.resultBlock,i,"receiptDate");
inInfo.setCell(EiConstant.resultBlock,i,"receiptDate", StringUtil.removeHorizontalLine(receiptDate));
String whCode = inInfo.getCellStr(EiConstant.resultBlock,i,"whCode");
String matCode = inInfo.getCellStr(EiConstant.resultBlock,i,"matCode");
Map params=new HashMap<>();
params.put("whCode", whCode);
List query = dao.query("HPPZ007.queryByWhCode",params);
String whName = ((HPPZ007)query.get(0)).getWhName();
inInfo.setCell(EiConstant.resultBlock,i,"whName", whName);
Map params1=new HashMap<>();
params1.put("inventCode", matCode);
List query1 = dao.query("HPPZ004.queryMatNameByCode",params1);
String matName = ((THppz004)query1.get(0)).getInventName();
inInfo.setCell(EiConstant.resultBlock,i,"matName", matName);
}
return super.insert(inInfo,"HPKC004.insert");
/**
* 新增操作
*
* @param inInfo
* @return
*/
@Override
public EiInfo insert(EiInfo inInfo) {
CommonMethod.creatorInfo(inInfo, EiConstant.resultBlock);
try {
List<Map> resultRows = inInfo.getBlock(EiConstant.resultBlock).getRows();
// 数据写入
for (int i = 0; i < resultRows.size(); i++) {
HPKC004 fKc004 = new HPKC004();
fKc004.fromMap(resultRows.get(i));
fKc004.setReceiptDate(StringUtil.removeHorizontalLine(fKc004.getReceiptDate()));
// 仓库名称
fKc004.setWhName(HPPZTools.getWhNameByCode(fKc004.getWhCode()));
// 物料名称
fKc004.setInventName(HPPZTools.getInventNameByCode(fKc004.getInventCode()));
// 生成销售单号
fKc004.setSaleNo(SequenceGenerator.getNextSequence(HPConstant.SequenceId.HPKC004_SALE_NO));
DaoUtils.insert("HPKC004.insert", fKc004);
}
inInfo = this.query(inInfo);
inInfo.setStatus(EiConstant.STATUS_DEFAULT);
inInfo.setMsg("操作成功!本次对[" + resultRows.size() + "]条数据新增成功!");
} catch (Exception e) {
LogUtils.setDetailMsg(inInfo, e, "新增失败");
}
return inInfo;
}
/**
* 修改操作.
*/
public EiInfo update(EiInfo inInfo) {
try {
HPKC004 HPKC004 = new HPKC004();
EiBlock eiBlock = inInfo.getBlock(EiConstant.resultBlock);
List<String> list = new ArrayList<>();
for (int i = 0; i < eiBlock.getRowCount(); i++) {
Map<?, ?> map = eiBlock.getRow(i);
HPKC004.fromMap(map);
if (HPKC004.getStatus() == 1) {
list.add(HPKC004.getSaleNumber());
continue;
}
Map params=new HashMap<>();
params.put("whCode", HPKC004.getWhCode());
List query = dao.query("HPPZ007.queryByWhCode",params);
String whName = ((HPPZ007)query.get(0)).getWhName();
HPKC004.setWhName(whName);
Map params1=new HashMap<>();
params1.put("inventCode", HPKC004.getMatCode());
List query1 = dao.query("HPPZ004.queryMatNameByCode",params1);
String matName = ((THppz004)query1.get(0)).getInventName();
HPKC004.setMatName(matName);
this.dao.update("HPKC004.update", HPKC004.toMap());
}
if (list.size() > 0) {
inInfo.setStatus(EiConstant.STATUS_SUCCESS);
inInfo.setMsg("部分数据修改成功!销售出库单号为:" + list.stream()
.collect(Collectors.joining(",")) + "状态为已审核不能进行修改!");
} else {
inInfo.setStatus(EiConstant.STATUS_SUCCESS);
inInfo.setMsg("修改成功!");
}
} catch (PlatException e) {
inInfo.setStatus(EiConstant.STATUS_FAILURE);
inInfo.setMsg("操作失败!原因参见详细错误描述!");
inInfo.setDetailMsg(e.getMessage());
logError("修改失败", e.getMessage());
return inInfo;
}
return query(inInfo);
/**
* 修改操作
*
* @param inInfo
* @return
*/
public EiInfo update(EiInfo inInfo) {
CommonMethod.creatorInfo(inInfo, EiConstant.resultBlock);
try {
List<Map> resultRows = inInfo.getBlock(EiConstant.resultBlock).getRows();
for (int i = 0; i < resultRows.size(); i++) {
HPKC004 fKc004 = new HPKC004();
fKc004.fromMap(resultRows.get(i));
fKc004.setReceiptDate(StringUtil.removeHorizontalLine(fKc004.getReceiptDate()));
// 仓库名称
fKc004.setWhName(HPPZTools.getWhNameByCode(fKc004.getWhCode()));
// 物料名称
fKc004.setInventName(HPPZTools.getInventNameByCode(fKc004.getInventCode()));
DaoUtils.update("HPKC004.update", fKc004);
}
inInfo = this.query(inInfo);
inInfo.setStatus(EiConstant.STATUS_DEFAULT);
inInfo.setMsg("操作成功!本次对[" + resultRows.size() + "]条数据修改成功!");
} catch (Exception e) {
LogUtils.setDetailMsg(inInfo, e, "修改失败");
}
return inInfo;
}
/**
......
......@@ -257,7 +257,7 @@ public class ServiceHPKC009 extends ServiceBase {
List<HPKC004> cItems = dao.query("HPKC004.statDate", queryMap);
Map<String, HPKC004> cItemMap = cItems.stream().collect(Collectors.toMap(item ->
item.getCompanyCode() + "#" + item.getDepCode() + "#" + item.getWhCode() + "#"
+ item.getMatType() + "#" + item.getMatCode(), item -> item));
+ item.getInventType() + "#" + item.getInventCode(), item -> item));
// 1.4、期初库存
queryMap.put("dateProc", queryMap.get("beforeDate"));
queryMap.put("kcType", HPConstant.KcType.SC);
......
<?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"> <!-- table information
Generate time : 2024-01-11 15:32:36
Version : 1.0
schema : hpjx
tableName : T_HPKC004
ID BIGINT NOT NULL primarykey,
COMPANY_CODE VARCHAR NOT NULL,
RECEIPT_DATE VARCHAR NOT NULL,
SALE_NUMBER VARCHAR NOT NULL,
WH_CODE VARCHAR NOT NULL,
WH_NAME VARCHAR NOT NULL,
MAT_TYPE VARCHAR,
MAT_CODE VARCHAR,
MAT_NAME VARCHAR,
AMOUNT DECIMAL,
WEIGHT DECIMAL,
STATUS TINYINT NOT NULL,
NOTES VARCHAR,
CREATED_BY VARCHAR,
CREATED_TIME VARCHAR,
UPDATED_BY VARCHAR,
UPDATED_TIME VARCHAR,
DEP_CODE VARCHAR
-->
<!DOCTYPE sqlMap PUBLIC "-//iBATIS.com//DTD SQL Map 2.0//EN" "http://www.ibatis.com/dtd/sql-map-2.dtd">
<sqlMap namespace="HPKC004">
<sql id="column">
ID as "id",
COMPANY_CODE as "companyCode", <!-- 企业编码 预留 -->
DEP_CODE as "depCode", <!-- 部门编码 -->
RECEIPT_DATE as "receiptDate", <!-- 单据日期 -->
SALE_NO as "saleNo", <!-- 销售出库单号 -->
WH_CODE as "whCode", <!-- 仓库编码 -->
WH_NAME as "whName", <!-- 仓库名称 -->
INVENT_TYPE as "inventType", <!-- 存货类型 -->
INVENT_CODE as "inventCode", <!-- 存货编码 -->
INVENT_NAME as "inventName", <!-- 存货名称 -->
AMOUNT as "amount", <!-- 数量 -->
WEIGHT as "weight", <!-- 重量 -->
STATUS as "status", <!-- 单据状态 0待审核 1已审核 -->
REMARK as "remark", <!-- 备注 -->
CREATED_BY as "createdBy", <!-- 创建人 -->
CREATED_NAME as "createdName", <!-- 创建名称 -->
CREATED_TIME as "createdTime", <!-- 创建时间 -->
UPDATED_BY as "updatedBy", <!-- 更新人 -->
UPDATED_NAME as "updatedName", <!-- 更新人名称 -->
UPDATED_TIME as "updatedTime" <!-- 更新时间 -->
</sql>
<sql id="condition">
<isNotEmpty prepend=" AND " property="id">
ID = #id#
</isNotEmpty>
<isNotEmpty prepend=" AND " property="companyCode">
COMPANY_CODE = #companyCode#
</isNotEmpty>
<isNotEmpty prepend=" AND " property="receiptDate">
RECEIPT_DATE = #receiptDate#
</isNotEmpty>
<isNotEmpty prepend=" AND " property="saleNumber">
SALE_NUMBER = #saleNumber#
</isNotEmpty>
<isNotEmpty prepend=" AND " property="whCode">
WH_CODE = #whCode#
</isNotEmpty>
<isNotEmpty prepend=" AND " property="whName">
WH_NAME = #whName#
</isNotEmpty>
<isNotEmpty prepend=" AND " property="matType">
MAT_TYPE = #matType#
</isNotEmpty>
<isNotEmpty prepend=" AND " property="matCode">
MAT_CODE = #matCode#
</isNotEmpty>
<isNotEmpty prepend=" AND " property="matName">
MAT_NAME = #matName#
</isNotEmpty>
<isNotEmpty prepend=" AND " property="amount">
AMOUNT = #amount#
</isNotEmpty>
<isNotEmpty prepend=" AND " property="weight">
WEIGHT = #weight#
</isNotEmpty>
<isNotEmpty prepend=" AND " property="status">
STATUS = #status#
</isNotEmpty>
<isNotEmpty prepend=" AND " property="notes">
NOTES = #notes#
</isNotEmpty>
<isNotEmpty prepend=" AND " property="createdBy">
CREATED_BY = #createdBy#
</isNotEmpty>
<isNotEmpty prepend=" AND " property="createdTime">
CREATED_TIME = #createdTime#
</isNotEmpty>
<isNotEmpty prepend=" AND " property="updatedBy">
UPDATED_BY = #updatedBy#
</isNotEmpty>
<isNotEmpty prepend=" AND " property="updatedTime">
UPDATED_TIME = #updatedTime#
</isNotEmpty>
<isNotEmpty prepend=" AND " property="depCode">
DEP_CODE = #depCode#
</isNotEmpty>
<isNotEmpty prepend=" AND " property="id">
ID = #id#
</isNotEmpty>
<isNotEmpty prepend=" AND " property="companyCode">
COMPANY_CODE = #companyCode#
</isNotEmpty>
<isNotEmpty prepend=" AND " property="depCode">
DEP_CODE = #depCode#
</isNotEmpty>
<isNotEmpty prepend=" AND " property="receiptDate">
RECEIPT_DATE = #receiptDate#
</isNotEmpty>
<isNotEmpty prepend=" AND " property="saleNo">
SALE_NO = #saleNo#
</isNotEmpty>
<isNotEmpty prepend=" AND " property="whCode">
WH_CODE = #whCode#
</isNotEmpty>
<isNotEmpty prepend=" AND " property="whName">
WH_NAME = #whName#
</isNotEmpty>
<isNotEmpty prepend=" AND " property="inventType">
INVENT_TYPE = #inventType#
</isNotEmpty>
<isNotEmpty prepend=" AND " property="inventCode">
INVENT_CODE = #inventCode#
</isNotEmpty>
<isNotEmpty prepend=" AND " property="inventName">
INVENT_NAME = #inventName#
</isNotEmpty>
</sql>
<select id="query" parameterClass="java.util.HashMap"
resultClass="com.baosight.hpjx.hp.kc.domain.HPKC004">
<sql id="order">
<dynamic prepend="ORDER BY">
<isNotEmpty property="orderBy">
$orderBy$
</isNotEmpty>
<isEmpty property="orderBy">
ID DESC
</isEmpty>
</dynamic>
</sql>
<select id="query" resultClass="com.baosight.hpjx.hp.kc.domain.HPKC004">
SELECT
ID as "id",
COMPANY_CODE as "companyCode", <!-- 企业编码 预留 -->
RECEIPT_DATE as "receiptDate", <!-- 单据日期 -->
SALE_NUMBER as "saleNumber", <!-- 销售出库单号 -->
CONCAT_WS('-',WH_CODE,WH_NAME) as "whCode", <!-- 仓库编码 -->
WH_NAME as "whName", <!-- 仓库名称 -->
MAT_TYPE as "matType", <!-- 物料类型 -->
MAT_CODE as "matCode", <!-- 物料编码 -->
MAT_NAME as "matName", <!-- 物料名称 -->
AMOUNT as "amount", <!-- 数量 -->
WEIGHT as "weight", <!-- 重量 -->
STATUS as "status", <!-- 单据状态 0待审核 1已审核 -->
NOTES as "notes", <!-- 备注 -->
CREATED_BY as "createdBy", <!-- 创建人 -->
CREATED_TIME as "createdTime", <!-- 创建时间 -->
UPDATED_BY as "updatedBy", <!-- 更新人 -->
UPDATED_TIME as "updatedTime", <!-- 更新时间 -->
DEP_CODE as "depCode" <!-- 部门编码 -->
<include refid="column"/>
FROM hpjx.T_HPKC004 WHERE 1=1
<isNotEmpty prepend=" AND " property="receiptDate">
RECEIPT_DATE = #receiptDate#
</isNotEmpty>
<isNotEmpty prepend=" AND " property="saleNumber">
SALE_NUMBER = #saleNumber#
</isNotEmpty>
<isNotEmpty prepend=" AND " property="whName">
WH_NAME LIKE '%' || #whName# || '%'
</isNotEmpty>
<dynamic prepend="ORDER BY">
<isNotEmpty property="orderBy">
$orderBy$
</isNotEmpty>
<isEmpty property="orderBy">
ID asc
</isEmpty>
</dynamic>
<include refid="condition"/>
<include refid="order"/>
</select>
<select id="count" resultClass="int">
SELECT COUNT(*) FROM hpjx.T_HPKC004 WHERE 1=1
<isNotEmpty prepend=" AND " property="receiptDate">
RECEIPT_DATE = #receiptDate#
</isNotEmpty>
<isNotEmpty prepend=" AND " property="saleNumber">
SALE_NUMBER = #saleNumber#
</isNotEmpty>
<isNotEmpty prepend=" AND " property="whName">
WH_NAME LIKE '%' || #whName# || '%'
</isNotEmpty>
<include refid="condition"/>
</select>
<!--
<isNotEmpty prepend=" AND " property="id">
ID = #id#
</isNotEmpty>
<isNotEmpty prepend=" AND " property="companyCode">
COMPANY_CODE = #companyCode#
</isNotEmpty>
<isNotEmpty prepend=" AND " property="receiptDate">
RECEIPT_DATE = #receiptDate#
</isNotEmpty>
<isNotEmpty prepend=" AND " property="saleNumber">
SALE_NUMBER = #saleNumber#
</isNotEmpty>
<isNotEmpty prepend=" AND " property="whCode">
WH_CODE = #whCode#
</isNotEmpty>
<isNotEmpty prepend=" AND " property="whName">
WH_NAME = #whName#
</isNotEmpty>
<isNotEmpty prepend=" AND " property="matType">
MAT_TYPE = #matType#
</isNotEmpty>
<isNotEmpty prepend=" AND " property="matCode">
MAT_CODE = #matCode#
</isNotEmpty>
<isNotEmpty prepend=" AND " property="matName">
MAT_NAME = #matName#
</isNotEmpty>
<isNotEmpty prepend=" AND " property="amount">
AMOUNT = #amount#
</isNotEmpty>
<isNotEmpty prepend=" AND " property="weight">
WEIGHT = #weight#
</isNotEmpty>
<isNotEmpty prepend=" AND " property="status">
STATUS = #status#
</isNotEmpty>
<isNotEmpty prepend=" AND " property="notes">
NOTES = #notes#
</isNotEmpty>
<isNotEmpty prepend=" AND " property="createdBy">
CREATED_BY = #createdBy#
</isNotEmpty>
<isNotEmpty prepend=" AND " property="createdTime">
CREATED_TIME = #createdTime#
</isNotEmpty>
<isNotEmpty prepend=" AND " property="updatedBy">
UPDATED_BY = #updatedBy#
</isNotEmpty>
<isNotEmpty prepend=" AND " property="updatedTime">
UPDATED_TIME = #updatedTime#
</isNotEmpty>
<isNotEmpty prepend=" AND " property="depCode">
DEP_CODE = #depCode#
</isNotEmpty>
-->
<insert id="insert">
INSERT INTO hpjx.T_HPKC004 (
COMPANY_CODE, <!-- 企业编码 预留 -->
RECEIPT_DATE, <!-- 单据日期 -->
SALE_NUMBER, <!-- 销售出库单号 -->
WH_CODE, <!-- 仓库编码 -->
WH_NAME, <!-- 仓库名称 -->
MAT_TYPE, <!-- 物料类型 -->
MAT_CODE, <!-- 物料编码 -->
MAT_NAME, <!-- 物料名称 -->
AMOUNT, <!-- 数量 -->
WEIGHT, <!-- 重量 -->
STATUS, <!-- 单据状态 0待审核 1已审核 -->
NOTES, <!-- 备注 -->
CREATED_BY, <!-- 创建人 -->
CREATED_TIME, <!-- 创建时间 -->
UPDATED_BY, <!-- 更新人 -->
UPDATED_TIME, <!-- 更新时间 -->
DEP_CODE <!-- 部门编码 -->
)
VALUES (#companyCode#, #receiptDate#, #saleNumber#, #whCode#, #whName#, #matType#, #matCode#, #matName#, #amount#, #weight#, 0, #notes#, #createdBy#, #createdTime#, #updatedBy#, #updatedTime#, #depCode#)
</insert>
<insert id="insert">
INSERT INTO ${hpjxSchema}.T_HPKC004 (
COMPANY_CODE, <!-- 企业编码 预留 -->
DEP_CODE, <!-- 部门编码 -->
RECEIPT_DATE, <!-- 单据日期 -->
SALE_NO, <!-- 销售出库单号 -->
WH_CODE, <!-- 仓库编码 -->
WH_NAME, <!-- 仓库名称 -->
INVENT_TYPE, <!-- 存货类型 -->
INVENT_CODE, <!-- 存货编码 -->
INVENT_NAME, <!-- 存货名称 -->
AMOUNT, <!-- 数量 -->
WEIGHT, <!-- 重量 -->
STATUS, <!-- 单据状态 0待审核 1已审核 -->
REMARK, <!-- 备注 -->
CREATED_BY, <!-- 创建人 -->
CREATED_NAME, <!-- 创建名称 -->
CREATED_TIME <!-- 创建时间 -->
) VALUES (
#companyCode#, #depCode#, #receiptDate#, #saleNo#, #whCode#, #whName#,
#inventType#, #inventCode#, #inventName#, #amount#, #weight#, #status#,
#remark#, #createdBy#, #createdName#, #createdTime#
)
</insert>
<delete id="delete">
DELETE FROM hpjx.T_HPKC004 WHERE
ID = #id#
DELETE FROM ${hpjxSchema}.T_HPKC004 WHEREID = #id#
</delete>
<update id="update">
UPDATE hpjx.T_HPKC004
SET
COMPANY_CODE = #companyCode#, <!-- 企业编码 预留 -->
RECEIPT_DATE = #receiptDate#, <!-- 单据日期 -->
SALE_NUMBER = #saleNumber#, <!-- 销售出库单号 -->
WH_CODE = #whCode#, <!-- 仓库编码 -->
WH_NAME = #whName#, <!-- 仓库名称 -->
MAT_TYPE = #matType#, <!-- 物料类型 -->
MAT_CODE = #matCode#, <!-- 物料编码 -->
MAT_NAME = #matName#, <!-- 物料名称 -->
AMOUNT = #amount#, <!-- 数量 -->
WEIGHT = #weight#, <!-- 重量 -->
STATUS = #status#, <!-- 单据状态 0待审核 1已审核 -->
NOTES = #notes#, <!-- 备注 -->
CREATED_BY = #createdBy#, <!-- 创建人 -->
CREATED_TIME = #createdTime#, <!-- 创建时间 -->
UPDATED_BY = #updatedBy#, <!-- 更新人 -->
UPDATED_TIME = #updatedTime#, <!-- 更新时间 -->
DEP_CODE = #depCode# <!-- 部门编码 -->
WHERE
ID = #id#
UPDATE ${hpjxSchema}.T_HPKC004
SET
RECEIPT_DATE = #receiptDate#, <!-- 单据日期 -->
WH_CODE = #whCode#, <!-- 仓库编码 -->
WH_NAME = #whName#, <!-- 仓库名称 -->
INVENT_TYPE = #inventType#, <!-- 存货类型 -->
INVENT_CODE = #inventCode#, <!-- 存货编码 -->
INVENT_NAME = #inventName#, <!-- 存货名称 -->
AMOUNT = #amount#, <!-- 数量 -->
WEIGHT = #weight#, <!-- 重量 -->
STATUS = #status#, <!-- 单据状态 0待审核 1已审核 -->
REMARK = #remark#, <!-- 备注 -->
UPDATED_BY = #updatedBy#, <!-- 更新人 -->
UPDATED_NAME = #updatedName#, <!-- 更新人名称 -->
UPDATED_TIME = #updatedTime# <!-- 更新时间 -->
WHERE ID = #id#
</update>
<!-- 统计库存 -->
......@@ -253,8 +136,8 @@
COMPANY_CODE AS "companyCode",
DEP_CODE AS "depCode",
WH_CODE AS "whCode",
MAT_TYPE AS "matType",
MAT_CODE AS "matCode",
INVENT_TYPE AS "inventType",
INVENT_CODE AS "inventCode",
COALESCE(SUM(AMOUNT), 0) AS "amount",
COALESCE(SUM(WEIGHT), 0) AS "weight"
FROM ${hpjxSchema}.T_HPKC004
......@@ -262,7 +145,7 @@
<isNotEmpty prepend=" AND " property="createdTimeFrom">
CREATED_TIME BETWEEN #createdTimeFrom# AND #createdTimeTo#
</isNotEmpty>
GROUP BY COMPANY_CODE, DEP_CODE, WH_CODE, MAT_TYPE, MAT_CODE
GROUP BY COMPANY_CODE, DEP_CODE, WH_CODE, INVENT_TYPE, INVENT_CODE
</select>
</sqlMap>
let inventNameGlobalData = [];
$(function () {
var eiInfo = new EiInfo();
var globalData = [];
var day1 = new Date();
day1.setTime(day1.getTime());
var s1 = day1.getFullYear() + "-" + (day1.getMonth() + 1) + "-" + day1.getDate();
$("#inqu_status-0-receiptDate").val(s1);
// var day1 = new Date();
// day1.setTime(day1.getTime());
// var s1 = day1.getFullYear() + "-" + (day1.getMonth() + 1) + "-" + day1.getDate();
// $("#inqu_status-0-receiptDate").val(s1);
// 查询
$("#QUERY").on("click", function () {
resultGrid.dataSource.page(1); // 点击查询按钮,从第1页开始查询
var dataSource;
eiInfo = new EiInfo();
EiCommunicator.send("HPPZ004", "queryComboBox", eiInfo, {
onSuccess: function (ei) {
dataSource = ei.getBlock("invent_name_block_id").getMappedRows();
globalData = dataSource;
}, onFail: function (ei) {
}
}, {async: false});
});
$("#QUERY").on("click", query);
IPLATUI.EFGrid = {
"result": {
columns: [
{
field: "matCode",
template: function(dataItem) {
for (var i = 0 ; i < globalData.length ; i++) {
if ( globalData[i]['valueField'] === dataItem['matCode']) {
return globalData[i]['textField'];
}
}
return "";
},
editor: function (container, options) {
var grid = container.closest(".k-grid").data("kendoGrid");
var cellIndex = grid.cellIndex(container);
var input = $('<input />');
input.attr("name", options.field);
input.attr("id", options.field);
input.appendTo(container);
eiInfo.set("inventType", options.model["matType"]);
var dataSource;
EiCommunicator.send("HPPZ004", "queryComboBox", eiInfo, {
onSuccess: function (ei) {
dataSource = ei.getBlock("invent_name_block_id").getMappedRows();
globalData = dataSource;
}, onFail: function (ei) {
}
}, {async: false});
input.kendoDropDownList({
valuePrimitive: true,
dataTextField: "textField",
dataValueField: "valueField",
dataSource: dataSource,
template: "#=textField#"
});
}
}
],
columns: [{
field: "inventCode",
template: function (dataItem) {
for (let i = 0; i < inventNameGlobalData.length; i++) {
if (inventNameGlobalData[i]['valueField'] === dataItem['inventCode']) {
return inventNameGlobalData[i]['textField'];
}
}
return "";
},
editor: function (container, options) {
var grid = container.closest(".k-grid").data("kendoGrid");
var cellIndex = grid.cellIndex(container);
var input = $('<input />');
input.attr("name", options.field);
input.attr("id", options.field);
input.appendTo(container);
let eiInfo = new EiInfo();
eiInfo.set("inventType", options.model["inventType"]);
var dataSource;
EiCommunicator.send("HPPZ004", "queryComboBox", eiInfo, {
onSuccess: function (ei) {
dataSource = ei.getBlock("invent_name_block_id").getMappedRows();
inventNameGlobalData = dataSource;
},
onFail: function (ei) {
}
}, {async: false});
input.kendoDropDownList({
valuePrimitive: true,
dataTextField: "textField",
dataValueField: "valueField",
dataSource: dataSource,
template: "#=textField#"
});
}
}],
loadComplete: function (grid) {
// 新增
$("#BTN_INSERT").on("click", function () {
var btnNode = $(this);
//禁用按钮
btnNode.attr("disabled", true);
IPLAT.submitNode($("#HPKC004"), "HPKC004", "insert", {
onSuccess: function (ei) {
if (ei["status"] == -1) {
NotificationUtil(ei, "error");
} else {
// 绑定grid
resultGrid.setEiInfo(ei);
NotificationUtil({
msg: '新增成功'
});
}
//释放禁用按钮
btnNode.attr("disabled", false);
resultGrid.dataSource.page(1);
},
onFail: function (ei) { // onFail 表示失败回调函数
// 发生异常
console.log(ei);
//释放禁用按钮
btnNode.attr("disabled", false);
}
});
});
// 修改
$("#BTN_UPDATE").on("click", function () {
var rowCount = resultGrid.getCheckedRows();
// 检验是否选中数据
if (rowCount == null || rowCount == "") {
NotificationUtil({
msg: '请选择一条或多条数据'
}, "warning");
return false;
}
var btnNode = $(this);
//禁用按钮
btnNode.attr("disabled", true);
IPLAT.submitNode($("#HPKC004"), "HPKC004", "update", {
onSuccess: function (ei) {
if (ei["status"] == -1) {
NotificationUtil(ei, "error");
} else {
NotificationUtil({
msg: '修改成功'
});
// 绑定grid
resultGrid.setEiInfo(ei);
}
//释放禁用按钮
btnNode.attr("disabled", false);
},
onFail: function (ei) { // onFail 表示失败回调函数
// 发生异常
console.log(ei);
//释放禁用按钮
btnNode.attr("disabled", false);
}
});
});
//删除
$("#DELETE").on("click", function () {
var btnNode = $(this);
//禁用按钮
btnNode.attr("disabled", true);
var dataItems = resultGrid.getCheckedRows();
if (dataItems == null || dataItems == "") {
NotificationUtil({
......@@ -157,11 +72,9 @@ $(function () {
NotificationUtil({
msg: '删除成功'
});
// 绑定grid
resultGrid.setEiInfo(ei);
}
//释放禁用按钮
btnNode.attr("disabled", false);
},
......@@ -169,20 +82,37 @@ $(function () {
// 表示失败回调函数
// 发生异常
console.log(ei);
//释放禁用按钮
btnNode.attr("disabled", false);
}
});
});
}
},
}
}
;
});
/**
* 页面加载时执行
*/
$(window).load(function () {
// 存货名称
let inInfo = new EiInfo();
EiCommunicator.send("HPPZ004", "queryComboBox", inInfo, {
onSuccess: function (ei) {
inventNameGlobalData = ei.getBlock("invent_name_block_id").getMappedRows();
},
onFail: function (ei) {
}
}, {async: false});
// 查询
query();
});
/**
* 查询
*/
let query = function () {
resultGrid.dataSource.page(1);
}
......@@ -6,55 +6,51 @@
<c:set var="ctx" value="${pageContext.request.contextPath}"/>
<EF:EFPage title="销售出库单">
<EF:EFRegion id="inqu" title="查询条件">
<div class="row">
<EF:EFDatePicker ename="inqu_status-0-receiptDate" cname="单据日期"
format="yyyy-MM-dd" required="true"/>
<EF:EFInput ename="inqu_status-0-saleNumber" cname="销售出库单号" colWidth="4" readonly="false"/>
<EF:EFInput ename="inqu_status-0-whName" cname="仓库名称" colWidth="4" readonly="false"/>
</div>
<div class="row">
<EF:EFDatePicker ename="inqu_status-0-receiptDate" cname="单据日期" colWidth="3" format="yyyy-MM-dd"
readonly="true"/>
<EF:EFInput ename="inqu_status-0-saleNo" cname="生产销售单号" colWidth="3"/>
<EF:EFSelect ename="inqu_status-0-whCode" cname="仓库名称" colWidth="3" filter="contains" defultValue="">
<EF:EFOption label="请选择" value=""/>
<EF:EFOptions blockId="whName_block_id" textField="textField" valueField="valueField"/>
</EF:EFSelect>
<EF:EFSelect ename="inqu_status-0-inventCode" cname="存货名称" colWidth="3" filter="contains" defultValue="">
<EF:EFOption label="请选择" value=""/>
<EF:EFOptions blockId="invent_name_block_id" textField="textField" valueField="valueField"/>
</EF:EFSelect>
</div>
</EF:EFRegion>
<EF:EFRegion id="result" title="明细信息">
<EF:EFGrid blockId="result" autoDraw="false" isFloat="true" autoFit="true">
<EF:EFColumn ename="id" cname="内码" hidden="true"/>
<EF:EFColumn ename="receiptDate" cname="单据日期" editType="date" dateFormat="yyyy-MM-dd" parseFormats="['yyyyMMdd']" width="100" readonly="false" align="center" />
<EF:EFColumn ename="saleNumber" cname="销售出库单号" width="100" readonly="false" />
<EF:EFComboColumn ename="whCode"
cname="仓库编码"
columnTemplate="#=textField#"
itemTemplate="#=textField#"
blockName="wh_record_block_id"
textField="textField"
valueField="valueField"
align="center"
filter="contains"
width="100"
>
</EF:EFComboColumn>
<%-- <EF:EFColumn ename="whName" cname="仓库名称" width="100" enable = "false"/>--%>
<EF:EFComboColumn ename="matType" cname="物料类型" width="100" readonly="false"
textField="textField" valueField="valueField" align="center">
<EF:EFOption label="1-原材料" value="1"></EF:EFOption>
<EF:EFOption label="2-耗材" value="2"></EF:EFOption>
<EF:EFOption label="3-半成品" value="3"></EF:EFOption>
<EF:EFOption label="4-产成品" value="4"></EF:EFOption>
</EF:EFComboColumn>
<EF:EFColumn ename="matCode" cname="物料编码" width="100" readonly="false" align="center"/>
<%-- <EF:EFColumn ename="matName" cname="物料名称" width="100" readonly="false"/>--%>
<EF:EFColumn ename="amount" cname="数量" format="{0:N3}" maxLength="20" width="100" readonly="false" align="center"/>
<EF:EFColumn ename="weight" cname="重量" format="{0:N3}" maxLength="20" width="100" readonly="false" align="center"/>
<EF:EFComboColumn ename="status" cname="单据状态" width="100" readonly="true"
textField="textField" valueField="valueField" align="center">
<EF:EFOption label="0-待审核" value="0"></EF:EFOption>
<EF:EFOption label="1-已审核" value="1"></EF:EFOption>
</EF:EFComboColumn>
<EF:EFColumn ename="notes" cname="备注" width="100" readonly="false" align="center"/>
</EF:EFGrid>
<EF:EFGrid blockId="result" autoDraw="false" isFloat="true" autoFit="true">
<EF:EFColumn ename="id" cname="内码" hidden="true"/>
<EF:EFColumn ename="saleNo" cname="销售出库单号" enable="false" width="130" align="center"/>
<EF:EFColumn ename="receiptDate" cname="单据日期" width="100" align="center" editType="date"
dateFormat="yyyy-MM-dd" parseFormats="['yyyyMMdd']" required="true"/>
<EF:EFComboColumn cname="仓库名称" ename="whCode" columnTemplate="#=textField#"
itemTemplate="#=textField#" blockName="whName_block_id"
textField="textField" valueField="valueField"
align="center" filter="contains" width="120">
</EF:EFComboColumn>
<EF:EFComboColumn cname="存货类型" ename="inventType" width="100" align="center">
<EF:EFCodeOption codeName="hpjx.hpkc.inventType"/>
</EF:EFComboColumn>
<EF:EFColumn cname="存货名称" ename="inventCode" width="120" align="center"/>
<EF:EFColumn cname="数量" ename="amount" format="{0:N3}" maxLength="20" width="100"
align="center"/>
<EF:EFColumn cname="重量" ename="weight" format="{0:N3}" maxLength="20" width="100"
align="center"/>
<EF:EFComboColumn cname="单据状态" ename="status" width="100" readonly="true"
textField="textField" valueField="valueField" align="center">
<EF:EFOption label="0-待审核" value="0"></EF:EFOption>
<EF:EFOption label="1-已审核" value="1"></EF:EFOption>
</EF:EFComboColumn>
<EF:EFColumn cname="备注" ename="remark" width="100" readonly="false" align="center"/>
<EF:EFColumn cname="创建人名称" ename="createdName" enable="false" width="120" align="center"/>
<EF:EFColumn cname="创建时间" ename="createdTime" enable="false" width="140" align="center"
editType="datetime" parseFormats="['yyyyMMddHHmmss','yyyy-MM-dd HH:mm:ss']"/>
</EF:EFGrid>
</EF:EFRegion>
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment