Commit 0114ce3d by yukang

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

parents 068949ac 091bf229
package com.baosight.hpjx.core.security; package com.baosight.hpjx.core.security;
import com.baosight.hpjx.hp.xs.domain.User; import com.baosight.hpjx.hp.xs.domain.User;
import com.baosight.hpjx.hp.xs.tools.HPXSUserTools;
import com.baosight.iplat4j.core.ei.EiConstant; import com.baosight.iplat4j.core.ei.EiConstant;
import com.baosight.iplat4j.core.ei.EiInfo; import com.baosight.iplat4j.core.ei.EiInfo;
import com.baosight.iplat4j.core.exception.PlatException; import com.baosight.iplat4j.core.exception.PlatException;
...@@ -19,6 +20,7 @@ import java.util.concurrent.ConcurrentMap; ...@@ -19,6 +20,7 @@ import java.util.concurrent.ConcurrentMap;
public class UserSessionUtils extends UserSession { public class UserSessionUtils extends UserSession {
private static ConcurrentMap companyMap = new ConcurrentHashMap(); private static ConcurrentMap companyMap = new ConcurrentHashMap();
private static ConcurrentMap depMap = new ConcurrentHashMap();
/** /**
* 获取用户信息 * 获取用户信息
...@@ -54,13 +56,35 @@ public class UserSessionUtils extends UserSession { ...@@ -54,13 +56,35 @@ public class UserSessionUtils extends UserSession {
*/ */
public static String getCompanyCode() { public static String getCompanyCode() {
String loginName = getLoginName(); String loginName = getLoginName();
if (loginName == null) {
return null;
}
String companyCode = MapUtils.getString(companyMap, loginName); String companyCode = MapUtils.getString(companyMap, loginName);
if (StringUtils.isBlank(companyCode)) { if (companyCode == null) {
companyCode = getUser().getCompanyCode(); User user = getUser();
companyCode = companyCode == null ? "" : companyCode; companyCode = user == null || user.getCompanyCode() == null ? "" : user.getCompanyCode();
companyMap.put(loginName, companyCode); companyMap.put(loginName, companyCode);
} }
return companyCode; return companyCode;
} }
/**
* 获取登录用户的部门编码
*
* @return
*/
public static String getDepCode() {
String loginName = getLoginName();
if (loginName == null) {
return null;
}
String depCode = MapUtils.getString(depMap, loginName);
if (depCode == null) {
depCode = HPXSUserTools.getOrgId();
depCode = depCode == null ? "" : depCode.trim();
depMap.put(loginName, depCode);
}
return depCode;
}
} }
...@@ -14,6 +14,8 @@ public class HPConstant { ...@@ -14,6 +14,8 @@ public class HPConstant {
*/ */
public class SequenceId { public class SequenceId {
//项目档案编号
public static final String PROJ_NUMBER = "PROJ_NUMBER";
// 盘点单号 // 盘点单号
public static final String STATISTICAL_NUMBER = "STATISTICAL_NUMBER"; public static final String STATISTICAL_NUMBER = "STATISTICAL_NUMBER";
// 统计单号 // 统计单号
...@@ -38,6 +40,8 @@ public class HPConstant { ...@@ -38,6 +40,8 @@ public class HPConstant {
public static final String WH_CODE = "WH_CODE"; public static final String WH_CODE = "WH_CODE";
// 其他入库单号 // 其他入库单号
public static final String OTHER_ENTER_NO = "OTHER_ENTER_NO"; public static final String OTHER_ENTER_NO = "OTHER_ENTER_NO";
// 其他出库单号
public static final String OTHER_OUTER_NO = "OTHER_OUTER_NO";
} }
/** /**
......
...@@ -21,6 +21,20 @@ public class HPSqlConstant { ...@@ -21,6 +21,20 @@ public class HPSqlConstant {
} }
/** /**
* HPKC007 SQL 定义
*
* @author:songx
* @date:2024/1/20,16:45
*/
public class HPKC007 {
// 查询
public static final String QUERY_SUM = "HPKC007.querySum";
// 锁
public static final String LOCK = "HPKC007.lock";
}
/**
* HPKC009 SQL 定义 * HPKC009 SQL 定义
* *
* @author:songx * @author:songx
...@@ -35,6 +49,18 @@ public class HPSqlConstant { ...@@ -35,6 +49,18 @@ public class HPSqlConstant {
} }
/** /**
* HPKC010 SQL 定义
*
* @author:songx
* @date:2024/1/20,16:45
*/
public class HPKC010 {
// 锁
public static final String LOCK = "HPKC010.lock";
}
/**
* HPPZ010 SQL 定义 * HPPZ010 SQL 定义
* *
* @author:songx * @author:songx
......
/**
* Generate time : 2024-01-10 14:03:35
* Version : 1.0
*/
package com.baosight.hpjx.hp.kc.domain; package com.baosight.hpjx.hp.kc.domain;
import com.baosight.iplat4j.core.util.NumberUtils; import com.baosight.iplat4j.core.util.NumberUtils;
import java.math.BigDecimal; import java.math.BigDecimal;
import com.baosight.iplat4j.core.util.DateUtils;
import java.sql.Timestamp;
import com.baosight.iplat4j.core.ei.EiColumn; import com.baosight.iplat4j.core.ei.EiColumn;
import com.baosight.iplat4j.core.data.DaoEPBase; import com.baosight.iplat4j.core.data.DaoEPBase;
import java.util.Date;
import java.util.HashMap; import java.util.HashMap;
import java.util.Map; import java.util.Map;
import com.baosight.iplat4j.core.util.StringUtils; import com.baosight.iplat4j.core.util.StringUtils;
/** /**
* THpkc007 * Project: <br>
* * Title:THpkc007.java <br>
*/ * Description: <br>
*
* Copyrigth:Baosight Software LTD.co Copyright (c) 2019. <br>
*
* @version 1.0
* @history 2024-01-24 15:34:45 create
*/
public class HPKC007 extends DaoEPBase { public class HPKC007 extends DaoEPBase {
private Integer id = 0; private static final long serialVersionUID = 1L;
private String companyCode = " "; /* 企业编码 预留*/
private String depCode = " "; /* 部门编码 预留*/ public static final String FIELD_ID = "id";
private Date receiptTime ; /* 单据日期*/ public static final String FIELD_COMPANY_CODE = "companyCode"; /* 企业编码 预留*/
private String otherEnthouse = " "; /* 其他入库单号*/ public static final String FIELD_DEP_CODE = "depCode"; /* 部门编码 预留*/
private String whCode = " "; /* 仓库编码*/ public static final String FIELD_RECEIPT_DATE = "receiptDate"; /* 单据日期*/
private String whName = " "; /* 仓库名称*/ public static final String FIELD_OTHER_OUTER_NO = "otherOuterNo"; /* 其他出库单号*/
private String matType = " "; /* 物料类型*/ public static final String FIELD_WH_CODE = "whCode"; /* 仓库编码*/
private String matCode = " "; /* 物料编码*/ public static final String FIELD_WH_NAME = "whName"; /* 仓库名称*/
private String matName = " "; /* 物料名称*/ public static final String FIELD_INVENT_TYPE = "inventType"; /* 物料类型*/
private BigDecimal amount = new BigDecimal("0"); /* 数量*/ public static final String FIELD_INVENT_CODE = "inventCode"; /* 物料编码*/
private BigDecimal weight = new BigDecimal("0"); /* 重量*/ public static final String FIELD_INVENT_NAME = "inventName"; /* 物料名称*/
private int status; /* 状态 0审核 1保存*/ public static final String FIELD_INVENT_RECORD_ID = "inventRecordId"; /* 规格ID*/
private String remark = " "; /* 备注*/ public static final String FIELD_AMOUNT = "amount"; /* 数量*/
/** public static final String FIELD_WEIGHT = "weight"; /* 重量*/
* initialize the metadata public static final String FIELD_STATUS = "status"; /* 状态 0审核 1保存*/
*/ public static final String FIELD_KC_ID = "kcId"; /* 库存ID*/
public void initMetaData() { public static final String FIELD_REMARK = "remark"; /* 备注*/
EiColumn eiColumn; public static final String FIELD_OLD_OUTER_NO = "oldOuterNo"; /* 原出库单号*/
public static final String FIELD_CREATED_BY = "createdBy"; /* 创建人*/
eiColumn = new EiColumn("id"); public static final String FIELD_CREATED_NAME = "createdName"; /* 创建人名称*/
eiColumn.setPrimaryKey(true); public static final String FIELD_CREATED_TIME = "createdTime"; /* 创建时间*/
eiColumn.setDescName(" "); public static final String FIELD_UPDATED_BY = "updatedBy"; /* 更新人*/
eiMetadata.addMeta(eiColumn); public static final String FIELD_UPDATED_NAME = "updatedName"; /* 更新人名称*/
public static final String FIELD_UPDATED_TIME = "updatedTime"; /* 更新时间*/
eiColumn = new EiColumn("companyCode"); public static final String FIELD_DELETE_FLAG = "deleteFlag"; /* 是否删除0.否1.是*/
eiColumn.setDescName("企业编码 预留");
eiMetadata.addMeta(eiColumn); public static final String COL_ID = "ID";
public static final String COL_COMPANY_CODE = "COMPANY_CODE"; /* 企业编码 预留*/
eiColumn = new EiColumn("depCode"); public static final String COL_DEP_CODE = "DEP_CODE"; /* 部门编码 预留*/
eiColumn.setDescName("部门编码 预留"); public static final String COL_RECEIPT_DATE = "RECEIPT_DATE"; /* 单据日期*/
eiMetadata.addMeta(eiColumn); public static final String COL_OTHER_OUTER_NO = "OTHER_OUTER_NO"; /* 其他出库单号*/
public static final String COL_WH_CODE = "WH_CODE"; /* 仓库编码*/
eiColumn = new EiColumn("receiptTime"); public static final String COL_WH_NAME = "WH_NAME"; /* 仓库名称*/
eiColumn.setDescName("单据日期"); public static final String COL_INVENT_TYPE = "INVENT_TYPE"; /* 物料类型*/
eiMetadata.addMeta(eiColumn); public static final String COL_INVENT_CODE = "INVENT_CODE"; /* 物料编码*/
public static final String COL_INVENT_NAME = "INVENT_NAME"; /* 物料名称*/
eiColumn = new EiColumn("otherEnthouse"); public static final String COL_INVENT_RECORD_ID = "INVENT_RECORD_ID"; /* 规格ID*/
eiColumn.setDescName("其他入库单号"); public static final String COL_AMOUNT = "AMOUNT"; /* 数量*/
eiMetadata.addMeta(eiColumn); public static final String COL_WEIGHT = "WEIGHT"; /* 重量*/
public static final String COL_STATUS = "STATUS"; /* 状态 0审核 1保存*/
eiColumn = new EiColumn("whCode"); public static final String COL_KC_ID = "KC_ID"; /* 库存ID*/
eiColumn.setDescName("仓库编码"); public static final String COL_REMARK = "REMARK"; /* 备注*/
eiMetadata.addMeta(eiColumn); public static final String COL_OLD_OUTER_NO = "OLD_OUTER_NO"; /* 原出库单号*/
public static final String COL_CREATED_BY = "CREATED_BY"; /* 创建人*/
eiColumn = new EiColumn("whName"); public static final String COL_CREATED_NAME = "CREATED_NAME"; /* 创建人名称*/
eiColumn.setDescName("仓库名称"); public static final String COL_CREATED_TIME = "CREATED_TIME"; /* 创建时间*/
eiMetadata.addMeta(eiColumn); public static final String COL_UPDATED_BY = "UPDATED_BY"; /* 更新人*/
public static final String COL_UPDATED_NAME = "UPDATED_NAME"; /* 更新人名称*/
eiColumn = new EiColumn("matType"); public static final String COL_UPDATED_TIME = "UPDATED_TIME"; /* 更新时间*/
eiColumn.setDescName("物料类型"); public static final String COL_DELETE_FLAG = "DELETE_FLAG"; /* 是否删除0.否1.是*/
eiMetadata.addMeta(eiColumn);
public static final String QUERY = "HPKC007.query";
eiColumn = new EiColumn("matCode"); public static final String COUNT = "HPKC007.count";
eiColumn.setDescName("物料编码"); public static final String INSERT = "HPKC007.insert";
eiMetadata.addMeta(eiColumn); public static final String UPDATE = "HPKC007.update";
public static final String DELETE = "HPKC007.delete";
eiColumn = new EiColumn("matName");
eiColumn.setDescName("物料名称"); private Integer id = null;
eiMetadata.addMeta(eiColumn); private String companyCode = " "; /* 企业编码 预留*/
private String depCode = " "; /* 部门编码 预留*/
eiColumn = new EiColumn("amount"); private String receiptDate = " "; /* 单据日期*/
eiColumn.setType("N"); private String otherOuterNo = " "; /* 其他出库单号*/
eiColumn.setScaleLength(2); private String whCode = " "; /* 仓库编码*/
eiColumn.setFieldLength(10); private String whName = " "; /* 仓库名称*/
eiColumn.setDescName("数量"); private String inventType = " "; /* 物料类型*/
eiMetadata.addMeta(eiColumn); private String inventCode = " "; /* 物料编码*/
private String inventName = " "; /* 物料名称*/
eiColumn = new EiColumn("weight"); private Long inventRecordId = null; /* 规格ID*/
eiColumn.setType("N"); private BigDecimal amount = new BigDecimal(0.00); /* 数量*/
eiColumn.setScaleLength(2); private BigDecimal weight = new BigDecimal(0.00); /* 重量*/
eiColumn.setFieldLength(10); private Integer status = 0; /* 状态 0审核 1保存*/
eiColumn.setDescName("重量"); private Long kcId = null; /* 库存ID*/
eiMetadata.addMeta(eiColumn); private String remark = " "; /* 备注*/
private String oldOuterNo = " "; /* 原出库单号*/
eiColumn = new EiColumn("status"); private String createdBy = " "; /* 创建人*/
eiColumn.setDescName("状态 0审核 1保存"); private String createdName = " "; /* 创建人名称*/
eiMetadata.addMeta(eiColumn); private String createdTime = " "; /* 创建时间*/
private String updatedBy = " "; /* 更新人*/
eiColumn = new EiColumn("remark"); private String updatedName = " "; /* 更新人名称*/
eiColumn.setDescName("备注"); private String updatedTime = " "; /* 更新时间*/
eiMetadata.addMeta(eiColumn); private Integer deleteFlag = 0; /* 是否删除0.否1.是*/
/**
} * initialize the metadata.
/** */
* the constructor public void initMetaData() {
*/ EiColumn eiColumn;
public HPKC007() {
initMetaData(); eiColumn = new EiColumn(FIELD_ID);
} eiColumn.setPrimaryKey(true);
eiColumn.setDescName(" ");
/** eiMetadata.addMeta(eiColumn);
* get the id
* @return the id eiColumn = new EiColumn(FIELD_COMPANY_CODE);
*/ eiColumn.setDescName("企业编码 预留");
public Integer getId() { eiMetadata.addMeta(eiColumn);
return this.id;
} eiColumn = new EiColumn(FIELD_DEP_CODE);
eiColumn.setDescName("部门编码 预留");
/** eiMetadata.addMeta(eiColumn);
* set the id
*/ eiColumn = new EiColumn(FIELD_RECEIPT_DATE);
public void setId(Integer id) { eiColumn.setDescName("单据日期");
this.id = id; eiMetadata.addMeta(eiColumn);
}
/** eiColumn = new EiColumn(FIELD_OTHER_OUTER_NO);
* get the companyCode - 企业编码 预留 eiColumn.setDescName("其他出库单号");
* @return the companyCode eiMetadata.addMeta(eiColumn);
*/
public String getCompanyCode() { eiColumn = new EiColumn(FIELD_WH_CODE);
return this.companyCode; eiColumn.setDescName("仓库编码");
} eiMetadata.addMeta(eiColumn);
/** eiColumn = new EiColumn(FIELD_WH_NAME);
* set the companyCode - 企业编码 预留 eiColumn.setDescName("仓库名称");
*/ eiMetadata.addMeta(eiColumn);
public void setCompanyCode(String companyCode) {
this.companyCode = companyCode; eiColumn = new EiColumn(FIELD_INVENT_TYPE);
} eiColumn.setDescName("物料类型");
/** eiMetadata.addMeta(eiColumn);
* get the depCode - 部门编码 预留
* @return the depCode eiColumn = new EiColumn(FIELD_INVENT_CODE);
*/ eiColumn.setDescName("物料编码");
public String getDepCode() { eiMetadata.addMeta(eiColumn);
return this.depCode;
} eiColumn = new EiColumn(FIELD_INVENT_NAME);
eiColumn.setDescName("物料名称");
/** eiMetadata.addMeta(eiColumn);
* set the depCode - 部门编码 预留
*/ eiColumn = new EiColumn(FIELD_INVENT_RECORD_ID);
public void setDepCode(String depCode) { eiColumn.setDescName("规格ID");
this.depCode = depCode; eiMetadata.addMeta(eiColumn);
}
/** eiColumn = new EiColumn(FIELD_AMOUNT);
* get the receiptTime - 单据日期 eiColumn.setType("N");
* @return the receiptTime eiColumn.setScaleLength(2);
*/ eiColumn.setFieldLength(10);
public Date getReceiptTime() { eiColumn.setDescName("数量");
return this.receiptTime; eiMetadata.addMeta(eiColumn);
}
eiColumn = new EiColumn(FIELD_WEIGHT);
/** eiColumn.setType("N");
* set the receiptTime - 单据日期 eiColumn.setScaleLength(2);
*/ eiColumn.setFieldLength(10);
public void setReceiptTime(Date receiptTime) { eiColumn.setDescName("重量");
this.receiptTime = receiptTime; eiMetadata.addMeta(eiColumn);
}
/** eiColumn = new EiColumn(FIELD_STATUS);
* get the otherEnthouse - 其他入库单号 eiColumn.setDescName("状态 0审核 1保存");
* @return the otherEnthouse eiMetadata.addMeta(eiColumn);
*/
public String getOtherEnthouse() { eiColumn = new EiColumn(FIELD_KC_ID);
return this.otherEnthouse; eiColumn.setDescName("库存ID");
} eiMetadata.addMeta(eiColumn);
/** eiColumn = new EiColumn(FIELD_REMARK);
* set the otherEnthouse - 其他入库单号 eiColumn.setDescName("备注");
*/ eiMetadata.addMeta(eiColumn);
public void setOtherEnthouse(String otherEnthouse) {
this.otherEnthouse = otherEnthouse; eiColumn = new EiColumn(FIELD_OLD_OUTER_NO);
} eiColumn.setDescName("原出库单号");
/** eiMetadata.addMeta(eiColumn);
* get the whCode - 仓库编码
* @return the whCode eiColumn = new EiColumn(FIELD_CREATED_BY);
*/ eiColumn.setDescName("创建人");
public String getWhCode() { eiMetadata.addMeta(eiColumn);
return this.whCode;
} eiColumn = new EiColumn(FIELD_CREATED_NAME);
eiColumn.setDescName("创建人名称");
/** eiMetadata.addMeta(eiColumn);
* set the whCode - 仓库编码
*/ eiColumn = new EiColumn(FIELD_CREATED_TIME);
public void setWhCode(String whCode) { eiColumn.setDescName("创建时间");
this.whCode = whCode; eiMetadata.addMeta(eiColumn);
}
/** eiColumn = new EiColumn(FIELD_UPDATED_BY);
* get the whName - 仓库名称 eiColumn.setDescName("更新人");
* @return the whName eiMetadata.addMeta(eiColumn);
*/
public String getWhName() { eiColumn = new EiColumn(FIELD_UPDATED_NAME);
return this.whName; eiColumn.setDescName("更新人名称");
} eiMetadata.addMeta(eiColumn);
/** eiColumn = new EiColumn(FIELD_UPDATED_TIME);
* set the whName - 仓库名称 eiColumn.setDescName("更新时间");
*/ eiMetadata.addMeta(eiColumn);
public void setWhName(String whName) {
this.whName = whName; eiColumn = new EiColumn(FIELD_DELETE_FLAG);
} eiColumn.setDescName("是否删除0.否1.是");
/** eiMetadata.addMeta(eiColumn);
* get the matType - 物料类型
* @return the matType
*/ }
public String getMatType() {
return this.matType; /**
} * the constructor.
*/
/** public HPKC007() {
* set the matType - 物料类型 initMetaData();
*/ }
public void setMatType(String matType) {
this.matType = matType; /**
} * get the id .
/** * @return the id
* get the matCode - 物料编码 */
* @return the matCode public Integer getId() {
*/ return this.id;
public String getMatCode() { }
return this.matCode;
} /**
* set the id .
/** *
* set the matCode - 物料编码 * @param id
*/ */
public void setMatCode(String matCode) { public void setId(Integer id) {
this.matCode = matCode; this.id = id;
} }
/** /**
* get the matName - 物料名称 * get the companyCode - 企业编码 预留.
* @return the matName * @return the companyCode
*/ */
public String getMatName() { public String getCompanyCode() {
return this.matName; return this.companyCode;
} }
/** /**
* set the matName - 物料名称 * set the companyCode - 企业编码 预留.
*/ *
public void setMatName(String matName) { * @param companyCode - 企业编码 预留
this.matName = matName; */
} public void setCompanyCode(String companyCode) {
/** this.companyCode = companyCode;
* get the amount - 数量 }
* @return the amount /**
*/ * get the depCode - 部门编码 预留.
public BigDecimal getAmount() { * @return the depCode
return this.amount; */
} public String getDepCode() {
return this.depCode;
/** }
* set the amount - 数量
*/ /**
public void setAmount(BigDecimal amount) { * set the depCode - 部门编码 预留.
this.amount = amount; *
} * @param depCode - 部门编码 预留
/** */
* get the weight - 重量 public void setDepCode(String depCode) {
* @return the weight this.depCode = depCode;
*/ }
public BigDecimal getWeight() { /**
return this.weight; * get the receiptDate - 单据日期.
} * @return the receiptDate
*/
/** public String getReceiptDate() {
* set the weight - 重量 return this.receiptDate;
*/ }
public void setWeight(BigDecimal weight) {
this.weight = weight; /**
} * set the receiptDate - 单据日期.
/** *
* get the status - 状态 0审核 1保存 * @param receiptDate - 单据日期
* @return the status */
*/ public void setReceiptDate(String receiptDate) {
public int getStatus() { this.receiptDate = receiptDate;
return this.status; }
} /**
* get the otherOuterNo - 其他出库单号.
/** * @return the otherOuterNo
* set the status - 状态 0审核 1保存 */
*/ public String getOtherOuterNo() {
public void setStatus(int status) { return this.otherOuterNo;
this.status = status; }
}
/** /**
* get the remark - 备注 * set the otherOuterNo - 其他出库单号.
* @return the remark *
*/ * @param otherOuterNo - 其他出库单号
public String getRemark() { */
return this.remark; public void setOtherOuterNo(String otherOuterNo) {
} this.otherOuterNo = otherOuterNo;
}
/** /**
* set the remark - 备注 * get the whCode - 仓库编码.
*/ * @return the whCode
public void setRemark(String remark) { */
this.remark = remark; public String getWhCode() {
} return this.whCode;
/** }
* get the value from Map
*/ /**
public void fromMap(Map map) { * set the whCode - 仓库编码.
*
setId(NumberUtils.toInteger(StringUtils.toString(map.get("id")), id)); * @param whCode - 仓库编码
setCompanyCode(StringUtils.defaultIfEmpty(StringUtils.toString(map.get("companyCode")), companyCode)); */
setDepCode(StringUtils.defaultIfEmpty(StringUtils.toString(map.get("depCode")), depCode)); public void setWhCode(String whCode) {
this.whCode = whCode;
setReceiptTime(DateUtils.toDate(StringUtils.toString(map.get("receiptTime")))); }
/**
setOtherEnthouse(StringUtils.defaultIfEmpty(StringUtils.toString(map.get("otherEnthouse")), otherEnthouse)); * get the whName - 仓库名称.
setWhCode(StringUtils.defaultIfEmpty(StringUtils.toString(map.get("whCode")), whCode)); * @return the whName
setWhName(StringUtils.defaultIfEmpty(StringUtils.toString(map.get("whName")), whName)); */
setMatType(StringUtils.defaultIfEmpty(StringUtils.toString(map.get("matType")), matType)); public String getWhName() {
setMatCode(StringUtils.defaultIfEmpty(StringUtils.toString(map.get("matCode")), matCode)); return this.whName;
setMatName(StringUtils.defaultIfEmpty(StringUtils.toString(map.get("matName")), matName)); }
setAmount(NumberUtils.toBigDecimal(StringUtils.toString(map.get("amount")), amount));
setWeight(NumberUtils.toBigDecimal(StringUtils.toString(map.get("weight")), weight)); /**
setStatus(NumberUtils.toint(StringUtils.toString(map.get("status")), status)); * set the whName - 仓库名称.
setRemark(StringUtils.defaultIfEmpty(StringUtils.toString(map.get("remark")), remark)); *
} * @param whName - 仓库名称
*/
/** public void setWhName(String whName) {
* set the value to Map this.whName = whName;
*/ }
public Map toMap() { /**
* get the inventType - 物料类型.
Map map = new HashMap(); * @return the inventType
map.put("id",StringUtils.toString(id, eiMetadata.getMeta("id"))); */
map.put("companyCode",StringUtils.toString(companyCode, eiMetadata.getMeta("companyCode"))); public String getInventType() {
map.put("depCode",StringUtils.toString(depCode, eiMetadata.getMeta("depCode"))); return this.inventType;
map.put("receiptTime",StringUtils.toString(receiptTime, eiMetadata.getMeta("receiptTime"))); }
map.put("otherEnthouse",StringUtils.toString(otherEnthouse, eiMetadata.getMeta("otherEnthouse")));
map.put("whCode",StringUtils.toString(whCode, eiMetadata.getMeta("whCode"))); /**
map.put("whName",StringUtils.toString(whName, eiMetadata.getMeta("whName"))); * set the inventType - 物料类型.
map.put("matType",StringUtils.toString(matType, eiMetadata.getMeta("matType"))); *
map.put("matCode",StringUtils.toString(matCode, eiMetadata.getMeta("matCode"))); * @param inventType - 物料类型
map.put("matName",StringUtils.toString(matName, eiMetadata.getMeta("matName"))); */
map.put("amount",StringUtils.toString(amount, eiMetadata.getMeta("amount"))); public void setInventType(String inventType) {
map.put("weight",StringUtils.toString(weight, eiMetadata.getMeta("weight"))); this.inventType = inventType;
map.put("status",StringUtils.toString(status, eiMetadata.getMeta("status"))); }
map.put("remark",StringUtils.toString(remark, eiMetadata.getMeta("remark"))); /**
* get the inventCode - 物料编码.
return map; * @return the inventCode
*/
public String getInventCode() {
return this.inventCode;
}
/**
* set the inventCode - 物料编码.
*
* @param inventCode - 物料编码
*/
public void setInventCode(String inventCode) {
this.inventCode = inventCode;
}
/**
* get the inventName - 物料名称.
* @return the inventName
*/
public String getInventName() {
return this.inventName;
}
/**
* set the inventName - 物料名称.
*
* @param inventName - 物料名称
*/
public void setInventName(String inventName) {
this.inventName = inventName;
}
/**
* get the inventRecordId - 规格ID.
* @return the inventRecordId
*/
public Long getInventRecordId() {
return this.inventRecordId;
}
/**
* set the inventRecordId - 规格ID.
*
* @param inventRecordId - 规格ID
*/
public void setInventRecordId(Long inventRecordId) {
this.inventRecordId = inventRecordId;
}
/**
* get the amount - 数量.
* @return the amount
*/
public BigDecimal getAmount() {
return this.amount;
}
/**
* set the amount - 数量.
*
* @param amount - 数量
*/
public void setAmount(BigDecimal amount) {
this.amount = amount;
}
/**
* get the weight - 重量.
* @return the weight
*/
public BigDecimal getWeight() {
return this.weight;
}
/**
* set the weight - 重量.
*
* @param weight - 重量
*/
public void setWeight(BigDecimal weight) {
this.weight = weight;
}
/**
* get the status - 状态 0审核 1保存.
* @return the status
*/
public Integer getStatus() {
return this.status;
}
/**
* set the status - 状态 0审核 1保存.
*
* @param status - 状态 0审核 1保存
*/
public void setStatus(Integer status) {
this.status = status;
}
/**
* get the kcId - 库存ID.
* @return the kcId
*/
public Long getKcId() {
return this.kcId;
}
/**
* set the kcId - 库存ID.
*
* @param kcId - 库存ID
*/
public void setKcId(Long kcId) {
this.kcId = kcId;
}
/**
* get the remark - 备注.
* @return the remark
*/
public String getRemark() {
return this.remark;
}
/**
* set the remark - 备注.
*
* @param remark - 备注
*/
public void setRemark(String remark) {
this.remark = remark;
}
/**
* get the oldOuterNo - 原出库单号.
* @return the oldOuterNo
*/
public String getOldOuterNo() {
return this.oldOuterNo;
}
/**
* set the oldOuterNo - 原出库单号.
*
* @param oldOuterNo - 原出库单号
*/
public void setOldOuterNo(String oldOuterNo) {
this.oldOuterNo = oldOuterNo;
}
/**
* get the createdBy - 创建人.
* @return the createdBy
*/
public String getCreatedBy() {
return this.createdBy;
}
/**
* set the createdBy - 创建人.
*
* @param createdBy - 创建人
*/
public void setCreatedBy(String createdBy) {
this.createdBy = createdBy;
}
/**
* get the createdName - 创建人名称.
* @return the createdName
*/
public String getCreatedName() {
return this.createdName;
}
/**
* set the createdName - 创建人名称.
*
* @param createdName - 创建人名称
*/
public void setCreatedName(String createdName) {
this.createdName = createdName;
}
/**
* get the createdTime - 创建时间.
* @return the createdTime
*/
public String getCreatedTime() {
return this.createdTime;
}
/**
* set the createdTime - 创建时间.
*
* @param createdTime - 创建时间
*/
public void setCreatedTime(String createdTime) {
this.createdTime = createdTime;
}
/**
* get the updatedBy - 更新人.
* @return the updatedBy
*/
public String getUpdatedBy() {
return this.updatedBy;
}
/**
* set the updatedBy - 更新人.
*
* @param updatedBy - 更新人
*/
public void setUpdatedBy(String updatedBy) {
this.updatedBy = updatedBy;
}
/**
* get the updatedName - 更新人名称.
* @return the updatedName
*/
public String getUpdatedName() {
return this.updatedName;
}
/**
* set the updatedName - 更新人名称.
*
* @param updatedName - 更新人名称
*/
public void setUpdatedName(String updatedName) {
this.updatedName = updatedName;
}
/**
* get the updatedTime - 更新时间.
* @return the updatedTime
*/
public String getUpdatedTime() {
return this.updatedTime;
}
/**
* set the updatedTime - 更新时间.
*
* @param updatedTime - 更新时间
*/
public void setUpdatedTime(String updatedTime) {
this.updatedTime = updatedTime;
}
/**
* get the deleteFlag - 是否删除0.否1.是.
* @return the deleteFlag
*/
public Integer getDeleteFlag() {
return this.deleteFlag;
}
/**
* set the deleteFlag - 是否删除0.否1.是.
*
* @param deleteFlag - 是否删除0.否1.是
*/
public void setDeleteFlag(Integer deleteFlag) {
this.deleteFlag = deleteFlag;
}
/**
* get the value from Map.
*
* @param map - source data map
*/
@Override
public void fromMap(Map map) {
setId(NumberUtils.toInteger(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));
setOtherOuterNo(StringUtils.defaultIfEmpty(StringUtils.toString(map.get(FIELD_OTHER_OUTER_NO)), otherOuterNo));
setWhCode(StringUtils.defaultIfEmpty(StringUtils.toString(map.get(FIELD_WH_CODE)), whCode));
setWhName(StringUtils.defaultIfEmpty(StringUtils.toString(map.get(FIELD_WH_NAME)), whName));
setInventType(StringUtils.defaultIfEmpty(StringUtils.toString(map.get(FIELD_INVENT_TYPE)), inventType));
setInventCode(StringUtils.defaultIfEmpty(StringUtils.toString(map.get(FIELD_INVENT_CODE)), inventCode));
setInventName(StringUtils.defaultIfEmpty(StringUtils.toString(map.get(FIELD_INVENT_NAME)), inventName));
setInventRecordId(NumberUtils.toLong(StringUtils.toString(map.get(FIELD_INVENT_RECORD_ID)), inventRecordId));
setAmount(NumberUtils.toBigDecimal(StringUtils.toString(map.get(FIELD_AMOUNT)), amount));
setWeight(NumberUtils.toBigDecimal(StringUtils.toString(map.get(FIELD_WEIGHT)), weight));
setStatus(NumberUtils.toInteger(StringUtils.toString(map.get(FIELD_STATUS)), status));
setKcId(NumberUtils.toLong(StringUtils.toString(map.get(FIELD_KC_ID)), kcId));
setRemark(StringUtils.defaultIfEmpty(StringUtils.toString(map.get(FIELD_REMARK)), remark));
setOldOuterNo(StringUtils.defaultIfEmpty(StringUtils.toString(map.get(FIELD_OLD_OUTER_NO)), oldOuterNo));
setCreatedBy(StringUtils.defaultIfEmpty(StringUtils.toString(map.get(FIELD_CREATED_BY)), createdBy));
setCreatedName(StringUtils.defaultIfEmpty(StringUtils.toString(map.get(FIELD_CREATED_NAME)), createdName));
setCreatedTime(StringUtils.defaultIfEmpty(StringUtils.toString(map.get(FIELD_CREATED_TIME)), createdTime));
setUpdatedBy(StringUtils.defaultIfEmpty(StringUtils.toString(map.get(FIELD_UPDATED_BY)), updatedBy));
setUpdatedName(StringUtils.defaultIfEmpty(StringUtils.toString(map.get(FIELD_UPDATED_NAME)), updatedName));
setUpdatedTime(StringUtils.defaultIfEmpty(StringUtils.toString(map.get(FIELD_UPDATED_TIME)), updatedTime));
setDeleteFlag(NumberUtils.toInteger(StringUtils.toString(map.get(FIELD_DELETE_FLAG)), deleteFlag));
}
/**
* set the value to Map.
*/
@Override
public Map toMap() {
Map map = new HashMap();
map.put(FIELD_ID, StringUtils.toString(id, eiMetadata.getMeta(FIELD_ID)));
map.put(FIELD_COMPANY_CODE, StringUtils.toString(companyCode, eiMetadata.getMeta(FIELD_COMPANY_CODE)));
map.put(FIELD_DEP_CODE, StringUtils.toString(depCode, eiMetadata.getMeta(FIELD_DEP_CODE)));
map.put(FIELD_RECEIPT_DATE, StringUtils.toString(receiptDate, eiMetadata.getMeta(FIELD_RECEIPT_DATE)));
map.put(FIELD_OTHER_OUTER_NO, StringUtils.toString(otherOuterNo, eiMetadata.getMeta(FIELD_OTHER_OUTER_NO)));
map.put(FIELD_WH_CODE, StringUtils.toString(whCode, eiMetadata.getMeta(FIELD_WH_CODE)));
map.put(FIELD_WH_NAME, StringUtils.toString(whName, eiMetadata.getMeta(FIELD_WH_NAME)));
map.put(FIELD_INVENT_TYPE, StringUtils.toString(inventType, eiMetadata.getMeta(FIELD_INVENT_TYPE)));
map.put(FIELD_INVENT_CODE, StringUtils.toString(inventCode, eiMetadata.getMeta(FIELD_INVENT_CODE)));
map.put(FIELD_INVENT_NAME, StringUtils.toString(inventName, eiMetadata.getMeta(FIELD_INVENT_NAME)));
map.put(FIELD_INVENT_RECORD_ID, StringUtils.toString(inventRecordId, eiMetadata.getMeta(FIELD_INVENT_RECORD_ID)));
map.put(FIELD_AMOUNT, StringUtils.toString(amount, eiMetadata.getMeta(FIELD_AMOUNT)));
map.put(FIELD_WEIGHT, StringUtils.toString(weight, eiMetadata.getMeta(FIELD_WEIGHT)));
map.put(FIELD_STATUS, StringUtils.toString(status, eiMetadata.getMeta(FIELD_STATUS)));
map.put(FIELD_KC_ID, StringUtils.toString(kcId, eiMetadata.getMeta(FIELD_KC_ID)));
map.put(FIELD_REMARK, StringUtils.toString(remark, eiMetadata.getMeta(FIELD_REMARK)));
map.put(FIELD_OLD_OUTER_NO, StringUtils.toString(oldOuterNo, eiMetadata.getMeta(FIELD_OLD_OUTER_NO)));
map.put(FIELD_CREATED_BY, StringUtils.toString(createdBy, eiMetadata.getMeta(FIELD_CREATED_BY)));
map.put(FIELD_CREATED_NAME, StringUtils.toString(createdName, eiMetadata.getMeta(FIELD_CREATED_NAME)));
map.put(FIELD_CREATED_TIME, StringUtils.toString(createdTime, eiMetadata.getMeta(FIELD_CREATED_TIME)));
map.put(FIELD_UPDATED_BY, StringUtils.toString(updatedBy, eiMetadata.getMeta(FIELD_UPDATED_BY)));
map.put(FIELD_UPDATED_NAME, StringUtils.toString(updatedName, eiMetadata.getMeta(FIELD_UPDATED_NAME)));
map.put(FIELD_UPDATED_TIME, StringUtils.toString(updatedTime, eiMetadata.getMeta(FIELD_UPDATED_TIME)));
map.put(FIELD_DELETE_FLAG, StringUtils.toString(deleteFlag, eiMetadata.getMeta(FIELD_DELETE_FLAG)));
return map;
}
} }
}
\ No newline at end of file
...@@ -197,8 +197,8 @@ public class ServiceHPKC006 extends ServiceBase { ...@@ -197,8 +197,8 @@ public class ServiceHPKC006 extends ServiceBase {
DaoUtils.update(HPKC006.DELETE, fKc006); DaoUtils.update(HPKC006.DELETE, fKc006);
// 修改库存 // 修改库存
HPKC006 dbKc006 = mapKc006.get(fKc006.getOtherEnterNo()); HPKC006 dbKc006 = mapKc006.get(fKc006.getOtherEnterNo());
HPKCTools.updateStock(dbKc006.getWhCode(), dbKc006.getInventRecordId(), dbKc006.getAmount(), HPKCTools.updateStock(dbKc006.getWhCode(), dbKc006.getInventRecordId(), dbKc006.getAmount().negate(),
dbKc006.getWeight()); dbKc006.getWeight().negate());
} }
inInfo = this.query(inInfo); inInfo = this.query(inInfo);
inInfo.setStatus(EiConstant.STATUS_DEFAULT); inInfo.setStatus(EiConstant.STATUS_DEFAULT);
......
package com.baosight.hpjx.hp.kc.service; package com.baosight.hpjx.hp.kc.service;
import com.baosight.hpjx.common.DdynamicEnum;
import com.baosight.hpjx.core.constant.CommonConstant;
import com.baosight.hpjx.core.dao.DaoUtils;
import com.baosight.hpjx.hp.constant.HPConstant;
import com.baosight.hpjx.hp.constant.HPSqlConstant;
import com.baosight.hpjx.hp.kc.domain.HPKC006;
import com.baosight.hpjx.hp.kc.domain.HPKC007; import com.baosight.hpjx.hp.kc.domain.HPKC007;
import com.baosight.hpjx.hp.kc.tools.HPKCTools;
import com.baosight.hpjx.hp.pz.tools.HPPZTools;
import com.baosight.hpjx.util.AssertUtils;
import com.baosight.hpjx.util.BeanUtils;
import com.baosight.hpjx.util.CommonMethod;
import com.baosight.hpjx.util.EiInfoUtils;
import com.baosight.hpjx.util.LogUtils; import com.baosight.hpjx.util.LogUtils;
import com.baosight.hpjx.util.ObjectUtils;
import com.baosight.hpjx.util.StringUtil;
import com.baosight.iplat4j.core.ei.EiBlock; import com.baosight.iplat4j.core.ei.EiBlock;
import com.baosight.iplat4j.core.ei.EiConstant; import com.baosight.iplat4j.core.ei.EiConstant;
import com.baosight.iplat4j.core.ei.EiInfo; import com.baosight.iplat4j.core.ei.EiInfo;
import com.baosight.iplat4j.core.exception.PlatException; import com.baosight.iplat4j.core.exception.PlatException;
import com.baosight.iplat4j.core.service.impl.ServiceBase; import com.baosight.iplat4j.core.service.impl.ServiceBase;
import com.baosight.iplat4j.ed.util.SequenceGenerator;
import org.apache.commons.collections.MapUtils;
import java.math.BigDecimal;
import java.text.SimpleDateFormat; import java.text.SimpleDateFormat;
import java.util.Arrays;
import java.util.List;
import java.util.Map; import java.util.Map;
/** /**
...@@ -27,6 +47,10 @@ public class ServiceHPKC007 extends ServiceBase { ...@@ -27,6 +47,10 @@ public class ServiceHPKC007 extends ServiceBase {
*/ */
public EiInfo initLoad(EiInfo inInfo) { public EiInfo initLoad(EiInfo inInfo) {
try { try {
CommonMethod.initBlock(inInfo, Arrays.asList(DdynamicEnum.WH_RECORD_BLOCK_ID), null);
CommonMethod.initBlock(inInfo, Arrays.asList(DdynamicEnum.INVENT_NAME_BLOCK_ID), null);
CommonMethod.initBlock(inInfo, Arrays.asList(DdynamicEnum.INVENT_SPEC_BLOCK_ID), null, false);
CommonMethod.initBlock(inInfo, Arrays.asList(DdynamicEnum.SPEC_NAME_BLOCK_ID), null, false);
inInfo.addBlock(EiConstant.resultBlock).addBlockMeta(new HPKC007().eiMetadata); inInfo.addBlock(EiConstant.resultBlock).addBlockMeta(new HPKC007().eiMetadata);
} catch (PlatException e) { } catch (PlatException e) {
LogUtils.setDetailMsg(inInfo, e, "初始化失败"); LogUtils.setDetailMsg(inInfo, e, "初始化失败");
...@@ -35,96 +59,170 @@ public class ServiceHPKC007 extends ServiceBase { ...@@ -35,96 +59,170 @@ public class ServiceHPKC007 extends ServiceBase {
} }
/** /**
* 查询操作. * 查询操作
*
* @param inInfo
* @return
*/ */
@Override @Override
public EiInfo query(EiInfo inInfo) { public EiInfo query(EiInfo inInfo) {
/* 调用EI查询方法.*/ try {
EiInfo outInfo = super.query(inInfo, "HPKC007.query", new HPKC007()); Map queryRow = EiInfoUtils.getFirstRow(inInfo);
return outInfo; String receiptDate = MapUtils.getString(queryRow, "receiptDate");
queryRow.put("receiptDate", StringUtil.removeSpecifiedCharacter(receiptDate,
StringUtil.DEFAULT_CHARACTER_TO_BE_REMOVED));
inInfo = super.query(inInfo, HPKC007.QUERY, new HPKC007());
List sum = dao.query(HPSqlConstant.HPKC007.QUERY_SUM, queryRow);
inInfo.getBlock(EiConstant.resultBlock).set(EiConstant.COLUMN_TOTAL_SUM, sum.get(0));
} catch (Exception e) {
LogUtils.setDetailMsg(inInfo, e, "查询失败");
}
return inInfo;
} }
/** /**
* 新增操作. * 新增操作
* @param inInfo
* @return
*/ */
@Override @Override
public EiInfo insert(EiInfo inInfo) { public EiInfo insert(EiInfo inInfo) {
SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss");
try { try {
HPKC007 hpkc007 = new HPKC007(); List<Map> resultRows = inInfo.getBlock(EiConstant.resultBlock).getRows();
EiBlock eiBlock = inInfo.getBlock(EiConstant.resultBlock); // 数据校验
this.checkSaveData(resultRows);
// 数据写入
for (int i = 0; i < eiBlock.getRowCount(); i++) { for (int i = 0; i < resultRows.size(); i++) {
Map<?, ?> map = eiBlock.getRow(i); HPKC007 fKc007 = new HPKC007();
hpkc007.fromMap(map); fKc007.fromMap(resultRows.get(i));
// 设置基础信息
this.dao.insert("HPKC007.insert", hpkc007.toMap()); this.setBaseInfo(fKc007);
// 生成出库单号
fKc007.setOtherOuterNo(SequenceGenerator.getNextSequence(HPConstant.SequenceId.OTHER_OUTER_NO));
DaoUtils.insert(HPKC007.INSERT, fKc007);
// 修改库存
HPKCTools.updateStock(fKc007.getWhCode(), fKc007.getInventRecordId(), fKc007.getAmount().negate(),
fKc007.getWeight().negate());
} }
inInfo.setStatus(EiConstant.STATUS_SUCCESS); inInfo = this.query(inInfo);
inInfo.setMsg("新增成功!"); inInfo.setStatus(EiConstant.STATUS_DEFAULT);
inInfo.setMsg("操作成功!本次对[" + resultRows.size() + "]条数据新增成功!");
} catch (PlatException e) { } catch (Exception e) {
e.printStackTrace(); LogUtils.setDetailMsg(inInfo, e, "新增失败");
inInfo.setStatus(EiConstant.STATUS_FAILURE);
inInfo.setMsg("新增失败!原因参见详细错误描述!");
inInfo.setDetailMsg(e.getMessage());
logError("新增失败", e.getMessage());
return inInfo;
} }
return inInfo; return inInfo;
} }
/** /**
* 修改操作. * 修改操作
*
* @param inInfo
* @return
*/ */
public EiInfo update(EiInfo inInfo) { public EiInfo update(EiInfo inInfo) {
SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss");
try { try {
HPKC007 hpkc007 = new HPKC007(); List<Map> resultRows = inInfo.getBlock(EiConstant.resultBlock).getRows();
EiBlock eiBlock = inInfo.getBlock(EiConstant.resultBlock); // 数据校验
for (int i = 0; i < eiBlock.getRowCount(); i++) { this.checkSaveData(resultRows);
Map<?, ?> map = eiBlock.getRow(i); // 入库单号
hpkc007.fromMap(map); List<String> otherOuterNos = ObjectUtils.listKey(resultRows, "otherOuterNo");
// 锁记录
this.dao.update("HPKC007.update", hpkc007.toMap()); HPKCTools.lockKc007(otherOuterNos);
// 查询数据库记录
Map<String, HPKC007> mapKc007 = HPKCTools.mapKc007(otherOuterNos);
for (int i = 0; i < resultRows.size(); i++) {
HPKC007 fKc007 = new HPKC007();
fKc007.fromMap(resultRows.get(i));
// 设置基础信息
this.setBaseInfo(fKc007);
DaoUtils.update(HPKC007.UPDATE, fKc007);
// 计算差异数量与重量
HPKC007 dbKc007 = mapKc007.get(fKc007.getOtherOuterNo());
BigDecimal diffAmount = fKc007.getAmount().subtract(dbKc007.getAmount());
BigDecimal diffWeight = fKc007.getWeight().subtract(dbKc007.getWeight());
// 修改库存
HPKCTools.updateStock(fKc007.getWhCode(), fKc007.getInventRecordId(), diffAmount.negate(),
diffWeight.negate());
} }
inInfo = this.query(inInfo);
inInfo.setStatus(EiConstant.STATUS_SUCCESS); inInfo.setStatus(EiConstant.STATUS_SUCCESS);
inInfo.setMsg("修改成功!"); inInfo.setMsg("操作成功!本次对[" + resultRows.size() + "]条数据修改成功!");
} catch (PlatException e) { } catch (PlatException e) {
inInfo.setStatus(EiConstant.STATUS_FAILURE); LogUtils.setDetailMsg(inInfo, e, "修改失败");
inInfo.setMsg("操作失败!原因参见详细错误描述!"); }
inInfo.setDetailMsg(e.getMessage()); return inInfo;
logError("修改失败", e.getMessage()); }
return inInfo;
/**
* 校验保存的数据
*
* @param resultRows
*/
private void checkSaveData(List<Map> resultRows) {
for (int i = 0; i < resultRows.size(); i++) {
HPKC007 fKc007 = new HPKC007();
fKc007.fromMap(resultRows.get(i));
AssertUtils.isEmpty(fKc007.getWhCode(), "仓库名称不能为空");
AssertUtils.isNull(fKc007.getInventCode(), "存货名称不能为空");
AssertUtils.isNull(fKc007.getInventRecordId(), "规格不能为空");
AssertUtils.isGt(BigDecimal.ZERO, fKc007.getAmount(), "数量必须大于0");
AssertUtils.isGt(BigDecimal.ZERO, fKc007.getWeight(), "重量必须大于0");
} }
return query(inInfo);
} }
/** /**
* 删除操作. * 设置基础信息
*
* @param fKc007
*/
private void setBaseInfo(HPKC007 fKc007) {
// 去除日期字符串中的-
fKc007.setReceiptDate(StringUtil.removeHorizontalLine(fKc007.getReceiptDate()));
// 仓库名称
fKc007.setWhName(HPPZTools.getPz007ByCode(fKc007.getWhCode()).getWhName());
// 物料名称
fKc007.setInventName(HPPZTools.getPz004ByCode(fKc007.getInventCode()).getInventName());
}
/**
* 删除操作
*
* @param inInfo
* @return
*/ */
public EiInfo delete(EiInfo eiInfo) { public EiInfo delete(EiInfo inInfo) {
HPKC007 hpkc007 = new HPKC007();
EiBlock eiBlock = eiInfo.getBlock(EiConstant.resultBlock);
try { try {
for (int i = 0; i < eiBlock.getRowCount(); i++) { List<Map> resultRows = inInfo.getBlock(EiConstant.resultBlock).getRows();
Map<?, ?> map = eiBlock.getRow(i); // 出库单号
hpkc007.fromMap(map); List<String> otherOuterNos = ObjectUtils.listKey(resultRows, "otherOuterNo");
// 锁记录
this.dao.delete("HPKC007.delete", hpkc007.toMap()); HPKCTools.lockKc007(otherOuterNos);
// 查询数据库记录
Map<String, HPKC007> mapKc007 = HPKCTools.mapKc007(otherOuterNos);
for (int i = 0; i < resultRows.size(); i++) {
HPKC007 fKc007 = new HPKC007();
fKc007.fromMap(resultRows.get(i));
DaoUtils.update(HPKC007.DELETE, fKc007);
// 生成红冲记录
HPKC007 dbKc007 = mapKc007.get(fKc007.getOtherOuterNo());
HPKC007 newKc007 = BeanUtils.copy(dbKc007, HPKC007.class);
newKc007.setOtherOuterNo(SequenceGenerator.getNextSequence(HPConstant.SequenceId.OTHER_OUTER_NO));
newKc007.setAmount(newKc007.getAmount().negate());
newKc007.setWeight(newKc007.getWeight().negate());
newKc007.setOldOuterNo(dbKc007.getOtherOuterNo());
newKc007.setDeleteFlag(CommonConstant.YesNo.YES_1);
DaoUtils.insert(HPKC007.INSERT, newKc007);
// 修改库存
HPKCTools.updateStock(dbKc007.getWhCode(), dbKc007.getInventRecordId(), dbKc007.getAmount(),
dbKc007.getWeight());
} }
} catch (PlatException e) { inInfo = this.query(inInfo);
eiInfo.setStatus(EiConstant.STATUS_FAILURE); inInfo.setStatus(EiConstant.STATUS_DEFAULT);
eiInfo.setMsg("删除失败,原因参见详细错误描述!"); inInfo.setMsg("操作成功!本次对[" + resultRows.size() + "]条数据删除成功!");
eiInfo.setDetailMsg(e.getMessage()); } catch (Exception e) {
logError("删除失败!", e.getMessage()); LogUtils.setDetailMsg(inInfo, e, "删除失败");
return eiInfo;
} }
return inInfo;
eiInfo.setStatus(EiConstant.STATUS_SUCCESS);
eiInfo.setMsg("删除成功!");
return eiInfo;
} }
} }
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.HPKC007;
import com.baosight.hpjx.hp.kc.domain.HPKC010;
import com.baosight.hpjx.hp.kc.tools.HPKCTools;
import com.baosight.hpjx.util.AssertUtils;
import com.baosight.hpjx.util.BeanUtils;
import com.baosight.hpjx.util.CommonMethod;
import com.baosight.hpjx.util.DateUtils;
import com.baosight.hpjx.util.EiInfoUtils;
import com.baosight.hpjx.util.LogUtils;
import com.baosight.hpjx.util.MapUtils;
import com.baosight.hpjx.util.ObjectUtils;
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.ServiceEPBase;
import com.baosight.iplat4j.core.web.threadlocal.UserSession;
import com.baosight.iplat4j.ed.util.SequenceGenerator;
import java.math.BigDecimal;
import java.util.Arrays;
import java.util.List;
import java.util.Map;
import java.util.stream.Collectors;
/**
* 其他出库单挑选库存
*
* @author:songx
* @date:2022/7/11,11:08
*/
public class ServiceHPKC007A extends ServiceEPBase {
/**
* 初始化
*
* @param inInfo
* @return
*/
@Override
public EiInfo initLoad(EiInfo inInfo) {
try {
CommonMethod.initBlock(inInfo, Arrays.asList(DdynamicEnum.WH_RECORD_BLOCK_ID), null);
CommonMethod.initBlock(inInfo, Arrays.asList(DdynamicEnum.INVENT_NAME_BLOCK_ID), null);
CommonMethod.initBlock(inInfo, Arrays.asList(DdynamicEnum.INVENT_SPEC_BLOCK_ID), null, false);
CommonMethod.initBlock(inInfo, Arrays.asList(DdynamicEnum.SPEC_NAME_BLOCK_ID), null, false);
inInfo.addBlock(EiConstant.resultBlock).addBlockMeta(new HPKC010().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);
inInfo = super.query(inInfo, HPKC010.QUERY, new HPKC010());
} catch (Exception e) {
LogUtils.setDetailMsg(inInfo, e, "查询失败");
}
return inInfo;
}
/**
* 生成出库单
*
* @param inInfo
* @return
*/
public EiInfo select(EiInfo inInfo) {
try {
List<Map> resultRows = inInfo.getBlock(EiConstant.resultBlock).getRows();
// 库存ID
List<Long> ids = ObjectUtils.listKey(resultRows, "id");
// 行锁
HPKCTools.lockKc010(ids);
// 获取库存信息
Map<Long, HPKC010> dbKc010Map = HPKCTools.mapKc010(ids);
// 状态校验
for (Map row : resultRows) {
Long id = MapUtils.getLong(row, "id");
HPKC010 dbKc010 = dbKc010Map.get(id);
AssertUtils.isNull(dbKc010, "库存号[" + id + "]不存在!");
// 校验数量
BigDecimal applyAmount = MapUtils.getBigDecimal(row, "applyAmount");
AssertUtils.isGt(applyAmount, dbKc010.getAmount(),
"库存号[" + id + "]可用数量不足!");
BigDecimal applyWeight = MapUtils.getBigDecimal(row, "applyWeight");
AssertUtils.isGt(applyWeight, dbKc010.getWeight(),
"库存号[" + id + "]可用重量不足!");
}
// 生成出库单
for (Map row : resultRows) {
BigDecimal applyAmount = MapUtils.getBigDecimal(row, "applyAmount");
BigDecimal applyWeight = MapUtils.getBigDecimal(row, "applyWeight");
String applyRemark = MapUtils.getString(row, "applyRemark");
Long kcId = MapUtils.getLong(row, "id");
HPKC010 dbKc010 = dbKc010Map.get(kcId);
HPKC007 kc007 = BeanUtils.copy(dbKc010, HPKC007.class);
kc007.setOtherOuterNo(SequenceGenerator.getNextSequence(HPConstant.SequenceId.OTHER_OUTER_NO));
kc007.setReceiptDate(DateUtils.shortDate());
kc007.setAmount(applyAmount);
kc007.setWeight(applyWeight);
kc007.setKcId(kcId);
kc007.setRemark(applyRemark);
DaoUtils.insert(HPKC007.INSERT, kc007);
// 修改库存数量
HPKCTools.updateStock(kc007.getWhCode(), kc007.getInventRecordId(), kc007.getAmount().negate(),
kc007.getWeight().negate());
}
} catch (Exception e) {
LogUtils.setDetailMsg(inInfo, e, "生成出库单失败");
}
return inInfo;
}
}
...@@ -325,7 +325,7 @@ public class ServiceHPKC009 extends ServiceBase { ...@@ -325,7 +325,7 @@ public class ServiceHPKC009 extends ServiceBase {
List<HPKC007> cItems = dao.query("HPKC007.statDate", queryMap); List<HPKC007> cItems = dao.query("HPKC007.statDate", queryMap);
Map<String, HPKC007> cItemMap = cItems.stream().collect(Collectors.toMap(item -> Map<String, HPKC007> cItemMap = cItems.stream().collect(Collectors.toMap(item ->
item.getCompanyCode() + "#" + item.getDepCode() + "#" + item.getWhCode() + "#" item.getCompanyCode() + "#" + item.getDepCode() + "#" + item.getWhCode() + "#"
+ item.getMatType() + "#" + item.getMatCode(), item -> item)); + item.getInventType() + "#" + item.getInventCode(), item -> item));
// 1.4、期初库存 // 1.4、期初库存
queryMap.put("dateProc", queryMap.get("beforeDate")); queryMap.put("dateProc", queryMap.get("beforeDate"));
queryMap.put("kcType", HPConstant.KcType.QT); queryMap.put("kcType", HPConstant.KcType.QT);
......
...@@ -6,9 +6,7 @@ import com.baosight.hpjx.core.security.UserSessionUtils; ...@@ -6,9 +6,7 @@ import com.baosight.hpjx.core.security.UserSessionUtils;
import com.baosight.hpjx.hp.kc.domain.HPKC010; import com.baosight.hpjx.hp.kc.domain.HPKC010;
import com.baosight.hpjx.hp.pz.domain.HPPZ006; import com.baosight.hpjx.hp.pz.domain.HPPZ006;
import com.baosight.hpjx.hp.pz.domain.HPPZ007; import com.baosight.hpjx.hp.pz.domain.HPPZ007;
import com.baosight.hpjx.hp.pz.tools.HPPZTools;
import com.baosight.hpjx.util.*; import com.baosight.hpjx.util.*;
import com.baosight.iplat4j.core.ei.EiBlock;
import com.baosight.iplat4j.core.ei.EiConstant; import com.baosight.iplat4j.core.ei.EiConstant;
import com.baosight.iplat4j.core.ei.EiInfo; import com.baosight.iplat4j.core.ei.EiInfo;
import com.baosight.iplat4j.core.exception.PlatException; import com.baosight.iplat4j.core.exception.PlatException;
...@@ -17,7 +15,6 @@ import com.baosight.iplat4j.core.service.soa.XLocalManager; ...@@ -17,7 +15,6 @@ import com.baosight.iplat4j.core.service.soa.XLocalManager;
import com.baosight.iplat4j.core.util.DateUtils; import com.baosight.iplat4j.core.util.DateUtils;
import com.baosight.iplat4j.core.web.threadlocal.UserSession; import com.baosight.iplat4j.core.web.threadlocal.UserSession;
import org.apache.commons.collections.CollectionUtils; import org.apache.commons.collections.CollectionUtils;
import org.apache.commons.collections.MapUtils;
import org.apache.commons.lang.StringUtils; import org.apache.commons.lang.StringUtils;
import java.math.BigDecimal; import java.math.BigDecimal;
...@@ -41,7 +38,9 @@ public class ServiceHPKC010 extends ServiceBase { ...@@ -41,7 +38,9 @@ public class ServiceHPKC010 extends ServiceBase {
EiInfo outInfo = super.initLoad(inInfo, HPKC010); EiInfo outInfo = super.initLoad(inInfo, HPKC010);
outInfo.getBlock(EiConstant.resultBlock).getRows().clear(); outInfo.getBlock(EiConstant.resultBlock).getRows().clear();
CommonMethod.initBlock(outInfo, Arrays.asList(DdynamicEnum.WH_RECORD_BLOCK_ID), null); CommonMethod.initBlock(outInfo, Arrays.asList(DdynamicEnum.WH_RECORD_BLOCK_ID), null);
CommonMethod.initBlock(outInfo, Arrays.asList(DdynamicEnum.INVENT_ALL_BLOCK_ID), null,false); CommonMethod.initBlock(outInfo, Arrays.asList(DdynamicEnum.MATERIAL_RECORD_BLOCK_ID), null);
CommonMethod.initBlock(outInfo, Arrays.asList(DdynamicEnum.INVENT_SPEC_BLOCK_ID), null);
CommonMethod.initBlock(outInfo, Arrays.asList(DdynamicEnum.SPEC_NAME_BLOCK_ID), null, false);
return outInfo; return outInfo;
} }
...@@ -58,69 +57,7 @@ public class ServiceHPKC010 extends ServiceBase { ...@@ -58,69 +57,7 @@ public class ServiceHPKC010 extends ServiceBase {
return inInfo; return inInfo;
} }
/**
* 保存操作.
*
* @param inInfo
* @return
*/
public EiInfo save(EiInfo inInfo) {
try {
List<Map> resultRows = inInfo.getBlock(EiConstant.resultBlock).getRows();
// 数据校验
this.checkSaveData(resultRows);
// 写入数据
for (int i = 0; i < resultRows.size(); i++) {
HPKC010 fKc010 = new HPKC010();
fKc010.fromMap(resultRows.get(i));
// 设置基础信息
if (fKc010.getId() == null || fKc010.getId() == 0) {
this.add(fKc010);
} else {
this.modify(fKc010);
}
}
inInfo = this.query(inInfo);
inInfo.setStatus(EiConstant.STATUS_DEFAULT);
inInfo.setMsg("操作成功!本次对[" + resultRows.size() + "]条数据保存成功!");
} catch (Exception e) {
LogUtils.setDetailMsg(inInfo, e, "保存失败");
}
return inInfo;
}
/**
* 校验保存的数据
*
* @param resultRows
*/
private void checkSaveData(List<Map> resultRows) {
for (int i = 0; i < resultRows.size(); i++) {
HPKC010 fKc010 = new HPKC010();
fKc010.fromMap(resultRows.get(i));
AssertUtils.isEmpty(fKc010.getWhCode(), "仓库名称不能为空");
AssertUtils.isNull(fKc010.getInventRecordId(), "存货名称不能为空");
}
}
/**
* 新增
*
* @param fKc010
*/
private void add(HPKC010 fKc010) {
DaoUtils.insert("HPKC010.insert", fKc010);
}
/**
* 修改数据
*
* @param fKc010
*/
private void modify(HPKC010 fKc010) {
DaoUtils.update("HPKC010.update", fKc010);
}
/** /**
* 新增操作. * 新增操作.
*/ */
...@@ -141,29 +78,6 @@ public class ServiceHPKC010 extends ServiceBase { ...@@ -141,29 +78,6 @@ public class ServiceHPKC010 extends ServiceBase {
} }
return inInfo; return inInfo;
} }
/**
* 修改操作
*
* @param inInfo
* @return
*/
public EiInfo update(EiInfo inInfo) {
try {
EiBlock eiBlock = inInfo.getBlock(EiConstant.resultBlock);
for (int i = 0; i < eiBlock.getRowCount(); i++) {
HPKC010 fKc010 = new HPKC010();
fKc010.fromMap(eiBlock.getRow(i));
DaoUtils.update(HPKC010.UPDATE, fKc010);
}
inInfo = this.query(inInfo);
inInfo.setStatus(EiConstant.STATUS_SUCCESS);
inInfo.setMsg("修改成功!");
} catch (PlatException e) {
LogUtils.setDetailMsg(inInfo, e, "修改失败");
}
return inInfo;
}
/** /**
* 更新库存 * 更新库存
...@@ -180,7 +94,7 @@ public class ServiceHPKC010 extends ServiceBase { ...@@ -180,7 +94,7 @@ public class ServiceHPKC010 extends ServiceBase {
try { try {
checkUpdateStockParam(companyCode,whCode,inventRecordId,amount,weight); checkUpdateStockParam(companyCode,whCode,inventRecordId,amount,weight);
HPKC010 newObj = generatorBaseInfo(companyCode,whCode,inventRecordId,amount,weight); HPKC010 newObj = generatorBaseInfo(companyCode,whCode,inventRecordId,amount,weight);
List<Map> list = dao.query("queryByCondition",new HashMap<String,Object>(){{ List<Map> list = dao.query("HPKC010.queryByCondition",new HashMap<String,Object>(){{
put("companyCode",companyCode); put("companyCode",companyCode);
put("whCode",whCode); put("whCode",whCode);
put("inventRecordId",inventRecordId); put("inventRecordId",inventRecordId);
...@@ -192,7 +106,7 @@ public class ServiceHPKC010 extends ServiceBase { ...@@ -192,7 +106,7 @@ public class ServiceHPKC010 extends ServiceBase {
throw new PlatException("当前库存为空,库存变更数量与重量不能小于等于0!"); throw new PlatException("当前库存为空,库存变更数量与重量不能小于等于0!");
} }
generatorBaseInfo(newObj); generatorBaseInfo(newObj);
DaoUtils.insert("insert",newObj); DaoUtils.insert("HPKC010.insert",newObj);
}else{ }else{
//修改 //修改
HPKC010 oldObj = new HPKC010(); HPKC010 oldObj = new HPKC010();
...@@ -207,7 +121,7 @@ public class ServiceHPKC010 extends ServiceBase { ...@@ -207,7 +121,7 @@ public class ServiceHPKC010 extends ServiceBase {
oldObj.setUpdatedBy(newObj.getUpdatedBy()); oldObj.setUpdatedBy(newObj.getUpdatedBy());
oldObj.setUpdatedName(newObj.getUpdatedName()); oldObj.setUpdatedName(newObj.getUpdatedName());
oldObj.setUpdatedTime(newObj.getUpdatedTime()); oldObj.setUpdatedTime(newObj.getUpdatedTime());
int result = DaoUtils.update("updateStock",oldObj); int result = DaoUtils.update("HPKC010.updateStock",oldObj);
if(result!=1){ if(result!=1){
throw new PlatException("库存更新失败,库存已发生变更或系统异常,请重试!"); throw new PlatException("库存更新失败,库存已发生变更或系统异常,请重试!");
} }
...@@ -314,26 +228,4 @@ public class ServiceHPKC010 extends ServiceBase { ...@@ -314,26 +228,4 @@ public class ServiceHPKC010 extends ServiceBase {
} }
} }
/**
* 删除操作
*
* @param inInfo
* @return
*/
public EiInfo delete(EiInfo inInfo) {
try {
List<Map> resultRows = inInfo.getBlock(EiConstant.resultBlock).getRows();
for (int i = 0; i < resultRows.size(); i++) {
DaoUtils.update(HPKC010.DELETE, resultRows.get(i));
}
inInfo = this.query(inInfo);
inInfo.setStatus(EiConstant.STATUS_DEFAULT);
inInfo.setMsg("操作成功!本次对[" + resultRows.size() + "]条数据删除成功!");
} catch (Exception e) {
LogUtils.setDetailMsg(inInfo, e, "删除失败");
}
return inInfo;
}
} }
<?xml version="1.0" encoding="UTF-8"?> <?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE sqlMap PUBLIC "-//iBATIS.com//DTD SQL Map 2.0//EN" "http://www.ibatis.com/dtd/sql-map-2.dtd"> <!DOCTYPE sqlMap PUBLIC "-//iBATIS.com//DTD SQL Map 2.0//EN" "http://www.ibatis.com/dtd/sql-map-2.dtd">
<!-- table information
Generate time : 2024-01-10 14:03:35
Version : 1.0
tableName :hpjx.t_hpkc007
ID INTEGER NOT NULL primarykey,
COMPANY_CODE VARCHAR NOT NULL,
DEP_CODE VARCHAR NOT NULL,
RECEIPT_TIME DATETIME,
OTHER_ENTHOUSE VARCHAR NOT NULL,
WH_CODE VARCHAR NOT NULL,
WH_NAME VARCHAR NOT NULL,
MAT_TYPE VARCHAR NOT NULL,
MAT_CODE VARCHAR NOT NULL,
MAT_NAME VARCHAR NOT NULL,
AMOUNT DECIMAL NOT NULL,
WEIGHT DECIMAL NOT NULL,
STATUS TINYINT NOT NULL,
REMARK VARCHAR
-->
<sqlMap namespace="HPKC007"> <sqlMap namespace="HPKC007">
<select id="query" parameterClass="java.util.HashMap" <sql id="column">
resultClass="com.baosight.hpjx.hp.kc.domain.HPKC007"> ID as "id",
SELECT COMPANY_CODE as "companyCode", <!-- 企业编码 预留 -->
ID as "id", DEP_CODE as "depCode", <!-- 部门编码 预留 -->
COMPANY_CODE as "companyCode", <!-- 企业编码 预留 --> RECEIPT_DATE as "receiptDate", <!-- 单据日期 -->
DEP_CODE as "depCode", <!-- 部门编码 预留 --> OTHER_OUTER_NO as "otherOuterNo", <!-- 其他出库单号 -->
RECEIPT_TIME as "receiptTime", <!-- 单据日期 --> WH_CODE as "whCode", <!-- 仓库编码 -->
OTHER_ENTHOUSE as "otherEnthouse", <!-- 其他入库单号 --> WH_NAME as "whName", <!-- 仓库名称 -->
WH_CODE as "whCode", <!-- 仓库编码 --> INVENT_TYPE as "inventType", <!-- 物料类型 -->
WH_NAME as "whName", <!-- 仓库名称 --> INVENT_CODE as "inventCode", <!-- 物料编码 -->
MAT_TYPE as "matType", <!-- 物料类型 --> INVENT_NAME as "inventName", <!-- 物料名称 -->
MAT_CODE as "matCode", <!-- 物料编码 --> INVENT_RECORD_ID as "inventRecordId", <!-- 规格 -->
MAT_NAME as "matName", <!-- 物料名称 --> AMOUNT as "amount", <!-- 数量 -->
AMOUNT as "amount", <!-- 数量 --> WEIGHT as "weight", <!-- 重量 -->
WEIGHT as "weight", <!-- 重量 --> STATUS as "status", <!-- 状态 0审核 1保存 -->
STATUS as "status", <!-- 状态 0审核 1保存 --> KC_ID as "kcId", <!-- 库存ID -->
REMARK as "remark" <!-- 备注 --> REMARK as "remark", <!-- 备注 -->
FROM hpjx.t_hpkc007 WHERE 1=1 OLD_OUTER_NO as "oldOuterNo", <!-- 原出库单号 -->
<isNotEmpty prepend=" AND " property="receiptTime"> CREATED_BY as "createdBy", <!-- 创建人 -->
RECEIPT_TIME = #receiptTime# CREATED_NAME as "createdName", <!-- 创建人名称 -->
</isNotEmpty> CREATED_TIME as "createdTime", <!-- 创建时间 -->
UPDATED_BY as "updatedBy", <!-- 更新人 -->
UPDATED_NAME as "updatedName", <!-- 更新人名称 -->
UPDATED_TIME as "updatedTime" <!-- 更新时间 -->
</sql>
<sql id="condition">
AND DELETE_FLAG = 0
<isNotEmpty prepend=" AND " property="id">
ID = #id#
</isNotEmpty>
<isNotEmpty prepend=" AND " property="companyCode">
COMPANY_CODE = #companyCode#
</isNotEmpty>
<isNotEmpty prepend=" AND " property="depCode">
DEP_CODE = #depCode#
</isNotEmpty>
<isNotEmpty prepend=" AND " property="receiptDate">
RECEIPT_DATE = #receiptDate#
</isNotEmpty>
<isNotEmpty prepend=" AND " property="otherOuterNo">
OTHER_OUTER_NO = #otherOuterNo#
</isNotEmpty>
<isNotEmpty prepend=" AND " property="whCode">
WH_CODE = #whCode#
</isNotEmpty>
<isNotEmpty prepend=" AND " property="whName">
WH_NAME = #whName#
</isNotEmpty>
<isNotEmpty prepend=" AND " property="inventType">
INVENT_TYPE = #inventType#
</isNotEmpty>
<isNotEmpty prepend=" AND " property="inventCode">
INVENT_CODE = #inventCode#
</isNotEmpty>
<isNotEmpty prepend=" AND " property="inventName">
INVENT_NAME = #inventName#
</isNotEmpty>
<isNotEmpty prepend=" AND " property="oldOuterNo">
OLD_OUTER_NO = #oldOuterNo#
</isNotEmpty>
</sql>
<isNotEmpty prepend=" AND " property="otherEnthouse"> <sql id="customCondition">
OTHER_ENTHOUSE LIKE CONCAT('%',CONCAT(#otherEnthouse#,'%')) <isNotEmpty prepend=" AND " property="otherOuterNos">
</isNotEmpty> OTHER_OUTER_NO IN <iterate close=")" open="(" conjunction="," property="otherOuterNos">#otherOuterNos[]#</iterate>
</isNotEmpty>
<isNotEmpty prepend=" AND " property="whName"> <isNotEmpty prepend=" AND " property="spec">
WH_NAME = LIKE CONCAT('%',CONCAT(#whName#,'%')) <isEqual property="spec" compareValue="无规格">
</isNotEmpty> INVENT_RECORD_ID IN (SELECT ID FROM ${hpjxSchema}.T_HPPZ006 WHERE SPEC = '')
</isEqual>
<isNotEmpty prepend=" AND " property="status"> <isNotEqual property="spec" compareValue="无规格">
STATUS = #status# INVENT_RECORD_ID IN (SELECT ID FROM ${hpjxSchema}.T_HPPZ006 WHERE SPEC = #spec#)
</isNotEmpty> </isNotEqual>
</isNotEmpty>
</sql>
<dynamic prepend="ORDER BY"> <sql id="order">
<isNotEmpty property="orderBy"> <dynamic prepend="ORDER BY">
$orderBy$ <isNotEmpty property="orderBy">
</isNotEmpty> $orderBy$
<isEmpty property="orderBy"> </isNotEmpty>
ID asc <isEmpty property="orderBy">
</isEmpty> ID asc
</dynamic> </isEmpty>
</dynamic>
</sql>
</select> <select id="query" parameterClass="java.util.HashMap"
resultClass="com.baosight.hpjx.hp.kc.domain.HPKC007">
SELECT
<include refid="column"/>
FROM hpjx.t_hpkc007
WHERE 1=1
<include refid="condition"/>
<include refid="customCondition"/>
<include refid="order"/>
</select>
<select id="count" resultClass="int"> <select id="count" resultClass="int">
SELECT COUNT(*) FROM hpjx.t_hpkc007 WHERE 1=1 SELECT COUNT(*) FROM hpjx.t_hpkc007 WHERE 1=1
<isNotEmpty prepend=" AND " property="id"> <include refid="condition"/>
ID = #id# <include refid="customCondition"/>
</isNotEmpty> </select>
</select>
<!-- <!-- 查询统计 -->
<isNotEmpty prepend=" AND " property="id"> <select id="querySum" resultClass="com.baosight.hpjx.hp.kc.domain.HPKC007">
ID = #id# SELECT
</isNotEmpty> COALESCE(SUM(AMOUNT), 0) AS "amount", <!-- 数量 -->
<isNotEmpty prepend=" AND " property="companyCode"> COALESCE(SUM(WEIGHT), 0) AS "weight" <!-- 重量 -->
COMPANY_CODE = #companyCode# FROM ${hpjxSchema}.T_HPKC007
</isNotEmpty> WHERE 1=1
<isNotEmpty prepend=" AND " property="depCode"> <include refid="condition"/>
DEP_CODE = #depCode# <include refid="customCondition"/>
</isNotEmpty> </select>
<isNotEmpty prepend=" AND " property="receiptTime">
RECEIPT_TIME = #receiptTime#
</isNotEmpty>
<isNotEmpty prepend=" AND " property="otherEnthouse">
OTHER_ENTHOUSE = #otherEnthouse#
</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="remark">
REMARK = #remark#
</isNotEmpty>
-->
<insert id="insert"> <insert id="insert">
INSERT INTO hpjx.t_hpkc007 (ID, INSERT INTO ${hpjxSchema}.T_HPKC007 (
COMPANY_CODE, <!-- 企业编码 预留 --> COMPANY_CODE, <!-- 企业编码 预留 -->
DEP_CODE, <!-- 部门编码 预留 --> DEP_CODE, <!-- 部门编码 预留 -->
RECEIPT_TIME, <!-- 单据日期 --> RECEIPT_DATE, <!-- 单据日期 -->
OTHER_ENTHOUSE, <!-- 其他入库单号 --> OTHER_OUTER_NO, <!-- 其他出库单号 -->
WH_CODE, <!-- 仓库编码 --> WH_CODE, <!-- 仓库编码 -->
WH_NAME, <!-- 仓库名称 --> WH_NAME, <!-- 仓库名称 -->
MAT_TYPE, <!-- 物料类型 --> INVENT_TYPE, <!-- 物料类型 -->
MAT_CODE, <!-- 物料编码 --> INVENT_CODE, <!-- 物料编码 -->
MAT_NAME, <!-- 物料名称 --> INVENT_NAME, <!-- 物料名称 -->
AMOUNT, <!-- 数量 --> INVENT_RECORD_ID, <!-- 规格 -->
WEIGHT, <!-- 重量 --> AMOUNT, <!-- 数量 -->
STATUS, <!-- 状态 0审核 1保存 --> WEIGHT, <!-- 重量 -->
REMARK <!-- 备注 --> KC_ID, <!-- 库存ID -->
) REMARK, <!-- 备注 -->
VALUES (#id#, #companyCode#, #depCode#, #receiptTime#, #otherEnthouse#, #whCode#, #whName#, #matType#, #matCode#, #matName#, #amount#, #weight#, #status#, #remark#) OLD_OUTER_NO, <!-- 原出库单号 -->
</insert> CREATED_BY, <!-- 创建人 -->
CREATED_NAME, <!-- 创建人名称 -->
CREATED_TIME, <!-- 创建时间 -->
DELETE_FLAG
) VALUES (
#companyCode#, #depCode#, #receiptDate#, #otherOuterNo#, #whCode#, #whName#,
#inventType#, #inventCode#, #inventName#, #inventRecordId#, #amount#, #weight#,
#kcId#, #remark#, #oldOuterNo#, #createdBy#, #createdName#, #createdTime#, #deleteFlag#
)
</insert>
<!-- 逻辑删除 -->
<delete id="delete"> <delete id="delete">
DELETE FROM hpjx.t_hpkc007 WHERE UPDATE hpjx.t_hpkc007 SET DELETE_FLAG = 1 WHERE ID = #id#
ID = #id#
</delete> </delete>
<update id="update"> <update id="update">
UPDATE hpjx.t_hpkc007 UPDATE ${hpjxSchema}.T_HPKC007
SET SET
COMPANY_CODE = #companyCode#, <!-- 企业编码 预留 --> RECEIPT_DATE = #receiptDate#, <!-- 单据日期 -->
DEP_CODE = #depCode#, <!-- 部门编码 预留 --> AMOUNT = #amount#, <!-- 数量 -->
RECEIPT_TIME = #receiptTime#, <!-- 单据日期 --> WEIGHT = #weight#, <!-- 重量 -->
OTHER_ENTHOUSE = #otherEnthouse#, <!-- 其他入库单号 --> REMARK = #remark#, <!-- 备注 -->
WH_CODE = #whCode#, <!-- 仓库编码 --> UPDATED_BY = #updatedBy#, <!-- 更新人 -->
WH_NAME = #whName#, <!-- 仓库名称 --> UPDATED_NAME = #updatedName#, <!-- 更新人名称 -->
MAT_TYPE = #matType#, <!-- 物料类型 --> UPDATED_TIME = #updatedTime# <!-- 更新时间 -->
MAT_CODE = #matCode#, <!-- 物料编码 --> WHERE ID = #id#
MAT_NAME = #matName#, <!-- 物料名称 --> </update>
AMOUNT = #amount#, <!-- 数量 -->
WEIGHT = #weight#, <!-- 重量 --> <!-- 行锁 -->
STATUS = #status#, <!-- 状态 0审核 1保存 --> <update id="lock">
REMARK = #remark# <!-- 备注 --> UPDATE ${hpjxSchema}.T_HPKC007
WHERE SET CREATED_TIME = CREATED_TIME
ID = #id# WHERE 1=1
</update> <isNotEmpty prepend=" AND " property="otherOuterNo">
OTHER_OUTER_NO = #otherOuterNo#
</isNotEmpty>
<isNotEmpty prepend=" AND " property="otherOuterNos">
OTHER_OUTER_NO IN <iterate close=")" open="(" conjunction="," property="otherOuterNos">#otherOuterNos[]#</iterate>
</isNotEmpty>
</update>
<!-- 统计库存 --> <!-- 统计库存 -->
<select id="statDate" resultClass="com.baosight.hpjx.hp.kc.domain.HPKC007"> <select id="statDate" resultClass="com.baosight.hpjx.hp.kc.domain.HPKC007">
...@@ -169,8 +183,8 @@ ...@@ -169,8 +183,8 @@
COMPANY_CODE AS "companyCode", COMPANY_CODE AS "companyCode",
DEP_CODE AS "depCode", DEP_CODE AS "depCode",
WH_CODE AS "whCode", WH_CODE AS "whCode",
MAT_TYPE AS "matType", INVENT_TYPE AS "inventType",
MAT_CODE AS "matCode", INVENT_CODE AS "inventCode",
COALESCE(SUM(AMOUNT), 0) AS "amount", COALESCE(SUM(AMOUNT), 0) AS "amount",
COALESCE(SUM(WEIGHT), 0) AS "weight" COALESCE(SUM(WEIGHT), 0) AS "weight"
FROM ${hpjxSchema}.T_HPKC004 FROM ${hpjxSchema}.T_HPKC004
...@@ -178,7 +192,7 @@ ...@@ -178,7 +192,7 @@
<isNotEmpty prepend=" AND " property="createdTimeFrom"> <isNotEmpty prepend=" AND " property="createdTimeFrom">
CREATED_TIME BETWEEN #createdTimeFrom# AND #createdTimeTo# CREATED_TIME BETWEEN #createdTimeFrom# AND #createdTimeTo#
</isNotEmpty> </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> </select>
</sqlMap> </sqlMap>
...@@ -63,11 +63,26 @@ ...@@ -63,11 +63,26 @@
</sql> </sql>
<sql id="customCondition">
<isNotEmpty prepend=" AND " property="ids">
ID IN <iterate close=")" open="(" conjunction="," property="ids">#ids[]#</iterate>
</isNotEmpty>
<isNotEmpty prepend=" AND " property="spec">
<isEqual property="spec" compareValue="无规格">
INVENT_RECORD_ID IN (SELECT ID FROM ${hpjxSchema}.T_HPPZ006 WHERE SPEC = '')
</isEqual>
<isNotEqual property="spec" compareValue="无规格">
INVENT_RECORD_ID IN (SELECT ID FROM ${hpjxSchema}.T_HPPZ006 WHERE SPEC = #spec#)
</isNotEqual>
</isNotEmpty>
</sql>
<select id="query" resultClass="com.baosight.hpjx.hp.kc.domain.HPKC010"> <select id="query" resultClass="com.baosight.hpjx.hp.kc.domain.HPKC010">
SELECT <include refid="column"/> SELECT <include refid="column"/>
FROM hpjx.T_HPKC010 FROM hpjx.T_HPKC010
WHERE 1=1 WHERE 1=1
<include refid="condition"/> <include refid="condition"/>
<include refid="customCondition"/>
<dynamic prepend="ORDER BY"> <dynamic prepend="ORDER BY">
<isNotEmpty property="orderBy"> <isNotEmpty property="orderBy">
$orderBy$ $orderBy$
...@@ -83,24 +98,16 @@ ...@@ -83,24 +98,16 @@
FROM hpjx.T_HPKC010 FROM hpjx.T_HPKC010
WHERE 1=1 WHERE 1=1
<include refid="condition"/> <include refid="condition"/>
<include refid="customCondition"/>
</select> </select>
<select id="count" resultClass="int"> <select id="count" resultClass="int">
SELECT COUNT(*) FROM hpjx.T_HPKC010 SELECT COUNT(*) FROM hpjx.T_HPKC010
WHERE 1=1 WHERE 1=1
<include refid="condition"/> <include refid="condition"/>
<include refid="customCondition"/>
</select> </select>
<!-- 查询统计 -->
<select id="querySum" resultClass="com.baosight.hpjx.hp.kc.domain.HPKC010">
SELECT
COALESCE(SUM(AMOUNT), 0) AS "amount", <!-- 数量 -->
COALESCE(SUM(WEIGHT), 0) AS "weight" <!-- 重量 -->
FROM ${hpjxSchema}.T_HPKC010
WHERE 1=1
<include refid="condition"/>
</select>
<insert id="insert"> <insert id="insert">
INSERT INTO hpjx.T_HPKC010 ( INSERT INTO hpjx.T_HPKC010 (
COMPANY_CODE, <!-- 企业编码 预留 --> COMPANY_CODE, <!-- 企业编码 预留 -->
...@@ -125,26 +132,6 @@ ...@@ -125,26 +132,6 @@
) )
</insert> </insert>
<delete id="delete">
DELETE FROM hpjx.T_HPKC010 WHERE ID = #id#
</delete>
<update id="update">
UPDATE hpjx.T_HPKC010
SET
WH_CODE = #whCode#, <!-- 仓库编码 -->
WH_NAME = #whName#, <!-- 仓库名称 -->
INVENT_TYPE = #inventType#, <!-- 物料类型 -->
INVENT_CODE = #inventCode#, <!-- 物料编码 -->
INVENT_NAME = #inventName#, <!-- 物料名称 -->
INVENT_RECORD_ID = #inventRecordId#, <!-- 存货档案ID -->
AMOUNT = #amount#, <!-- 数量 -->
WEIGHT = #weight#, <!-- 重量 -->
UPDATED_BY = #updatedBy#, <!-- 更新人 -->
UPDATED_TIME = #updatedTime#, <!-- 更新时间 -->
VERSION = #version#
WHERE ID = #id#
</update>
<update id="updateStock"> <update id="updateStock">
UPDATE hpjx.T_HPKC010 UPDATE hpjx.T_HPKC010
...@@ -154,8 +141,21 @@ ...@@ -154,8 +141,21 @@
UPDATED_BY = #updatedBy#, <!-- 更新人 --> UPDATED_BY = #updatedBy#, <!-- 更新人 -->
UPDATED_NAME = #updatedName#, <!-- 更新人 --> UPDATED_NAME = #updatedName#, <!-- 更新人 -->
UPDATED_TIME = #updatedTime#, <!-- 更新时间 --> UPDATED_TIME = #updatedTime#, <!-- 更新时间 -->
VERSION = CURRENT_TIMESTAMP(3) VERSION = VERSION+1
WHERE ID = #id# WHERE ID = #id#
AND VERSION = #version# AND VERSION = #version#
</update> </update>
<!-- 行锁 -->
<update id="lock">
UPDATE ${hpjxSchema}.T_HPKC010
SET CREATED_TIME = CREATED_TIME
WHERE 1=1
<isNotEmpty prepend=" AND " property="id">
ID = #id#
</isNotEmpty>
<isNotEmpty prepend=" AND " property="ids">
ID IN <iterate close=")" open="(" conjunction="," property="ids">#ids[]#</iterate>
</isNotEmpty>
</update>
</sqlMap> </sqlMap>
...@@ -3,6 +3,8 @@ package com.baosight.hpjx.hp.kc.tools; ...@@ -3,6 +3,8 @@ package com.baosight.hpjx.hp.kc.tools;
import com.baosight.hpjx.core.dao.DaoBase; import com.baosight.hpjx.core.dao.DaoBase;
import com.baosight.hpjx.hp.constant.HPSqlConstant; import com.baosight.hpjx.hp.constant.HPSqlConstant;
import com.baosight.hpjx.hp.kc.domain.HPKC006; import com.baosight.hpjx.hp.kc.domain.HPKC006;
import com.baosight.hpjx.hp.kc.domain.HPKC007;
import com.baosight.hpjx.hp.kc.domain.HPKC010;
import com.baosight.iplat4j.core.ei.EiConstant; import com.baosight.iplat4j.core.ei.EiConstant;
import com.baosight.iplat4j.core.ei.EiInfo; import com.baosight.iplat4j.core.ei.EiInfo;
import com.baosight.iplat4j.core.exception.PlatException; import com.baosight.iplat4j.core.exception.PlatException;
...@@ -66,6 +68,94 @@ public class HPKCTools { ...@@ -66,6 +68,94 @@ public class HPKCTools {
} }
/** /**
* 锁
*
* @param otherOuterNos
* @return
*/
public static void lockKc007(List<String> otherOuterNos) {
if (CollectionUtils.isEmpty(otherOuterNos)) {
return;
}
Map queryMap = new HashMap();
queryMap.put("otherOuterNos", otherOuterNos);
DaoBase.getInstance().update(HPSqlConstant.HPKC007.LOCK, queryMap);
}
/**
* 查询其他入库信息
*
* @param otherOuterNos
* @return
*/
public static List<HPKC007> listKc007(List<String> otherOuterNos) {
if (CollectionUtils.isEmpty(otherOuterNos)) {
return null;
}
Map queryMap = new HashMap();
queryMap.put("otherOuterNos", otherOuterNos);
return DaoBase.getInstance().query(HPKC007.QUERY, queryMap);
}
/**
* 查询其他入库信息
*
* @param otherOuterNos
* @return
*/
public static Map<String, HPKC007> mapKc007(List<String> otherOuterNos) {
List<HPKC007> results = listKc007(otherOuterNos);
if (CollectionUtils.isEmpty(results)) {
return null;
}
return results.stream().collect(Collectors.toMap(HPKC007::getOtherOuterNo, item -> item));
}
/**
* 查询库存信息
*
* @param ids
* @return
*/
public static List<HPKC010> listKc010(List<Long> ids) {
if (CollectionUtils.isEmpty(ids)) {
return null;
}
Map queryMap = new HashMap();
queryMap.put("ids", ids);
return DaoBase.getInstance().query(HPKC010.QUERY, queryMap);
}
/**
* 查询库存信息
*
* @param ids
* @return
*/
public static Map<Long, HPKC010> mapKc010(List<Long> ids) {
List<HPKC010> results = listKc010(ids);
if (CollectionUtils.isEmpty(results)) {
return null;
}
return results.stream().collect(Collectors.toMap(HPKC010::getId, item -> item));
}
/**
* 锁
*
* @param ids
* @return
*/
public static void lockKc010(List<Long> ids) {
if (CollectionUtils.isEmpty(ids)) {
return;
}
Map queryMap = new HashMap();
queryMap.put("ids", ids);
DaoBase.getInstance().update(HPSqlConstant.HPKC010.LOCK, queryMap);
}
/**
* 更新库存 * 更新库存
* *
* @param whCode * @param whCode
......
...@@ -52,7 +52,7 @@ public class ServiceHPPZ004 extends ServiceBase { ...@@ -52,7 +52,7 @@ public class ServiceHPPZ004 extends ServiceBase {
@Override @Override
public EiInfo query(EiInfo inInfo) { public EiInfo query(EiInfo inInfo) {
try { try {
inInfo = super.query(inInfo, "HPPZ004.query", new HPPZ003()); inInfo = super.query(inInfo, "HPPZ004.query", new HPPZ004());
} catch (Exception e) { } catch (Exception e) {
LogUtils.setDetailMsg(inInfo, e, "查询失败"); LogUtils.setDetailMsg(inInfo, e, "查询失败");
} }
......
...@@ -3,7 +3,6 @@ package com.baosight.hpjx.hp.pz.service; ...@@ -3,7 +3,6 @@ package com.baosight.hpjx.hp.pz.service;
import com.baosight.hpjx.common.DdynamicEnum; import com.baosight.hpjx.common.DdynamicEnum;
import com.baosight.hpjx.core.dao.DaoUtils; import com.baosight.hpjx.core.dao.DaoUtils;
import com.baosight.hpjx.hp.constant.HPConstant; import com.baosight.hpjx.hp.constant.HPConstant;
import com.baosight.hpjx.hp.kc.domain.HPKC007;
import com.baosight.hpjx.hp.pz.domain.HPPZ007; import com.baosight.hpjx.hp.pz.domain.HPPZ007;
import com.baosight.hpjx.util.CommonMethod; import com.baosight.hpjx.util.CommonMethod;
import com.baosight.hpjx.util.LogUtils; import com.baosight.hpjx.util.LogUtils;
...@@ -50,7 +49,7 @@ public class ServiceHPPZ007 extends ServiceBase { ...@@ -50,7 +49,7 @@ public class ServiceHPPZ007 extends ServiceBase {
@Override @Override
public EiInfo query(EiInfo inInfo) { public EiInfo query(EiInfo inInfo) {
try { try {
inInfo = super.query(inInfo, HPPZ007.QUERY, new HPKC007()); inInfo = super.query(inInfo, HPPZ007.QUERY, new HPPZ007());
} catch (Exception e) { } catch (Exception e) {
LogUtils.setDetailMsg(inInfo, e, "查询失败"); LogUtils.setDetailMsg(inInfo, e, "查询失败");
} }
......
...@@ -19,12 +19,6 @@ ...@@ -19,12 +19,6 @@
UPDATED_TIME as "updatedTime" <!-- 修改时间 --> UPDATED_TIME as "updatedTime" <!-- 修改时间 -->
</sql> </sql>
<sql id="customCondition">
<isNotEmpty prepend=" AND " property="whCodes">
WH_CODE IN <iterate close=")" open="(" conjunction="," property="whCodes">#whCodes[]#</iterate>
</isNotEmpty>
</sql>
<sql id="condition"> <sql id="condition">
AND DELETE_FLAG = 0 AND DELETE_FLAG = 0
<isNotEmpty prepend=" AND " property="id"> <isNotEmpty prepend=" AND " property="id">
...@@ -53,6 +47,12 @@ ...@@ -53,6 +47,12 @@
</isNotEmpty> </isNotEmpty>
</sql> </sql>
<sql id="customCondition">
<isNotEmpty prepend=" AND " property="whCodes">
WH_CODE IN <iterate close=")" open="(" conjunction="," property="whCodes">#whCodes[]#</iterate>
</isNotEmpty>
</sql>
<sql id="order"> <sql id="order">
<dynamic prepend="ORDER BY"> <dynamic prepend="ORDER BY">
<isNotEmpty property="orderBy"> <isNotEmpty property="orderBy">
......
...@@ -19,8 +19,10 @@ public class THPSC001 extends DaoEPBase { ...@@ -19,8 +19,10 @@ public class THPSC001 extends DaoEPBase {
private String princ2 = " "; /* 客户项目负责人*/ private String princ2 = " "; /* 客户项目负责人*/
private Integer status = 0; /* 状态 0-未审核,1-已审核*/ private Integer status = 0; /* 状态 0-未审核,1-已审核*/
private String createdBy = " "; /* 创建人*/ private String createdBy = " "; /* 创建人*/
private String createdName = " "; /* 创建人名称*/
private String createdTime ; /* 创建时间*/ private String createdTime ; /* 创建时间*/
private String updatedBy = " "; /* 更新人*/ private String updatedBy = " "; /* 更新人*/
private String updatedName = " "; /* 更新人名称*/
private String updatedTime ; /* 更新时间*/ private String updatedTime ; /* 更新时间*/
private String depCode = " "; /* 部门编码*/ private String depCode = " "; /* 部门编码*/
private String remark = " "; /* 备注*/ private String remark = " "; /* 备注*/
...@@ -67,6 +69,10 @@ public class THPSC001 extends DaoEPBase { ...@@ -67,6 +69,10 @@ public class THPSC001 extends DaoEPBase {
eiColumn.setDescName("创建人"); eiColumn.setDescName("创建人");
eiMetadata.addMeta(eiColumn); eiMetadata.addMeta(eiColumn);
eiColumn = new EiColumn("createdName");
eiColumn.setDescName("创建人名称");
eiMetadata.addMeta(eiColumn);
eiColumn = new EiColumn("createdTime"); eiColumn = new EiColumn("createdTime");
eiColumn.setDescName("创建时间"); eiColumn.setDescName("创建时间");
eiMetadata.addMeta(eiColumn); eiMetadata.addMeta(eiColumn);
...@@ -75,6 +81,10 @@ public class THPSC001 extends DaoEPBase { ...@@ -75,6 +81,10 @@ public class THPSC001 extends DaoEPBase {
eiColumn.setDescName("更新人"); eiColumn.setDescName("更新人");
eiMetadata.addMeta(eiColumn); eiMetadata.addMeta(eiColumn);
eiColumn = new EiColumn("updatedName");
eiColumn.setDescName("更新人名称");
eiMetadata.addMeta(eiColumn);
eiColumn = new EiColumn("updatedTime"); eiColumn = new EiColumn("updatedTime");
eiColumn.setDescName("更新时间"); eiColumn.setDescName("更新时间");
eiMetadata.addMeta(eiColumn); eiMetadata.addMeta(eiColumn);
...@@ -264,6 +274,23 @@ public class THPSC001 extends DaoEPBase { ...@@ -264,6 +274,23 @@ public class THPSC001 extends DaoEPBase {
public void setUpdatedTime(String updatedTime) { public void setUpdatedTime(String updatedTime) {
this.updatedTime = updatedTime; this.updatedTime = updatedTime;
} }
public String getCreatedName() {
return createdName;
}
public void setCreatedName(String createdName) {
this.createdName = createdName;
}
public String getUpdatedName() {
return updatedName;
}
public void setUpdatedName(String updatedName) {
this.updatedName = updatedName;
}
/** /**
* get the depCode - 部门编码 * get the depCode - 部门编码
* @return the depCode * @return the depCode
...@@ -307,9 +334,11 @@ public class THPSC001 extends DaoEPBase { ...@@ -307,9 +334,11 @@ public class THPSC001 extends DaoEPBase {
setPrinc2(StringUtils.defaultIfEmpty(StringUtils.toString(map.get("princ2")), princ2)); setPrinc2(StringUtils.defaultIfEmpty(StringUtils.toString(map.get("princ2")), princ2));
setStatus(NumberUtils.toInteger(StringUtils.toString(map.get("status")), status)); setStatus(NumberUtils.toInteger(StringUtils.toString(map.get("status")), status));
setCreatedBy(StringUtils.defaultIfEmpty(StringUtils.toString(map.get("createdBy")), createdBy)); setCreatedBy(StringUtils.defaultIfEmpty(StringUtils.toString(map.get("createdBy")), createdBy));
setCreatedTime(StringUtils.toString(map.get("createdTime"))); setCreatedName(StringUtils.defaultIfEmpty(StringUtils.toString(map.get("createdName")), createdName));
setCreatedTime(StringUtils.defaultIfEmpty(StringUtils.toString(map.get("createdTime")),createdTime));
setUpdatedBy(StringUtils.defaultIfEmpty(StringUtils.toString(map.get("updatedBy")), updatedBy)); setUpdatedBy(StringUtils.defaultIfEmpty(StringUtils.toString(map.get("updatedBy")), updatedBy));
setUpdatedTime(StringUtils.toString(map.get("updatedTime"))); setUpdatedBy(StringUtils.defaultIfEmpty(StringUtils.toString(map.get("updatedName")), updatedName));
setUpdatedTime(StringUtils.defaultIfEmpty(StringUtils.toString(map.get("updatedTime")),updatedTime));
setDepCode(StringUtils.defaultIfEmpty(StringUtils.toString(map.get("depCode")), depCode)); setDepCode(StringUtils.defaultIfEmpty(StringUtils.toString(map.get("depCode")), depCode));
setRemark(StringUtils.defaultIfEmpty(StringUtils.toString(map.get("remark")), remark)); setRemark(StringUtils.defaultIfEmpty(StringUtils.toString(map.get("remark")), remark));
} }
...@@ -329,8 +358,10 @@ public class THPSC001 extends DaoEPBase { ...@@ -329,8 +358,10 @@ public class THPSC001 extends DaoEPBase {
map.put("princ2",StringUtils.toString(princ2, eiMetadata.getMeta("princ2"))); map.put("princ2",StringUtils.toString(princ2, eiMetadata.getMeta("princ2")));
map.put("status",StringUtils.toString(status, eiMetadata.getMeta("status"))); map.put("status",StringUtils.toString(status, eiMetadata.getMeta("status")));
map.put("createdBy",StringUtils.toString(createdBy, eiMetadata.getMeta("createdBy"))); map.put("createdBy",StringUtils.toString(createdBy, eiMetadata.getMeta("createdBy")));
map.put("createdName",StringUtils.toString(createdName, eiMetadata.getMeta("createdName")));
map.put("createdTime",StringUtils.toString(createdTime, eiMetadata.getMeta("createdTime"))); map.put("createdTime",StringUtils.toString(createdTime, eiMetadata.getMeta("createdTime")));
map.put("updatedBy",StringUtils.toString(updatedBy, eiMetadata.getMeta("updatedBy"))); map.put("updatedBy",StringUtils.toString(updatedBy, eiMetadata.getMeta("updatedBy")));
map.put("updatedName",StringUtils.toString(updatedName, eiMetadata.getMeta("updatedName")));
map.put("updatedTime",StringUtils.toString(updatedTime, eiMetadata.getMeta("updatedTime"))); map.put("updatedTime",StringUtils.toString(updatedTime, eiMetadata.getMeta("updatedTime")));
map.put("depCode",StringUtils.toString(depCode, eiMetadata.getMeta("depCode"))); map.put("depCode",StringUtils.toString(depCode, eiMetadata.getMeta("depCode")));
map.put("remark",StringUtils.toString(remark, eiMetadata.getMeta("remark"))); map.put("remark",StringUtils.toString(remark, eiMetadata.getMeta("remark")));
......
package com.baosight.hpjx.hp.sc.service; package com.baosight.hpjx.hp.sc.service;
import com.baosight.hpjx.core.dao.DaoUtils;
import com.baosight.hpjx.hp.constant.HPConstant;
import com.baosight.hpjx.hp.sc.domain.THPSC002; import com.baosight.hpjx.hp.sc.domain.THPSC002;
import com.baosight.hpjx.util.CommonMethod;
import com.baosight.iplat4j.core.ei.EiBlock; import com.baosight.iplat4j.core.ei.EiBlock;
import com.baosight.iplat4j.core.ei.EiConstant; import com.baosight.iplat4j.core.ei.EiConstant;
import com.baosight.iplat4j.core.ei.EiInfo; import com.baosight.iplat4j.core.ei.EiInfo;
...@@ -9,6 +12,7 @@ import com.baosight.iplat4j.core.service.impl.ServiceBase; ...@@ -9,6 +12,7 @@ import com.baosight.iplat4j.core.service.impl.ServiceBase;
import com.baosight.iplat4j.core.service.soa.XLocalManager; import com.baosight.iplat4j.core.service.soa.XLocalManager;
import com.baosight.iplat4j.core.web.threadlocal.UserSession; import com.baosight.iplat4j.core.web.threadlocal.UserSession;
import com.baosight.hpjx.hp.sc.domain.THPSC001; import com.baosight.hpjx.hp.sc.domain.THPSC001;
import com.baosight.iplat4j.ed.util.SequenceGenerator;
import java.text.SimpleDateFormat; import java.text.SimpleDateFormat;
import java.util.*; import java.util.*;
...@@ -46,18 +50,14 @@ public class ServiceHPSC001 extends ServiceBase { ...@@ -46,18 +50,14 @@ public class ServiceHPSC001 extends ServiceBase {
*/ */
@Override @Override
public EiInfo insert(EiInfo inInfo) { public EiInfo insert(EiInfo inInfo) {
SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss");
try { try {
THPSC001 hpsc001 = new THPSC001(); THPSC001 hpsc001 = new THPSC001();
EiBlock eiBlock = inInfo.getBlock(EiConstant.resultBlock); EiBlock eiBlock = inInfo.getBlock(EiConstant.resultBlock);
for (int i = 0; i < eiBlock.getRowCount(); i++) { for (int i = 0; i < eiBlock.getRowCount(); i++) {
Map<?, ?> map = eiBlock.getRow(i); Map<?, ?> map = eiBlock.getRow(i);
hpsc001.fromMap(map); hpsc001.fromMap(map);
hpsc001.setCreatedBy(UserSession.getUserId()); hpsc001.setProjCode(SequenceGenerator.getNextSequence(HPConstant.SequenceId.PROJ_NUMBER));
hpsc001.setCreatedTime(sdf.format(new Date())); DaoUtils.insert("HPSC001.insert",hpsc001);
hpsc001.setUpdatedBy(null);
hpsc001.setUpdatedTime(null);
this.dao.insert("HPSC001.insert", hpsc001.toMap());
} }
inInfo.setStatus(EiConstant.STATUS_SUCCESS); inInfo.setStatus(EiConstant.STATUS_SUCCESS);
inInfo.setMsg("新增成功!"); inInfo.setMsg("新增成功!");
...@@ -84,9 +84,7 @@ public class ServiceHPSC001 extends ServiceBase { ...@@ -84,9 +84,7 @@ public class ServiceHPSC001 extends ServiceBase {
for (int i = 0; i < eiBlock.getRowCount(); i++) { for (int i = 0; i < eiBlock.getRowCount(); i++) {
Map<?, ?> map = eiBlock.getRow(i); Map<?, ?> map = eiBlock.getRow(i);
hpsc001.fromMap(map); hpsc001.fromMap(map);
hpsc001.setUpdatedBy(UserSession.getUserId()); DaoUtils.update("HPSC001.insert",hpsc001);
hpsc001.setUpdatedTime(sdf.format(new Date()));
this.dao.update("HPSC001.update", hpsc001.toMap());
} }
inInfo.setStatus(EiConstant.STATUS_SUCCESS); inInfo.setStatus(EiConstant.STATUS_SUCCESS);
inInfo.setMsg("修改成功!"); inInfo.setMsg("修改成功!");
......
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE sqlMap PUBLIC "-//iBATIS.com//DTD SQL Map 2.0//EN" "http://www.ibatis.com/dtd/sql-map-2.dtd">
<!-- table information
Generate time : 2024-01-10 9:33:44
Version : 1.0
tableName :hpjx.t_hpsc001
ID BIGINT NOT NULL primarykey,
COMPANY_CODE VARCHAR NOT NULL,
PROJ_TYPE TINYINT,
PROJ_CODE VARCHAR,
PROJ_NAME VARCHAR,
PRINC1 VARCHAR,
PRINC2 VARCHAR,
STATUS TINYINT,
CREATED_BY VARCHAR,
CREATED_TIME DATETIME,
UPDATED_BY VARCHAR,
UPDATED_TIME DATETIME,
DEP_CODE VARCHAR
-->
<sqlMap namespace="HPSC001">
<select id="query" parameterClass="java.util.HashMap"
resultClass="com.baosight.iplat4j.hp.sc.domain.THPSC001">
SELECT
ID as "id",
COMPANY_CODE as "companyCode", <!-- 企业编码 预留 -->
PROJ_TYPE as "projType", <!-- 项目类型 -->
PROJ_CODE as "projCode", <!-- 项目编码 -->
PROJ_NAME as "projName", <!-- 项目名称 -->
PRINC1 as "princ1", <!-- 本公司项目负责人 -->
PRINC2 as "princ2", <!-- 客户项目负责人 -->
STATUS as "status", <!-- 状态 0-未审核,1-已审核 -->
CREATED_BY as "createdBy", <!-- 创建人 -->
CREATED_TIME as "createdTime", <!-- 创建时间 -->
UPDATED_BY as "updatedBy", <!-- 更新人 -->
UPDATED_TIME as "updatedTime", <!-- 更新时间 -->
DEP_CODE as "depCode" <!-- 部门编码 -->
FROM hpjx.t_hpsc001 WHERE 1=1
<isNotEmpty prepend=" AND " property="id">
ID = #id#
</isNotEmpty>
<isNotEmpty prepend=" AND " property="projType">
PROJ_TYPE = #projType#
</isNotEmpty>
<isNotEmpty prepend=" AND " property="projName">
PROJ_NAME = #projName#
</isNotEmpty>
<isNotEmpty prepend=" AND " property="status">
STATUS = #status#
</isNotEmpty>
<dynamic prepend="ORDER BY">
<isEmpty property="orderBy">
CREATED_TIME desc
</isEmpty>
</dynamic>
</select>
<select id="count" resultClass="int">
SELECT COUNT(*) FROM hpjx.t_hpsc001 WHERE 1=1
<isNotEmpty prepend=" AND " property="id">
ID = #id#
</isNotEmpty>
</select>
<!--
<isNotEmpty prepend=" AND " property="id">
ID = #id#
</isNotEmpty>
<isNotEmpty prepend=" AND " property="companyCode">
COMPANY_CODE = #companyCode#
</isNotEmpty>
<isNotEmpty prepend=" AND " property="projType">
PROJ_TYPE = #projType#
</isNotEmpty>
<isNotEmpty prepend=" AND " property="projCode">
PROJ_CODE = #projCode#
</isNotEmpty>
<isNotEmpty prepend=" AND " property="projName">
PROJ_NAME = #projName#
</isNotEmpty>
<isNotEmpty prepend=" AND " property="princ1">
PRINC1 = #princ1#
</isNotEmpty>
<isNotEmpty prepend=" AND " property="princ2">
PRINC2 = #princ2#
</isNotEmpty>
<isNotEmpty prepend=" AND " property="status">
STATUS = #status#
</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_hpsc001 (ID,
COMPANY_CODE, <!-- 企业编码 预留 -->
PROJ_TYPE, <!-- 项目类型 -->
PROJ_CODE, <!-- 项目编码 -->
PROJ_NAME, <!-- 项目名称 -->
PRINC1, <!-- 本公司项目负责人 -->
PRINC2, <!-- 客户项目负责人 -->
STATUS, <!-- 状态 0-未审核,1-已审核 -->
CREATED_BY, <!-- 创建人 -->
CREATED_TIME, <!-- 创建时间 -->
UPDATED_BY, <!-- 更新人 -->
UPDATED_TIME, <!-- 更新时间 -->
DEP_CODE <!-- 部门编码 -->
)
VALUES (#id#, #companyCode#, #projType#, #projCode#, #projName#, #princ1#, #princ2#, #status#, #createdBy#, #createdTime#, #updatedBy#, #updatedTime#, #depCode#)
</insert>
<delete id="delete">
DELETE FROM hpjx.t_hpsc001 WHERE
ID = #id#
</delete>
<update id="update">
UPDATE hpjx.t_hpsc001
SET
COMPANY_CODE = #companyCode#, <!-- 企业编码 预留 -->
PROJ_TYPE = #projType#, <!-- 项目类型 -->
PROJ_CODE = #projCode#, <!-- 项目编码 -->
PROJ_NAME = #projName#, <!-- 项目名称 -->
PRINC1 = #princ1#, <!-- 本公司项目负责人 -->
PRINC2 = #princ2#, <!-- 客户项目负责人 -->
STATUS = #status#, <!-- 状态 0-未审核,1-已审核 -->
CREATED_BY = #createdBy#, <!-- 创建人 -->
CREATED_TIME = #createdTime#, <!-- 创建时间 -->
UPDATED_BY = #updatedBy#, <!-- 更新人 -->
UPDATED_TIME = #updatedTime#, <!-- 更新时间 -->
DEP_CODE = #depCode# <!-- 部门编码 -->
WHERE
ID = #id#
</update>
</sqlMap>
\ No newline at end of file
...@@ -157,7 +157,7 @@ public class AssertUtils { ...@@ -157,7 +157,7 @@ public class AssertUtils {
* @param message * @param message
*/ */
public static void isGt(BigDecimal a, BigDecimal b, String message) { public static void isGt(BigDecimal a, BigDecimal b, String message) {
if (a.compareTo(b) < 1) { if (a.compareTo(b) == 1) {
throw new PlatException(message); throw new PlatException(message);
} }
} }
......
package com.baosight.hpjx.util;
import org.apache.commons.lang3.StringUtils;
import java.math.BigDecimal;
import java.math.RoundingMode;
import java.util.Arrays;
import java.util.HashMap;
import java.util.Iterator;
import java.util.List;
import java.util.Map;
/**
* @author:songx
* @date:2021/7/24,14:45
*/
public class MapUtils extends org.apache.commons.collections.MapUtils {
/**
* 获取字符串
*
* @param map
* @param key
* @return
*/
public static String getString(final Map map, final Object key) {
if (map != null) {
Object answer = map.get(key);
if (answer != null) {
return answer.toString();
}
}
return "";
}
/**
* 获取字符串
*
* @param map
* @param key
* @return
*/
public static String getStringIgnoreCase(final Map map, final Object key) {
if (map == null || key == null) {
return null;
}
Object answer = map.get(key.toString().toLowerCase());
if (answer == null) {
answer = map.get(key.toString().toUpperCase());
}
return answer != null ? answer.toString() : null;
}
/**
* 获取字段串,为空时返回空格字符串
*
* @param map
* @param key
* @return
*/
public static String getEmpty(final Map map, final Object key) {
if (map == null) {
return " ";
}
Object answer = map.get(key);
return ObjectUtils.toEmptyString(answer);
}
/**
* 获取集合
*
* @param map
* @param key
* @return
*/
public static <T> List<T> getList(final Map map, final Object key) {
if (map == null) {
return null;
}
Object answer = map.get(key);
if (answer == null) {
return null;
} else if (answer instanceof String[]) {
return Arrays.asList((T[]) answer);
} else if (answer instanceof List) {
return (List<T>) answer;
} else {
return null;
}
}
/**
* 获取字段串,为空时返回空格字符串
*
* @param map
* @param key
* @return
*/
public static BigDecimal getBigDecimal(final Map map, final Object key) {
return getBigDecimal(map, key, null);
}
/**
* 获取字段串,为空时返回空格字符串
*
* @param map
* @param key
* @return
*/
public static BigDecimal getBigDecimal(final Map map, final Object key, final Integer scale) {
if (map == null) {
return null;
}
Object answer = map.get(key);
if (answer == null || StringUtils.isBlank(answer.toString())) {
return null;
}
BigDecimal result;
if (answer instanceof BigDecimal) {
result = (BigDecimal) answer;
} else {
result = new BigDecimal(answer.toString());
}
if (scale != null) {
result = result.setScale(scale, RoundingMode.HALF_UP);
}
return result;
}
/**
* 复制map对象
*
* @param paramsMap 被拷贝对象
* @explain 将paramsMap中的键值对全部拷贝到resultMap中;
* paramsMap中的内容不会影响到resultMap(深拷贝)
*/
public static Map copy(Map paramsMap) {
Map resultMap = new HashMap();
if (paramsMap == null) {
return resultMap;
}
Iterator it = paramsMap.entrySet().iterator();
while (it.hasNext()) {
Map.Entry entry = (Map.Entry) it.next();
Object key = entry.getKey();
resultMap.put(key, paramsMap.get(key) != null ? paramsMap.get(key) : "");
}
return resultMap;
}
}
...@@ -2,6 +2,7 @@ package com.baosight.hpjx.util; ...@@ -2,6 +2,7 @@ package com.baosight.hpjx.util;
import org.apache.commons.collections.MapUtils; import org.apache.commons.collections.MapUtils;
import org.apache.commons.lang.StringUtils; import org.apache.commons.lang.StringUtils;
import org.apache.poi.ss.formula.functions.T;
import java.util.List; import java.util.List;
import java.util.Map; import java.util.Map;
...@@ -95,8 +96,8 @@ public class ObjectUtils extends org.apache.commons.lang.ObjectUtils { ...@@ -95,8 +96,8 @@ public class ObjectUtils extends org.apache.commons.lang.ObjectUtils {
* @param keyName * @param keyName
* @return * @return
*/ */
public static List<String> listKey(List<Map> items, String keyName) { public static <T> List<T> listKey(List<Map> items, String keyName) {
return items.stream().map(item -> MapUtils.getString(item, keyName)).collect(Collectors.toList()); return items.stream().map(item -> (T) item.get(keyName)).collect(Collectors.toList());
} }
} }
package com.baosight.iplat4j.core.data.ibatis.dao;
import com.baosight.hpjx.core.security.UserSessionUtils;
import com.baosight.hpjx.util.ObjectUtils;
import com.baosight.iplat4j.core.service.soa.DomainQuery.PageStatus;
import com.baosight.iplat4j.core.util.ExceptionUtil;
import java.util.Collection;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
/**
* @author:songx
* @date:2024/1/24,9:00
*/
public class SqlMapDaoLogProxy extends SqlMapDao {
public static final String QUERY = "query";
public SqlMapDaoLogProxy() {
}
public List query(String name, Object parameters) {
try {
// 初始化参数
this.initParam(name, parameters);
List ret = super.query(name, parameters);
return ret;
} catch (RuntimeException var4) {
throw var4;
}
}
public List queryAll(String name, Object parameters) {
try {
// 初始化参数
this.initParam(name, parameters);
List ret = super.queryAll(name, parameters);
return ret;
} catch (RuntimeException var4) {
throw var4;
}
}
public List query(String name, Object parameters, int offset, int limit) {
try {
// 初始化参数
this.initParam(name, parameters);
List ret = super.query(name, parameters, offset, limit);
return ret;
} catch (RuntimeException var6) {
throw var6;
}
}
public List query(String name, Object parameters, PageStatus pageStatus) {
int limit = pageStatus.getPageSize();
int offset = pageStatus.getPageNumber() * pageStatus.getPageSize();
try {
List ret = super.query(name, parameters, offset, limit);
return ret;
} catch (RuntimeException var7) {
ExceptionUtil.getRootCauseMessage(var7);
throw var7;
}
}
public int count(String name, Object parameters) {
String var3 = this.autoCount ? "query" : "count";
try {
// 初始化参数
this.initParam(name, parameters);
int ret = super.count(name, parameters);
return ret;
} catch (RuntimeException var5) {
throw var5;
}
}
public void insert(String name, Object object) {
String var3 = "insert";
try {
super.insert(name, object);
} catch (RuntimeException var5) {
throw var5;
}
}
public int update(String name, Object object) {
String var3 = "update";
try {
int ret = super.update(name, object);
return ret;
} catch (RuntimeException var5) {
throw var5;
}
}
public int delete(String name, Object parameters) {
String var3 = "delete";
try {
int ret = super.delete(name, parameters);
return ret;
} catch (RuntimeException var5) {
throw var5;
}
}
public int insertBatch(String name, Collection parameters) {
String operation = "insert";
try {
this.getStatementName(operation, name);
int ret = super.insertBatch(name, parameters);
return ret;
} catch (RuntimeException var5) {
throw var5;
}
}
public int updateBatch(String name, Collection parameters) {
String operation = "update";
try {
this.getStatementName(operation, name);
int ret = super.updateBatch(name, parameters);
return ret;
} catch (RuntimeException var5) {
throw var5;
}
}
public int deleteBatch(String name, Collection parameters) {
String operation = "delete";
try {
this.getStatementName(operation, name);
int ret = super.deleteBatch(name, parameters);
return ret;
} catch (RuntimeException var5) {
throw var5;
}
}
/**
* 初始化参数
*
* @param name
* @param parameters
*/
private void initParam(String name, Object parameters) {
// 查询登录用户信息时不设置企业编码,否则会形成死循环
if ("HPXSUser.query".equals(name)) {
return;
}
if (parameters == null) {
parameters = new HashMap();
}
// 企业编码
((Map) parameters).put("companyCode", UserSessionUtils.getCompanyCode());
// 部门编码
// ((Map) parameters).put("depCode", UserSessionUtils.getDepCode());
}
}
...@@ -19,29 +19,13 @@ $(function() { ...@@ -19,29 +19,13 @@ $(function() {
return ""; return "";
}, },
editor: function (container, options) { editor: function (container, options) {
var grid = container.closest(".k-grid").data("kendoGrid"); let inInfo = new EiInfo();
var cellIndex = grid.cellIndex(container); inInfo.set("inventType", options.model["inventType"]);
var input = $('<input />'); inInfo.set("serviceName", "HPPZ006");
input.attr("name", options.field); inInfo.set("methodName", "queryMaterialComboBox");
input.attr("id", options.field); inInfo.set("blockId", "material_record_block_id");
input.appendTo(container); inInfo.set("field", options.field);
let eiInfo = new EiInfo(); refreshSelect(container, inInfo);
eiInfo.set("inventType", options.model["inventType"]);
var dataSource;
EiCommunicator.send("HPPZ006", "queryMaterialComboBox", eiInfo, {
onSuccess: function (ei) {
dataSource = ei.getBlock("material_record_block_id").getMappedRows();
},
onFail: function (ei) {
}
}, {async: false});
input.kendoDropDownList({
valuePrimitive: true,
dataTextField: "textField",
dataValueField: "valueField",
dataSource: dataSource,
template: "#=textField#"
});
} }
}, { }, {
field: "inventRecordId", field: "inventRecordId",
...@@ -54,30 +38,13 @@ $(function() { ...@@ -54,30 +38,13 @@ $(function() {
return ""; return "";
}, },
editor: function (container, options) { editor: function (container, options) {
refreshsel let inInfo = new EiInfo();
var grid = container.closest(".k-grid").data("kendoGrid"); inInfo.set("inqu_status-0-inventCode", options.model["inventCode"]);
var cellIndex = grid.cellIndex(container); inInfo.set("serviceName", "HPPZ006");
var input = $('<input />'); inInfo.set("methodName", "queryComboBoxSpec");
input.attr("name", options.field); inInfo.set("blockId", "invent_spec_block_id");
input.attr("id", options.field); inInfo.set("field", options.field);
input.appendTo(container); refreshSelect(container, inInfo);
let eiInfo = new EiInfo();
eiInfo.set("inqu_status-0-inventCode", options.model["inventCode"]);
var dataSource;
EiCommunicator.send("HPPZ006", "queryComboBoxSpec", eiInfo, {
onSuccess: function (ei) {
dataSource = ei.getBlock("invent_spec_block_id").getMappedRows();
},
onFail: function (ei) {
}
}, {async: false});
input.kendoDropDownList({
valuePrimitive: true,
dataTextField: "textField",
dataValueField: "valueField",
dataSource: dataSource,
template: "#=textField#"
});
} }
}], }],
loadComplete: function (grid) { loadComplete: function (grid) {
......
...@@ -49,16 +49,16 @@ ...@@ -49,16 +49,16 @@
<EF:EFCodeOption codeName="hpjx.hpkc.inventType"/> <EF:EFCodeOption codeName="hpjx.hpkc.inventType"/>
</EF:EFComboColumn> </EF:EFComboColumn>
<EF:EFColumn ename="inventCode" cname="存货名称" width="120" align="center" required="true"/> <EF:EFColumn ename="inventCode" cname="存货名称" width="120" align="center" required="true"/>
<EF:EFColumn ename="inventRecordId" cname="规格" width="120" align="center"/> <EF:EFColumn ename="inventRecordId" cname="规格" width="120" align="center" required="true"/>
<EF:EFColumn ename="amount" cname="数量" format="{0:N3}" maxLength="20" width="100" align="right" <EF:EFColumn ename="amount" cname="数量" format="{0:N3}" maxLength="20" width="100" align="right"
sumType="all" required="true"/> sumType="all" required="true"/>
<EF:EFColumn ename="weight" cname="重量" format="{0:N3}" maxLength="20" width="100" align="right" <EF:EFColumn ename="weight" cname="重量" format="{0:N3}" maxLength="20" width="100" align="right"
sumType="all" required="true"/> sumType="all" required="true"/>
<EF:EFColumn ename="notes" cname="备注" width="100"/> <EF:EFColumn ename="remark" cname="备注" width="150" maxLength="255"/>
<EF:EFColumn ename="createdBy" cname="创建人" enable="false" width="100" align="center"/> <EF:EFColumn ename="createdBy" cname="创建人" enable="false" width="100" align="center"/>
<EF:EFColumn ename="createdTime" cname="创建时刻" enable="false" width="140" align="center" <EF:EFColumn ename="createdTime" cname="创建时刻" enable="false" width="140" align="center"
editType="datetime" parseFormats="['yyyyMMddHHmmss']"/> editType="datetime" parseFormats="['yyyyMMddHHmmss']"/>
</EF:EFGrid> </EF:EFGrid>
</EF:EFRegion> </EF:EFRegion>
</EF:EFPage> </EF:EFPage>
\ No newline at end of file
$(function () { var inventNameGlobalData = [];
var specGlobalData = [];
$(function() {
$("#QUERY").on("click", function () { IPLATUI.EFGrid = {
resultGrid.dataSource.page(1); pageable: {
}); pageSize: 20,
pageSizes: [10, 20, 50, 70, 100],
},
"result": {
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) {
let inInfo = new EiInfo();
inInfo.set("inventType", options.model["inventType"]);
inInfo.set("serviceName", "HPPZ006");
inInfo.set("methodName", "queryMaterialComboBox");
inInfo.set("blockId", "material_record_block_id");
inInfo.set("field", options.field);
refreshSelect(container, inInfo);
}
}, {
field: "inventRecordId",
template: function (dataItem) {
for (let i = 0; i < specGlobalData.length; i++) {
if (specGlobalData[i]['valueField'] === dataItem['inventRecordId']) {
return specGlobalData[i]['textField'];
}
}
return "";
},
editor: function (container, options) {
let inInfo = new EiInfo();
inInfo.set("inqu_status-0-inventCode", options.model["inventCode"]);
inInfo.set("serviceName", "HPPZ006");
inInfo.set("methodName", "queryComboBoxSpec");
inInfo.set("blockId", "invent_spec_block_id");
inInfo.set("field", options.field);
refreshSelect(container, inInfo);
}
}],
loadComplete: function (grid) {
}
}
}
// 查询
$("#QUERY").on("click", query);
// 挑选库存
$("#SELECT_STOCK").on("click", selectStock);
IPLATUI.EFGrid.result = { });
pageable: {
pageSize: 20, /**
pageSizes: [10, 20, 30, 50, 100, 200], * 页面加载时执行
}, */
} $(window).load(function () {
}); // 存货名称
\ No newline at end of file let eiInfo = new EiInfo();
EiCommunicator.send("HPPZ004", "queryComboBox", eiInfo, {
onSuccess: function (ei) {
inventNameGlobalData = ei.getBlock("invent_name_block_id").getMappedRows();
},
onFail: function (ei) {
}
}, {async: false});
// 规格
EiCommunicator.send("HPPZ006", "queryComboBoxSpec", eiInfo, {
onSuccess: function (ei) {
specGlobalData = ei.getBlock("invent_spec_block_id").getMappedRows();
},
onFail: function (ei) {
}
}, {async: false});
// 查询
query();
});
/**
* 查询
*/
let query = function () {
resultGrid.dataSource.page(1); // 点击查询按钮,从第1页开始查询
}
/**
* 挑选库存
*/
let selectStock = function () {
JSColorbox.open({
href: "HPKC007A?methodName=initLoad",
title: "<div style='text-align: center;'>库存查询</div>",
width: "90%",
height: "80%",
callbackName: selectStockCallback
});
}
/**
* 挑选库存回调
*/
let selectStockCallback = function () {
// 刷新页面
query();
// 关闭弹窗
JSColorbox.close();
}
...@@ -4,58 +4,61 @@ ...@@ -4,58 +4,61 @@
<%@ taglib prefix="EF" tagdir="/WEB-INF/tags/EF" %> <%@ taglib prefix="EF" tagdir="/WEB-INF/tags/EF" %>
<c:set var="ctx" value="${pageContext.request.contextPath}"/> <c:set var="ctx" value="${pageContext.request.contextPath}"/>
<head>
<%-- <link rel="stylesheet" href="${ctx}/css/simulatedOperation.css"/>--%>
</head>
<EF:EFPage title="仓库档案">
<EF:EFRegion id="inqu" title="查询条件"><%-- type="query" efRegionShowClear="true" efRegionSave="true"--%>
<style>
.row {
display: flex;
justify-content: space-between;
align-items: center;
}
</style>
<div class="row"> <%-- blockId="inqu_status" row="0" --%>
<EF:EFDatePicker ename="receiptDate" cname="单据日期"
format="yyyy-MM-dd" depth="year" />
<EF:EFInput blockId="inqu_status" ename="otherEnthouse" cname="其他出库单号" row="0"/>
<EF:EFInput blockId="inqu_status" ename="whName" cname="仓库名称" row="0"/>
<EF:EFSelect cname="单据状态" optionLabel="全部" blockId="inqu_status" ename="status" row="0">
<EF:EFOption label="审核" value="1"/>
<EF:EFOption label="反审" value="0"/>
</EF:EFSelect>
</div>
<EF:EFPage title="其他出库单">
<EF:EFRegion id="inqu" title="查询条件">
<div class="row">
<EF:EFDatePicker cname="单据日期" ename="inqu_status-0-receiptDate" colWidth="3"
role="date" format="yyyy-MM-dd" readonly="true"/>
<EF:EFInput cname="出库单号" ename="inqu_status-0-otherOuterNo" colWidth="3"/>
<EF:EFSelect ename="inqu_status-0-whCode" cname="仓库名称" colWidth="3" filter="contains" defultValue="">
<EF:EFOption label="全部" value=""/>
<EF:EFOptions blockId="wh_record_block_id" textField="textField" valueField="valueField"/>
</EF:EFSelect>
<EF:EFSelect cname="存货类型" ename="inqu_status-0-inventType" colWidth="3" filter="contains"
template="#=textField#" valueTemplate="#=textField#">
<EF:EFOption label="全部" value=""/>
<EF:EFCodeOption codeName="hpjx.hpkc.inventType"/>
</EF:EFSelect>
</div>
<div class="row">
<EF:EFSelect cname="存货名称" ename="inqu_status-0-inventCode" colWidth="3" filter="contains" defultValue="">
<EF:EFOption label="全部" value=""/>
<EF:EFOptions blockId="invent_name_block_id" textField="textField" valueField="valueField"/>
</EF:EFSelect>
<EF:EFSelect ename="inqu_status-0-spec" cname="规格" colWidth="3" filter="contains" defultValue="">
<EF:EFOption label="全部" value=""/>
<EF:EFOptions blockId="spec_name_block_id" textField="textField" valueField="valueField"/>
</EF:EFSelect>
</div>
</EF:EFRegion> </EF:EFRegion>
<EF:EFRegion id="result" title="记录集"> <EF:EFRegion id="result" title="记录集">
<EF:EFGrid blockId="result" autoDraw="no"> <EF:EFGrid blockId="result" autoDraw="no">
<EF:EFColumn ename="id" cname="主键" hidden="true"/> <EF:EFColumn ename="id" cname="主键" hidden="true"/>
<EF:EFColumn ename="otherOuterNo" cname="出库单号" enable="false" width="130" align="center"/>
<EF:EFColumn ename="receiptTime" cname="单据日期"/> <EF:EFColumn ename="receiptDate" cname="单据日期" enable="false" editType="date" dateFormat="yyyy-MM-dd"
<EF:EFColumn ename="otherEnthouse" cname="其他出库单号"/> parseFormats="['yyyyMMdd']" width="90" align="center" required="true"/>
<EF:EFColumn ename="whCode" cname="仓库编码"/> <EF:EFComboColumn ename="whCode" cname="仓库编码" enable="false" width="120"
<EF:EFColumn ename="whName" cname="仓库名称"/> columnTemplate="#=textField#" itemTemplate="#=textField#"
<EF:EFColumn ename="matType" cname="物料类型"/> blockName="wh_record_block_id"
<EF:EFColumn ename="matCode" cname="物料编码"/> textField="textField" valueField="valueField"
<EF:EFColumn ename="matName" cname="物料名称"/> align="center" filter="contains">
<EF:EFColumn ename="amount" cname="数量"/> </EF:EFComboColumn>
<EF:EFColumn ename="weight" cname="重量"/> <EF:EFComboColumn ename="inventType" cname="存货类型" enable="false" width="100" align="center"
<EF:EFComboColumn align="center" ename="status" cname="操作"> columnTemplate="#=valueField#-#=textField#" itemTemplate="#=valueField#-#=textField#">
<EF:EFOption label="审核" value="1"/> <EF:EFCodeOption codeName="hpjx.hpkc.inventType"/>
<EF:EFOption label="反审" value="0"/> </EF:EFComboColumn>
</EF:EFComboColumn> <EF:EFColumn ename="inventCode" cname="存货名称" enable="false" width="120" align="center"/>
<EF:EFColumn ename="remark" cname="备注"/> <EF:EFColumn ename="inventRecordId" cname="规格" enable="false" width="120" align="center"/>
<EF:EFColumn ename="amount" cname="数量" enable="false" format="{0:N3}" maxLength="20" width="100"
align="right" sumType="all" required="true"/>
<EF:EFColumn ename="weight" cname="重量" enable="false" format="{0:N3}" maxLength="20" width="100"
align="right" sumType="all" required="true"/>
<EF:EFColumn ename="remark" cname="备注" enable="false" width="150"/>
<EF:EFColumn ename="createdBy" cname="创建人" enable="false" width="100" align="center"/>
<EF:EFColumn ename="createdTime" cname="创建时刻" enable="false" width="140" align="center"
editType="datetime" parseFormats="['yyyyMMddHHmmss']"/>
</EF:EFGrid> </EF:EFGrid>
</EF:EFRegion> </EF:EFRegion>
</EF:EFPage> </EF:EFPage>
<script>
var ctx = "${ctx}";
</script>
<script src="${ctx}/HP/KC/HPKC007.js"></script>
$(function () {
IPLATUI.EFGrid = {
"result": {
columns: [],
dataBound: function () {
}
}
};
$("#ef_form_head").hide();
// 查询
$("#QUERY").on("click", query);
// 选择
$("#BTN_SELECT").on("click", select);
});
/**
* 页面加载时执行
*/
$(window).load(function () {
// 初始化查询
query();
});
/**
* 查询
*/
var query = function (e) {
resultGrid.dataSource.page(1);
};
/**
* 选择库存
*/
let select = function () {
let rows = resultGrid.getCheckedRows();
if (rows.length < 1) {
message("请选择数据")
return;
}
for (let i = 0; i < rows.length; i++) {
let applyAmount = rows[i]['applyAmount'];
let amount = rows[i]['amount'];
if (isBlank(applyAmount) || !isNumber(applyAmount) || !(applyAmount > 0)) {
message("第" + (i + 1) + "行申请数量必须是大于0的数");
return;
}
if (parseFloat(applyAmount) > parseFloat(amount)) {
message("第" + (i + 1) + "行申请数量不能大于库存数量");
return;
}
}
JSUtils.confirm("确定对勾选中的[" + rows.length + "]条数据生成出库单吗? ", {
ok: function () {
JSUtils.submitGridsData("result", "HPKC007A", "select",
true, function (e) {
var status = e.getStatus();
if (status !== -1) {
parent.JSColorbox.setValueCallback();
}
}
);
}
});
}
<!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="查询区域" type="query">
<div class="row">
<EF:EFDatePicker cname="单据日期" ename="inqu_status-0-receiptDate" colWidth="3"
role="date" format="yyyy-MM-dd" readonly="true"/>
<EF:EFInput cname="入库单号" ename="inqu_status-0-otherEnterNo" colWidth="3"/>
<EF:EFSelect cname="仓库名称" ename="inqu_status-0-whCode" colWidth="3" filter="contains">
<EF:EFOption label="全部" value=""/>
<EF:EFOptions blockId="wh_record_block_id" textField="textField" valueField="valueField"/>
</EF:EFSelect>
<EF:EFSelect cname="存货类型" ename="inqu_status-0-inventType" colWidth="3" filter="contains"
template="#=valueField#-#=textField#" valueTemplate="#=valueField#-#=textField#">
<EF:EFOption label="全部" value=""/>
<EF:EFCodeOption codeName="hpjx.hpkc.inventType"/>
</EF:EFSelect>
</div>
<div class="row">
<EF:EFSelect cname="存货名称" ename="inqu_status-0-inventCode" colWidth="3" filter="contains">
<EF:EFOption label="全部" value=""/>
<EF:EFOptions blockId="invent_name_block_id" textField="textField" valueField="valueField"/>
</EF:EFSelect>
<EF:EFSelect ename="inqu_status-0-spec" cname="规格" colWidth="3" filter="contains">
<EF:EFOption label="全部" value=""/>
<EF:EFOptions blockId="spec_name_block_id" textField="textField" valueField="valueField"/>
</EF:EFSelect>
</div>
</EF:EFRegion>
<EF:EFRegion id="result" title="记录集">
<EF:EFGrid blockId="result" autoDraw="override" checkMode="row">
<EF:EFColumn ename="id" cname="库存ID" enable="false" width="60" align="center"/>
<EF:EFComboColumn ename="whCode" cname="仓库名称" enable="false" width="120" align="center"
columnTemplate="#=textField#" itemTemplate="#=textField#"
blockName="wh_record_block_id"
textField="textField" valueField="valueField">
</EF:EFComboColumn>
<EF:EFComboColumn ename="inventType" cname="存货类型" enable="false" width="100" align="center"
columnTemplate="#=valueField#-#=textField#" itemTemplate="#=valueField#-#=textField#">
<EF:EFCodeOption codeName="hpjx.hpkc.inventType"/>
</EF:EFComboColumn>
<EF:EFComboColumn ename="inventCode" cname="存货名称" enable="false" width="120" align="center"
columnTemplate="#=textField#" itemTemplate="#=textField#"
blockName="invent_name_block_id"
textField="textField" valueField="valueField">
</EF:EFComboColumn>
<EF:EFComboColumn ename="inventRecordId" cname="规格" enable="false" width="120" align="center"
columnTemplate="#=textField#" itemTemplate="#=textField#"
blockName="invent_spec_block_id"
textField="textField" valueField="valueField">
</EF:EFComboColumn>
<EF:EFColumn ename="applyAmount" cname="申请数量" width="120" align="right" format="{0:N3}" required="true"/>
<EF:EFColumn ename="applyWeight" cname="申请重量" width="120" align="right" format="{0:N3}" required="true"/>
<EF:EFColumn ename="applyRemark" cname="说明" enable="false" width="150" editType="textarea" copy="true"/>
<EF:EFColumn ename="amount" cname="库存数量" enable="false" width="120" align="right" format="{0:N3}"
sumType="all"/>
<EF:EFColumn ename="weight" cname="库存重量" enable="false" width="120" align="right" format="{0:N3}"
sumType="all"/>
<EF:EFColumn ename="remark" cname="备注" enable="false" width="150"/>
</EF:EFGrid>
</EF:EFRegion>
</EF:EFPage>
...@@ -4,9 +4,6 @@ $(function() { ...@@ -4,9 +4,6 @@ $(function() {
// 查询 // 查询
$("#QUERY").on("click", query); $("#QUERY").on("click", query);
// 保存
$("#BTN_SAVE").on("click", save);
IPLATUI.EFGrid = { IPLATUI.EFGrid = {
"result": { "result": {
columns: [{ columns: [{
...@@ -18,31 +15,6 @@ $(function() { ...@@ -18,31 +15,6 @@ $(function() {
} }
} }
return ""; 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("HPPZ006", "queryMaterialComboBox", eiInfo, {
onSuccess: function (ei) {
dataSource = ei.getBlock("material_record_block_id").getMappedRows();
},
onFail: function (ei) {
}
}, {async: false});
input.kendoDropDownList({
valuePrimitive: true,
dataTextField: "textField",
dataValueField: "valueField",
dataSource: dataSource,
template: "#=textField#"
});
} }
}, { }, {
field: "spec", field: "spec",
...@@ -53,31 +25,6 @@ $(function() { ...@@ -53,31 +25,6 @@ $(function() {
} }
} }
return ""; 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("inqu_status-0-inventCode", options.model["inventCode"]);
var dataSource;
EiCommunicator.send("HPPZ006", "queryComboBoxSpec", eiInfo, {
onSuccess: function (ei) {
dataSource = ei.getBlock("invent_spec_block_id").getMappedRows();
},
onFail: function (ei) {
}
}, {async: false});
input.kendoDropDownList({
valuePrimitive: true,
dataTextField: "textField",
dataValueField: "valueField",
dataSource: dataSource,
template: "#=textField#"
});
} }
}, { }, {
field: "material", field: "material",
...@@ -99,45 +46,7 @@ $(function() { ...@@ -99,45 +46,7 @@ $(function() {
} }
return ""; return "";
} }
}], }]
loadComplete: function (grid) {
//删除
$("#DELETE").on("click", function () {
var btnNode = $(this);
//禁用按钮
btnNode.attr("disabled", true);
var dataItems = resultGrid.getCheckedRows();
if (dataItems == null || dataItems == "") {
NotificationUtil({
msg: '选择要删除的数据'
}, "warning");
//释放禁用按钮
btnNode.attr("disabled", false);
return false;
}
IPLAT.submitNode($("#HPKC010"), "HPKC010", "delete", {
onSuccess: function (ei) {
if (ei["status"] == -1) {
NotificationUtil(ei, "error");
} else {
NotificationUtil({
msg: '删除成功'
});
// 绑定grid
resultGrid.setEiInfo(ei);
}
//释放禁用按钮
btnNode.attr("disabled", false);
},
onFail: function (ei) {
// 发生异常
console.log(ei);
//释放禁用按钮
btnNode.attr("disabled", false);
}
});
});
}
}, },
}; };
}); });
...@@ -174,19 +83,3 @@ let query = function () { ...@@ -174,19 +83,3 @@ let query = function () {
resultGrid.dataSource.page(1); // 点击查询按钮,从第1页开始查询 resultGrid.dataSource.page(1); // 点击查询按钮,从第1页开始查询
} }
/**
* 保存
*/
let save = function () {
let rows = resultGrid.getCheckedRows();
if (rows.length < 1) {
message("请选择数据");
return;
}
JSUtils.confirm("确定对勾选中的[" + rows.length + "]条数据做\"保存\"操作? ", {
ok: function () {
JSUtils.submitGridsData("result", "HPKC010", "save", true);
}
});
}
...@@ -8,17 +8,24 @@ ...@@ -8,17 +8,24 @@
<EF:EFPage title="实时库存管理"> <EF:EFPage title="实时库存管理">
<EF:EFRegion id="inqu" title="查询条件"> <EF:EFRegion id="inqu" title="查询条件">
<div class="row"> <div class="row">
<EF:EFDatePicker ename="inqu_status-0-receiptDate" cname="单据日期" <EF:EFSelect ename="inqu_status-0-whCode" cname="仓库名称" colWidth="3" filter="contains" defultValue="">
role="date" format="yyyy-MM-dd" readonly="true"/> <EF:EFOption label="全部" value=""/>
<EF:EFSelect ename="inqu_status-0-inventType" cname="存货类型" filter="contains" defaultValue=""> <EF:EFOptions blockId="wh_record_block_id" textField="textField" valueField="valueField"/>
<EF:EFOption label="请选择" value=""/> </EF:EFSelect>
<EF:EFSelect ename="inqu_status-0-inventType" cname="存货类型" colWidth="3" filter="contains"
template="#=valueField#-#=textField#" valueTemplate="#=valueField#-#=textField#">
<EF:EFOption label="全部" value=""/>
<EF:EFCodeOption codeName="hpjx.hpkc.inventType"/> <EF:EFCodeOption codeName="hpjx.hpkc.inventType"/>
</EF:EFSelect> </EF:EFSelect>
<EF:EFSelect ename="inqu_status-0-whCode" cname="仓库名称" filter="contains" defultValue=""> <EF:EFSelect ename="inqu_status-0-inventCode" cname="存货名称" colWidth="3" filter="contains" defultValue="">
<EF:EFOption label="请选择" value=""/> <EF:EFOption label="全部" value=""/>
<EF:EFOptions blockId="wh_record_block_id" textField="textField" valueField="valueField"/> <EF:EFOptions blockId="material_record_block_id" textField="textField" valueField="valueField"/>
</EF:EFSelect> </EF:EFSelect>
</div> <EF:EFSelect ename="inqu_status-0-spec" cname="规格" colWidth="3" filter="contains" defultValue="">
<EF:EFOption label="全部" value=""/>
<EF:EFOptions blockId="spec_name_block_id" textField="textField" valueField="valueField"/>
</EF:EFSelect>
</div>
</EF:EFRegion> </EF:EFRegion>
<EF:EFRegion id="result" title="明细信息"> <EF:EFRegion id="result" title="明细信息">
......
...@@ -7,12 +7,16 @@ ...@@ -7,12 +7,16 @@
<head> <head>
<%-- <link rel="stylesheet" href="${ctx}/css/simulatedOperation.css"/>--%> <%-- <link rel="stylesheet" href="${ctx}/css/simulatedOperation.css"/>--%>
</head> </head>
<EF:EFPage title="项目档案"> <EF:EFPage title="销售管理">
<EF:EFRegion id="inqu" title="查询条件"><%-- type="query" efRegionShowClear="true" efRegionSave="true"--%> <EF:EFRegion id="inqu" title="查询条件">
<div class="row"> <%-- blockId="inqu_status" row="0" --%> <div class="row">
<EF:EFInput blockId="inqu_status" ename="projType" cname="项目类型:" row="0"/> <EF:EFSelect ename="inqu_status-0-projType" cname="项目类型" colWidth="3" filter="contains"
template="#=valueField#-#=textField#" valueTemplate="#=valueField#-#=textField#">
<EF:EFOption label="全部" value=""/>
<EF:EFCodeOption codeName="hpjx.hpsc.projType"/>
</EF:EFSelect>
<EF:EFInput blockId="inqu_status" ename="projName" cname="项目名称:" row="0"/> <EF:EFInput blockId="inqu_status" ename="projName" cname="项目名称:" row="0"/>
<EF:EFSelect cname="单据状态:" optionLabel="全部" blockId="inqu_status" ename="status" row="0"> <EF:EFSelect cname="单据状态:" optionLabel="全部" blockId="inqu_status" ename="status" row="0">
<EF:EFOption label="未审核" value="0"/> <EF:EFOption label="未审核" value="0"/>
...@@ -25,12 +29,15 @@ ...@@ -25,12 +29,15 @@
<EF:EFRegion id="result" title="记录集"> <EF:EFRegion id="result" title="记录集">
<EF:EFGrid blockId="result" autoDraw="no"> <EF:EFGrid blockId="result" autoDraw="no">
<EF:EFColumn ename="id" cname="主键" hidden="true"/> <EF:EFColumn ename="id" cname="主键" hidden="true"/>
<EF:EFColumn ename="projType" required='true' cname="项目类型"/> <EF:EFComboColumn ename="projType" cname="项目类型" width="100" align="center" required="true"
<EF:EFColumn required="true" ename="projCode" cname="项目编码"/> columnTemplate="#=valueField#-#=textField#" itemTemplate="#=valueField#-#=textField#">
<EF:EFCodeOption codeName="hpjx.hpsc.projType"/>
</EF:EFComboColumn>
<EF:EFColumn ename="projCode" enable="false" cname="项目编码"/>
<EF:EFColumn required="true" ename="projName" cname="项目名称"/> <EF:EFColumn required="true" ename="projName" cname="项目名称"/>
<EF:EFColumn required="true" ename="princ1" cname="本公司项目负责人"/> <EF:EFColumn required="true" ename="princ1" cname="本公司项目负责人"/>
<EF:EFColumn required="true" ename="princ2" cname="客户项目负责人"/> <EF:EFColumn required="true" ename="princ2" cname="客户项目负责人"/>
<EF:EFComboColumn required="true" align="center" ename="status" cname="状态"> <EF:EFComboColumn required="true" align="center" ename="status" cname="状态" defaultValue="0">
<EF:EFOption label="未审核" value="0"/> <EF:EFOption label="未审核" value="0"/>
<EF:EFOption label="已审核" value="1"/> <EF:EFOption label="已审核" value="1"/>
</EF:EFComboColumn> </EF:EFComboColumn>
......
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