Commit ea99567f by 宋祥

1.采购计划

parent 28720284
package com.baosight.hggp.core.enums;
/**
* @author:songx
* @date:2024/3/1,17:29
*/
public enum DeleteFlagEnum {
UN_REMOVE(0, "未删除"),
REMOVE(1, "已删除"),
;
private Integer code;
private String name;
DeleteFlagEnum(Integer code, String name) {
this.code = code;
this.name = name;
}
public Integer getCode() {
return code;
}
public void setCode(Integer code) {
this.code = code;
}
public String getName() {
return name;
}
public void setName(String name) {
this.name = name;
}
}
package com.baosight.hggp.hg.cg.domain;
import com.baosight.iplat4j.core.data.DaoEPBase;
import com.baosight.iplat4j.core.ei.EiColumn;
import com.baosight.iplat4j.core.util.NumberUtils;
import com.baosight.iplat4j.core.util.StringUtils;
import java.math.BigDecimal;
import java.util.HashMap;
import java.util.Map;
/**
* Project: <br>
* Title:Hgcg001.java <br>
* Description: <br>
*
* Copyrigth:Baosight Software LTD.co Copyright (c) 2019. <br>
*
* @version 1.0
* @history 2024-05-09 10:58:30 create
*/
public class HGCG001 extends DaoEPBase {
private static final long serialVersionUID = 1L;
public static final String FIELD_ID = "id";
public static final String FIELD_ACCOUNT_CODE = "accountCode"; /* 企业编码*/
public static final String FIELD_DEP_CODE = "depCode"; /* 部门编码*/
public static final String FIELD_CREATED_BY = "createdBy"; /* 记录创建者*/
public static final String FIELD_CREATED_NAME = "createdName"; /* 记录创建名称*/
public static final String FIELD_CREATED_TIME = "createdTime"; /* 记录创建时间*/
public static final String FIELD_UPDATED_BY = "updatedBy"; /* 记录修改者*/
public static final String FIELD_UPDATED_NAME = "updatedName"; /* 记录修改名称*/
public static final String FIELD_UPDATED_TIME = "updatedTime"; /* 记录修改时间*/
public static final String FIELD_DELETE_FLAG = "deleteFlag"; /* 0-未删除,1-已删除*/
public static final String FIELD_COMPANY_CODE = "companyCode"; /* 公司编码*/
public static final String FIELD_COMPANY_NAME = "companyName"; /* 公司名称*/
public static final String FIELD_PLAN_DATE = "planDate"; /* 计划日期*/
public static final String FIELD_PLAN_NO = "planNo"; /* 计划单号*/
public static final String FIELD_INVENT_CODE = "inventCode"; /* 存货编码*/
public static final String FIELD_INVENT_NAME = "inventName"; /* 存货名称*/
public static final String FIELD_SPEC = "spec"; /* 规格*/
public static final String FIELD_MATERIAL = "material"; /* 材质*/
public static final String FIELD_LENGTH = "length"; /* 长度*/
public static final String FIELD_PLAN_WEIGHT = "planWeight"; /* 计划重量*/
public static final String FIELD_PUR_QTY = "purQty"; /* 采购数量*/
public static final String FIELD_PUR_WEIGHT = "purWeight"; /* 采购重量*/
public static final String FIELD_STATUS = "status"; /* 状态:0-未审批,1-审核通过,2-审核未通过*/
public static final String FIELD_AUDIT_TIME = "auditTime"; /* 审核时间*/
public static final String FIELD_AUDIT_USER_ID = "auditUserId"; /* 审核人ID*/
public static final String FIELD_AUDIT_USER_NAME = "auditUserName"; /* 审核人名称*/
public static final String FIELD_AUDIT_REASON = "auditReason"; /* 审核原因*/
public static final String COL_ID = "ID";
public static final String COL_ACCOUNT_CODE = "ACCOUNT_CODE"; /* 企业编码*/
public static final String COL_DEP_CODE = "DEP_CODE"; /* 部门编码*/
public static final String COL_CREATED_BY = "CREATED_BY"; /* 记录创建者*/
public static final String COL_CREATED_NAME = "CREATED_NAME"; /* 记录创建名称*/
public static final String COL_CREATED_TIME = "CREATED_TIME"; /* 记录创建时间*/
public static final String COL_UPDATED_BY = "UPDATED_BY"; /* 记录修改者*/
public static final String COL_UPDATED_NAME = "UPDATED_NAME"; /* 记录修改名称*/
public static final String COL_UPDATED_TIME = "UPDATED_TIME"; /* 记录修改时间*/
public static final String COL_DELETE_FLAG = "DELETE_FLAG"; /* 0-未删除,1-已删除*/
public static final String COL_COMPANY_CODE = "COMPANY_CODE"; /* 公司编码*/
public static final String COL_COMPANY_NAME = "COMPANY_NAME"; /* 公司名称*/
public static final String COL_PLAN_DATE = "PLAN_DATE"; /* 计划日期*/
public static final String COL_PLAN_NO = "PLAN_NO"; /* 计划单号*/
public static final String COL_INVENT_CODE = "INVENT_CODE"; /* 存货编码*/
public static final String COL_INVENT_NAME = "INVENT_NAME"; /* 存货名称*/
public static final String COL_SPEC = "SPEC"; /* 规格*/
public static final String COL_MATERIAL = "MATERIAL"; /* 材质*/
public static final String COL_LENGTH = "LENGTH"; /* 长度*/
public static final String COL_PLAN_WEIGHT = "PLAN_WEIGHT"; /* 计划重量*/
public static final String COL_PUR_QTY = "PUR_QTY"; /* 采购数量*/
public static final String COL_PUR_WEIGHT = "PUR_WEIGHT"; /* 采购重量*/
public static final String COL_STATUS = "STATUS"; /* 状态:0-未审批,1-审核通过,2-审核未通过*/
public static final String COL_AUDIT_TIME = "AUDIT_TIME"; /* 审核时间*/
public static final String COL_AUDIT_USER_ID = "AUDIT_USER_ID"; /* 审核人ID*/
public static final String COL_AUDIT_USER_NAME = "AUDIT_USER_NAME"; /* 审核人名称*/
public static final String COL_AUDIT_REASON = "AUDIT_REASON"; /* 审核原因*/
public static final String QUERY = "HGCG001.query";
public static final String COUNT = "HGCG001.count";
public static final String INSERT = "HGCG001.insert";
public static final String UPDATE = "HGCG001.update";
public static final String DELETE = "HGCG001.delete";
private Long id = new Long(0);
private String accountCode = " "; /* 企业编码*/
private String depCode = " "; /* 部门编码*/
private String createdBy = " "; /* 记录创建者*/
private String createdName = " "; /* 记录创建名称*/
private String createdTime = " "; /* 记录创建时间*/
private String updatedBy = " "; /* 记录修改者*/
private String updatedName = " "; /* 记录修改名称*/
private String updatedTime = " "; /* 记录修改时间*/
private Integer deleteFlag = 0; /* 0-未删除,1-已删除*/
private String companyCode = " "; /* 公司编码*/
private String companyName = " "; /* 公司名称*/
private String planDate = " "; /* 计划日期*/
private String planNo = " "; /* 计划单号*/
private String inventCode = " "; /* 存货编码*/
private String inventName = " "; /* 存货名称*/
private String spec = " "; /* 规格*/
private String material = " "; /* 材质*/
private BigDecimal length = new BigDecimal(0.000); /* 长度*/
private BigDecimal planWeight = new BigDecimal(0.000); /* 计划重量*/
private BigDecimal purQty = new BigDecimal(0.000); /* 采购数量*/
private BigDecimal purWeight = new BigDecimal(0.000); /* 采购重量*/
private Integer status; /* 状态:0-未审批,1-审核通过,2-审核未通过*/
private String auditTime = " "; /* 审核时间*/
private String auditUserId = " "; /* 审核人ID*/
private String auditUserName = " "; /* 审核人名称*/
private String auditReason = " "; /* 审核原因*/
/**
* initialize the metadata.
*/
public void initMetaData() {
EiColumn eiColumn;
eiColumn = new EiColumn(FIELD_ID);
eiColumn.setPrimaryKey(true);
eiColumn.setDescName(" ");
eiMetadata.addMeta(eiColumn);
eiColumn = new EiColumn(FIELD_ACCOUNT_CODE);
eiColumn.setDescName("企业编码");
eiMetadata.addMeta(eiColumn);
eiColumn = new EiColumn(FIELD_DEP_CODE);
eiColumn.setDescName("部门编码");
eiMetadata.addMeta(eiColumn);
eiColumn = new EiColumn(FIELD_CREATED_BY);
eiColumn.setDescName("记录创建者");
eiMetadata.addMeta(eiColumn);
eiColumn = new EiColumn(FIELD_CREATED_NAME);
eiColumn.setDescName("记录创建名称");
eiMetadata.addMeta(eiColumn);
eiColumn = new EiColumn(FIELD_CREATED_TIME);
eiColumn.setDescName("记录创建时间");
eiMetadata.addMeta(eiColumn);
eiColumn = new EiColumn(FIELD_UPDATED_BY);
eiColumn.setDescName("记录修改者");
eiMetadata.addMeta(eiColumn);
eiColumn = new EiColumn(FIELD_UPDATED_NAME);
eiColumn.setDescName("记录修改名称");
eiMetadata.addMeta(eiColumn);
eiColumn = new EiColumn(FIELD_UPDATED_TIME);
eiColumn.setDescName("记录修改时间");
eiMetadata.addMeta(eiColumn);
eiColumn = new EiColumn(FIELD_DELETE_FLAG);
eiColumn.setDescName("0-未删除,1-已删除");
eiMetadata.addMeta(eiColumn);
eiColumn = new EiColumn(FIELD_COMPANY_CODE);
eiColumn.setDescName("公司编码");
eiMetadata.addMeta(eiColumn);
eiColumn = new EiColumn(FIELD_COMPANY_NAME);
eiColumn.setDescName("公司名称");
eiMetadata.addMeta(eiColumn);
eiColumn = new EiColumn(FIELD_PLAN_DATE);
eiColumn.setDescName("计划日期");
eiMetadata.addMeta(eiColumn);
eiColumn = new EiColumn(FIELD_PLAN_NO);
eiColumn.setDescName("计划单号");
eiMetadata.addMeta(eiColumn);
eiColumn = new EiColumn(FIELD_INVENT_CODE);
eiColumn.setDescName("存货编码");
eiMetadata.addMeta(eiColumn);
eiColumn = new EiColumn(FIELD_INVENT_NAME);
eiColumn.setDescName("存货名称");
eiMetadata.addMeta(eiColumn);
eiColumn = new EiColumn(FIELD_SPEC);
eiColumn.setDescName("规格");
eiMetadata.addMeta(eiColumn);
eiColumn = new EiColumn(FIELD_MATERIAL);
eiColumn.setDescName("材质");
eiMetadata.addMeta(eiColumn);
eiColumn = new EiColumn(FIELD_LENGTH);
eiColumn.setType("N");
eiColumn.setScaleLength(3);
eiColumn.setFieldLength(20);
eiColumn.setDescName("长度");
eiMetadata.addMeta(eiColumn);
eiColumn = new EiColumn(FIELD_PLAN_WEIGHT);
eiColumn.setType("N");
eiColumn.setScaleLength(3);
eiColumn.setFieldLength(20);
eiColumn.setDescName("计划重量");
eiMetadata.addMeta(eiColumn);
eiColumn = new EiColumn(FIELD_PUR_QTY);
eiColumn.setType("N");
eiColumn.setScaleLength(3);
eiColumn.setFieldLength(20);
eiColumn.setDescName("采购数量");
eiMetadata.addMeta(eiColumn);
eiColumn = new EiColumn(FIELD_PUR_WEIGHT);
eiColumn.setType("N");
eiColumn.setScaleLength(3);
eiColumn.setFieldLength(20);
eiColumn.setDescName("采购重量");
eiMetadata.addMeta(eiColumn);
eiColumn = new EiColumn(FIELD_STATUS);
eiColumn.setDescName("状态:0-未审批,1-审核通过,2-审核未通过");
eiMetadata.addMeta(eiColumn);
eiColumn = new EiColumn(FIELD_AUDIT_TIME);
eiColumn.setDescName("审核时间");
eiMetadata.addMeta(eiColumn);
eiColumn = new EiColumn(FIELD_AUDIT_USER_ID);
eiColumn.setDescName("审核人ID");
eiMetadata.addMeta(eiColumn);
eiColumn = new EiColumn(FIELD_AUDIT_USER_NAME);
eiColumn.setDescName("审核人名称");
eiMetadata.addMeta(eiColumn);
eiColumn = new EiColumn(FIELD_AUDIT_REASON);
eiColumn.setDescName("审核原因");
eiMetadata.addMeta(eiColumn);
}
/**
* the constructor.
*/
public HGCG001() {
initMetaData();
}
/**
* get the id .
* @return the id
*/
public Long getId() {
return this.id;
}
/**
* set the id .
*
* @param id
*/
public void setId(Long id) {
this.id = id;
}
/**
* get the accountCode - 企业编码.
* @return the accountCode
*/
public String getAccountCode() {
return this.accountCode;
}
/**
* set the accountCode - 企业编码.
*
* @param accountCode - 企业编码
*/
public void setAccountCode(String accountCode) {
this.accountCode = accountCode;
}
/**
* get the depCode - 部门编码.
* @return the depCode
*/
public String getDepCode() {
return this.depCode;
}
/**
* set the depCode - 部门编码.
*
* @param depCode - 部门编码
*/
public void setDepCode(String depCode) {
this.depCode = depCode;
}
/**
* get the createdBy - 记录创建者.
* @return the createdBy
*/
public String getCreatedBy() {
return this.createdBy;
}
/**
* set the createdBy - 记录创建者.
*
* @param createdBy - 记录创建者
*/
public void setCreatedBy(String createdBy) {
this.createdBy = createdBy;
}
/**
* get the createdName - 记录创建名称.
* @return the createdName
*/
public String getCreatedName() {
return this.createdName;
}
/**
* set the createdName - 记录创建名称.
*
* @param createdName - 记录创建名称
*/
public void setCreatedName(String createdName) {
this.createdName = createdName;
}
/**
* get the createdTime - 记录创建时间.
* @return the createdTime
*/
public String getCreatedTime() {
return this.createdTime;
}
/**
* set the createdTime - 记录创建时间.
*
* @param createdTime - 记录创建时间
*/
public void setCreatedTime(String createdTime) {
this.createdTime = createdTime;
}
/**
* get the updatedBy - 记录修改者.
* @return the updatedBy
*/
public String getUpdatedBy() {
return this.updatedBy;
}
/**
* set the updatedBy - 记录修改者.
*
* @param updatedBy - 记录修改者
*/
public void setUpdatedBy(String updatedBy) {
this.updatedBy = updatedBy;
}
/**
* get the updatedName - 记录修改名称.
* @return the updatedName
*/
public String getUpdatedName() {
return this.updatedName;
}
/**
* set the updatedName - 记录修改名称.
*
* @param updatedName - 记录修改名称
*/
public void setUpdatedName(String updatedName) {
this.updatedName = updatedName;
}
/**
* get the updatedTime - 记录修改时间.
* @return the updatedTime
*/
public String getUpdatedTime() {
return this.updatedTime;
}
/**
* set the updatedTime - 记录修改时间.
*
* @param updatedTime - 记录修改时间
*/
public void setUpdatedTime(String updatedTime) {
this.updatedTime = updatedTime;
}
/**
* get the deleteFlag - 0-未删除,1-已删除.
* @return the deleteFlag
*/
public Integer getDeleteFlag() {
return this.deleteFlag;
}
/**
* set the deleteFlag - 0-未删除,1-已删除.
*
* @param deleteFlag - 0-未删除,1-已删除
*/
public void setDeleteFlag(Integer deleteFlag) {
this.deleteFlag = deleteFlag;
}
/**
* get the companyCode - 公司编码.
* @return the companyCode
*/
public String getCompanyCode() {
return this.companyCode;
}
/**
* set the companyCode - 公司编码.
*
* @param companyCode - 公司编码
*/
public void setCompanyCode(String companyCode) {
this.companyCode = companyCode;
}
/**
* get the companyName - 公司名称.
* @return the companyName
*/
public String getCompanyName() {
return this.companyName;
}
/**
* set the companyName - 公司名称.
*
* @param companyName - 公司名称
*/
public void setCompanyName(String companyName) {
this.companyName = companyName;
}
/**
* get the planDate - 计划日期.
* @return the planDate
*/
public String getPlanDate() {
return this.planDate;
}
/**
* set the planDate - 计划日期.
*
* @param planDate - 计划日期
*/
public void setPlanDate(String planDate) {
this.planDate = planDate;
}
/**
* get the planNo - 计划单号.
* @return the planNo
*/
public String getPlanNo() {
return this.planNo;
}
/**
* set the planNo - 计划单号.
*
* @param planNo - 计划单号
*/
public void setPlanNo(String planNo) {
this.planNo = planNo;
}
/**
* get the inventCode - 存货编码.
* @return the inventCode
*/
public String getInventCode() {
return this.inventCode;
}
/**
* set the inventCode - 存货编码.
*
* @param inventCode - 存货编码
*/
public void setInventCode(String inventCode) {
this.inventCode = inventCode;
}
/**
* get the inventName - 存货名称.
* @return the inventName
*/
public String getInventName() {
return this.inventName;
}
/**
* set the inventName - 存货名称.
*
* @param inventName - 存货名称
*/
public void setInventName(String inventName) {
this.inventName = inventName;
}
/**
* get the spec - 规格.
* @return the spec
*/
public String getSpec() {
return this.spec;
}
/**
* set the spec - 规格.
*
* @param spec - 规格
*/
public void setSpec(String spec) {
this.spec = spec;
}
/**
* get the material - 材质.
* @return the material
*/
public String getMaterial() {
return this.material;
}
/**
* set the material - 材质.
*
* @param material - 材质
*/
public void setMaterial(String material) {
this.material = material;
}
/**
* get the length - 长度.
* @return the length
*/
public BigDecimal getLength() {
return this.length;
}
/**
* set the length - 长度.
*
* @param length - 长度
*/
public void setLength(BigDecimal length) {
this.length = length;
}
/**
* get the planWeight - 计划重量.
* @return the planWeight
*/
public BigDecimal getPlanWeight() {
return this.planWeight;
}
/**
* set the planWeight - 计划重量.
*
* @param planWeight - 计划重量
*/
public void setPlanWeight(BigDecimal planWeight) {
this.planWeight = planWeight;
}
/**
* get the purQty - 采购数量.
* @return the purQty
*/
public BigDecimal getPurQty() {
return this.purQty;
}
/**
* set the purQty - 采购数量.
*
* @param purQty - 采购数量
*/
public void setPurQty(BigDecimal purQty) {
this.purQty = purQty;
}
/**
* get the purWeight - 采购重量.
* @return the purWeight
*/
public BigDecimal getPurWeight() {
return this.purWeight;
}
/**
* set the purWeight - 采购重量.
*
* @param purWeight - 采购重量
*/
public void setPurWeight(BigDecimal purWeight) {
this.purWeight = purWeight;
}
/**
* get the status - 状态:0-未审批,1-审核通过,2-审核未通过.
* @return the status
*/
public Integer getStatus() {
return this.status;
}
/**
* set the status - 状态:0-未审批,1-审核通过,2-审核未通过.
*
* @param status - 状态:0-未审批,1-审核通过,2-审核未通过
*/
public void setStatus(Integer status) {
this.status = status;
}
/**
* get the auditTime - 审核时间.
* @return the auditTime
*/
public String getAuditTime() {
return this.auditTime;
}
/**
* set the auditTime - 审核时间.
*
* @param auditTime - 审核时间
*/
public void setAuditTime(String auditTime) {
this.auditTime = auditTime;
}
/**
* get the auditUserId - 审核人ID.
* @return the auditUserId
*/
public String getAuditUserId() {
return this.auditUserId;
}
/**
* set the auditUserId - 审核人ID.
*
* @param auditUserId - 审核人ID
*/
public void setAuditUserId(String auditUserId) {
this.auditUserId = auditUserId;
}
/**
* get the auditUserName - 审核人名称.
* @return the auditUserName
*/
public String getAuditUserName() {
return this.auditUserName;
}
/**
* set the auditUserName - 审核人名称.
*
* @param auditUserName - 审核人名称
*/
public void setAuditUserName(String auditUserName) {
this.auditUserName = auditUserName;
}
/**
* get the auditReason - 审核原因.
* @return the auditReason
*/
public String getAuditReason() {
return this.auditReason;
}
/**
* set the auditReason - 审核原因.
*
* @param auditReason - 审核原因
*/
public void setAuditReason(String auditReason) {
this.auditReason = auditReason;
}
/**
* get the value from Map.
*
* @param map - source data map
*/
@Override
public void fromMap(Map map) {
setId(NumberUtils.toLong(StringUtils.toString(map.get(FIELD_ID)), id));
setAccountCode(StringUtils.defaultIfEmpty(StringUtils.toString(map.get(FIELD_ACCOUNT_CODE)), accountCode));
setDepCode(StringUtils.defaultIfEmpty(StringUtils.toString(map.get(FIELD_DEP_CODE)), depCode));
setCreatedBy(StringUtils.defaultIfEmpty(StringUtils.toString(map.get(FIELD_CREATED_BY)), createdBy));
setCreatedName(StringUtils.defaultIfEmpty(StringUtils.toString(map.get(FIELD_CREATED_NAME)), createdName));
setCreatedTime(StringUtils.defaultIfEmpty(StringUtils.toString(map.get(FIELD_CREATED_TIME)), createdTime));
setUpdatedBy(StringUtils.defaultIfEmpty(StringUtils.toString(map.get(FIELD_UPDATED_BY)), updatedBy));
setUpdatedName(StringUtils.defaultIfEmpty(StringUtils.toString(map.get(FIELD_UPDATED_NAME)), updatedName));
setUpdatedTime(StringUtils.defaultIfEmpty(StringUtils.toString(map.get(FIELD_UPDATED_TIME)), updatedTime));
setDeleteFlag(NumberUtils.toInteger(StringUtils.toString(map.get(FIELD_DELETE_FLAG)), deleteFlag));
setCompanyCode(StringUtils.defaultIfEmpty(StringUtils.toString(map.get(FIELD_COMPANY_CODE)), companyCode));
setCompanyName(StringUtils.defaultIfEmpty(StringUtils.toString(map.get(FIELD_COMPANY_NAME)), companyName));
setPlanDate(StringUtils.defaultIfEmpty(StringUtils.toString(map.get(FIELD_PLAN_DATE)), planDate));
setPlanNo(StringUtils.defaultIfEmpty(StringUtils.toString(map.get(FIELD_PLAN_NO)), planNo));
setInventCode(StringUtils.defaultIfEmpty(StringUtils.toString(map.get(FIELD_INVENT_CODE)), inventCode));
setInventName(StringUtils.defaultIfEmpty(StringUtils.toString(map.get(FIELD_INVENT_NAME)), inventName));
setSpec(StringUtils.defaultIfEmpty(StringUtils.toString(map.get(FIELD_SPEC)), spec));
setMaterial(StringUtils.defaultIfEmpty(StringUtils.toString(map.get(FIELD_MATERIAL)), material));
setLength(NumberUtils.toBigDecimal(StringUtils.toString(map.get(FIELD_LENGTH)), length));
setPlanWeight(NumberUtils.toBigDecimal(StringUtils.toString(map.get(FIELD_PLAN_WEIGHT)), planWeight));
setPurQty(NumberUtils.toBigDecimal(StringUtils.toString(map.get(FIELD_PUR_QTY)), purQty));
setPurWeight(NumberUtils.toBigDecimal(StringUtils.toString(map.get(FIELD_PUR_WEIGHT)), purWeight));
setStatus(NumberUtils.toInteger(StringUtils.toString(map.get(FIELD_STATUS)), status));
setAuditTime(StringUtils.defaultIfEmpty(StringUtils.toString(map.get(FIELD_AUDIT_TIME)), auditTime));
setAuditUserId(StringUtils.defaultIfEmpty(StringUtils.toString(map.get(FIELD_AUDIT_USER_ID)), auditUserId));
setAuditUserName(StringUtils.defaultIfEmpty(StringUtils.toString(map.get(FIELD_AUDIT_USER_NAME)), auditUserName));
setAuditReason(StringUtils.defaultIfEmpty(StringUtils.toString(map.get(FIELD_AUDIT_REASON)), auditReason));
}
/**
* 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_ACCOUNT_CODE, StringUtils.toString(accountCode, eiMetadata.getMeta(FIELD_ACCOUNT_CODE)));
map.put(FIELD_DEP_CODE, StringUtils.toString(depCode, eiMetadata.getMeta(FIELD_DEP_CODE)));
map.put(FIELD_CREATED_BY, StringUtils.toString(createdBy, eiMetadata.getMeta(FIELD_CREATED_BY)));
map.put(FIELD_CREATED_NAME, StringUtils.toString(createdName, eiMetadata.getMeta(FIELD_CREATED_NAME)));
map.put(FIELD_CREATED_TIME, StringUtils.toString(createdTime, eiMetadata.getMeta(FIELD_CREATED_TIME)));
map.put(FIELD_UPDATED_BY, StringUtils.toString(updatedBy, eiMetadata.getMeta(FIELD_UPDATED_BY)));
map.put(FIELD_UPDATED_NAME, StringUtils.toString(updatedName, eiMetadata.getMeta(FIELD_UPDATED_NAME)));
map.put(FIELD_UPDATED_TIME, StringUtils.toString(updatedTime, eiMetadata.getMeta(FIELD_UPDATED_TIME)));
map.put(FIELD_DELETE_FLAG, StringUtils.toString(deleteFlag, eiMetadata.getMeta(FIELD_DELETE_FLAG)));
map.put(FIELD_COMPANY_CODE, StringUtils.toString(companyCode, eiMetadata.getMeta(FIELD_COMPANY_CODE)));
map.put(FIELD_COMPANY_NAME, StringUtils.toString(companyName, eiMetadata.getMeta(FIELD_COMPANY_NAME)));
map.put(FIELD_PLAN_DATE, StringUtils.toString(planDate, eiMetadata.getMeta(FIELD_PLAN_DATE)));
map.put(FIELD_PLAN_NO, StringUtils.toString(planNo, eiMetadata.getMeta(FIELD_PLAN_NO)));
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_SPEC, StringUtils.toString(spec, eiMetadata.getMeta(FIELD_SPEC)));
map.put(FIELD_MATERIAL, StringUtils.toString(material, eiMetadata.getMeta(FIELD_MATERIAL)));
map.put(FIELD_LENGTH, StringUtils.toString(length, eiMetadata.getMeta(FIELD_LENGTH)));
map.put(FIELD_PLAN_WEIGHT, StringUtils.toString(planWeight, eiMetadata.getMeta(FIELD_PLAN_WEIGHT)));
map.put(FIELD_PUR_QTY, StringUtils.toString(purQty, eiMetadata.getMeta(FIELD_PUR_QTY)));
map.put(FIELD_PUR_WEIGHT, StringUtils.toString(purWeight, eiMetadata.getMeta(FIELD_PUR_WEIGHT)));
map.put(FIELD_STATUS, StringUtils.toString(status, eiMetadata.getMeta(FIELD_STATUS)));
map.put(FIELD_AUDIT_TIME, StringUtils.toString(auditTime, eiMetadata.getMeta(FIELD_AUDIT_TIME)));
map.put(FIELD_AUDIT_USER_ID, StringUtils.toString(auditUserId, eiMetadata.getMeta(FIELD_AUDIT_USER_ID)));
map.put(FIELD_AUDIT_USER_NAME, StringUtils.toString(auditUserName, eiMetadata.getMeta(FIELD_AUDIT_USER_NAME)));
map.put(FIELD_AUDIT_REASON, StringUtils.toString(auditReason, eiMetadata.getMeta(FIELD_AUDIT_REASON)));
return map;
}
}
package com.baosight.hggp.hg.cg.domain;
import com.baosight.iplat4j.core.data.DaoEPBase;
import com.baosight.iplat4j.core.ei.EiColumn;
import com.baosight.iplat4j.core.util.NumberUtils;
import com.baosight.iplat4j.core.util.StringUtils;
import java.math.BigDecimal;
import java.util.HashMap;
import java.util.Map;
/**
* Project: <br>
* Title:Hgcg002.java <br>
* Description: <br>
*
* Copyrigth:Baosight Software LTD.co Copyright (c) 2019. <br>
*
* @version 1.0
* @history 2024-05-09 15:41:54 create
*/
public class HGCG002 extends DaoEPBase {
private static final long serialVersionUID = 1L;
public static final String FIELD_ID = "id";
public static final String FIELD_ACCOUNT_CODE = "accountCode"; /* 企业编码*/
public static final String FIELD_DEP_CODE = "depCode"; /* 部门编码*/
public static final String FIELD_CREATED_BY = "createdBy"; /* 记录创建者*/
public static final String FIELD_CREATED_NAME = "createdName"; /* 记录创建名称*/
public static final String FIELD_CREATED_TIME = "createdTime"; /* 记录创建时间*/
public static final String FIELD_UPDATED_BY = "updatedBy"; /* 记录修改者*/
public static final String FIELD_UPDATED_NAME = "updatedName"; /* 记录修改名称*/
public static final String FIELD_UPDATED_TIME = "updatedTime"; /* 记录修改时间*/
public static final String FIELD_DELETE_FLAG = "deleteFlag"; /* 0-未删除,1-已删除*/
public static final String FIELD_COMPANY_CODE = "companyCode"; /* 公司编码*/
public static final String FIELD_COMPANY_NAME = "companyName"; /* 公司名称*/
public static final String FIELD_CONTRACT_DATE = "contractDate"; /* 合同日期*/
public static final String FIELD_CONTRACT_NO = "contractNo"; /* 合同号*/
public static final String FIELD_PLAN_NO = "planNo"; /* 计划单号*/
public static final String FIELD_SUP_CODE = "supCode"; /* 供应商编码*/
public static final String FIELD_SUP_NAME = "supName"; /* 供应商名称*/
public static final String FIELD_PUR_USER_ID = "purUserId"; /* 采购员*/
public static final String FIELD_PUR_USER_NAME = "purUserName"; /* 采购员名称*/
public static final String FIELD_INVENT_CODE = "inventCode"; /* 存货编码*/
public static final String FIELD_INVENT_NAME = "inventName"; /* 存货名称*/
public static final String FIELD_SPEC = "spec"; /* 规格*/
public static final String FIELD_MATERIAL = "material"; /* 材质*/
public static final String FIELD_LENGTH = "length"; /* 长度*/
public static final String FIELD_PUR_QTY = "purQty"; /* 采购数量*/
public static final String FIELD_PUR_WEIGHT = "purWeight"; /* 采购重量*/
public static final String FIELD_STATUS = "status"; /* 状态:0-未审批,1-审核通过,2-审核未通过*/
public static final String FIELD_AUDIT_TIME = "auditTime"; /* 审核时间*/
public static final String FIELD_AUDIT_USER_ID = "auditUserId"; /* 审核人ID*/
public static final String FIELD_AUDIT_USER_NAME = "auditUserName"; /* 审核人名称*/
public static final String FIELD_AUDIT_REASON = "auditReason"; /* 审核原因*/
public static final String COL_ID = "ID";
public static final String COL_ACCOUNT_CODE = "ACCOUNT_CODE"; /* 企业编码*/
public static final String COL_DEP_CODE = "DEP_CODE"; /* 部门编码*/
public static final String COL_CREATED_BY = "CREATED_BY"; /* 记录创建者*/
public static final String COL_CREATED_NAME = "CREATED_NAME"; /* 记录创建名称*/
public static final String COL_CREATED_TIME = "CREATED_TIME"; /* 记录创建时间*/
public static final String COL_UPDATED_BY = "UPDATED_BY"; /* 记录修改者*/
public static final String COL_UPDATED_NAME = "UPDATED_NAME"; /* 记录修改名称*/
public static final String COL_UPDATED_TIME = "UPDATED_TIME"; /* 记录修改时间*/
public static final String COL_DELETE_FLAG = "DELETE_FLAG"; /* 0-未删除,1-已删除*/
public static final String COL_COMPANY_CODE = "COMPANY_CODE"; /* 公司编码*/
public static final String COL_COMPANY_NAME = "COMPANY_NAME"; /* 公司名称*/
public static final String COL_CONTRACT_DATE = "CONTRACT_DATE"; /* 合同日期*/
public static final String COL_CONTRACT_NO = "CONTRACT_NO"; /* 合同号*/
public static final String COL_PLAN_NO = "PLAN_NO"; /* 计划单号*/
public static final String COL_SUP_CODE = "SUP_CODE"; /* 供应商编码*/
public static final String COL_SUP_NAME = "SUP_NAME"; /* 供应商名称*/
public static final String COL_PUR_USER_ID = "PUR_USER_ID"; /* 采购员*/
public static final String COL_PUR_USER_NAME = "PUR_USER_NAME"; /* 采购员名称*/
public static final String COL_INVENT_CODE = "INVENT_CODE"; /* 存货编码*/
public static final String COL_INVENT_NAME = "INVENT_NAME"; /* 存货名称*/
public static final String COL_SPEC = "SPEC"; /* 规格*/
public static final String COL_MATERIAL = "MATERIAL"; /* 材质*/
public static final String COL_LENGTH = "LENGTH"; /* 长度*/
public static final String COL_PUR_QTY = "PUR_QTY"; /* 采购数量*/
public static final String COL_PUR_WEIGHT = "PUR_WEIGHT"; /* 采购重量*/
public static final String COL_STATUS = "STATUS"; /* 状态:0-未审批,1-审核通过,2-审核未通过*/
public static final String COL_AUDIT_TIME = "AUDIT_TIME"; /* 审核时间*/
public static final String COL_AUDIT_USER_ID = "AUDIT_USER_ID"; /* 审核人ID*/
public static final String COL_AUDIT_USER_NAME = "AUDIT_USER_NAME"; /* 审核人名称*/
public static final String COL_AUDIT_REASON = "AUDIT_REASON"; /* 审核原因*/
public static final String QUERY = "HGCG002.query";
public static final String COUNT = "HGCG002.count";
public static final String INSERT = "HGCG002.insert";
public static final String UPDATE = "HGCG002.update";
public static final String DELETE = "HGCG002.delete";
private Long id = new Long(0);
private String accountCode = " "; /* 企业编码*/
private String depCode = " "; /* 部门编码*/
private String createdBy = " "; /* 记录创建者*/
private String createdName = " "; /* 记录创建名称*/
private String createdTime = " "; /* 记录创建时间*/
private String updatedBy = " "; /* 记录修改者*/
private String updatedName = " "; /* 记录修改名称*/
private String updatedTime = " "; /* 记录修改时间*/
private Integer deleteFlag = 0; /* 0-未删除,1-已删除*/
private String companyCode = " "; /* 公司编码*/
private String companyName = " "; /* 公司名称*/
private String contractDate = " "; /* 合同日期*/
private String contractNo = " "; /* 合同号*/
private String planNo = " "; /* 计划单号*/
private String supCode = " "; /* 供应商编码*/
private String supName = " "; /* 供应商名称*/
private String purUserId = " "; /* 采购员*/
private String purUserName = " "; /* 采购员名称*/
private String inventCode = " "; /* 存货编码*/
private String inventName = " "; /* 存货名称*/
private String spec = " "; /* 规格*/
private String material = " "; /* 材质*/
private BigDecimal length = new BigDecimal(0.000); /* 长度*/
private BigDecimal purQty = new BigDecimal(0.000); /* 采购数量*/
private BigDecimal purWeight = new BigDecimal(0.000); /* 采购重量*/
private Integer status = 0; /* 状态:0-未审批,1-审核通过,2-审核未通过*/
private String auditTime = " "; /* 审核时间*/
private String auditUserId = " "; /* 审核人ID*/
private String auditUserName = " "; /* 审核人名称*/
private String auditReason = " "; /* 审核原因*/
/**
* initialize the metadata.
*/
public void initMetaData() {
EiColumn eiColumn;
eiColumn = new EiColumn(FIELD_ID);
eiColumn.setPrimaryKey(true);
eiColumn.setDescName(" ");
eiMetadata.addMeta(eiColumn);
eiColumn = new EiColumn(FIELD_ACCOUNT_CODE);
eiColumn.setDescName("企业编码");
eiMetadata.addMeta(eiColumn);
eiColumn = new EiColumn(FIELD_DEP_CODE);
eiColumn.setDescName("部门编码");
eiMetadata.addMeta(eiColumn);
eiColumn = new EiColumn(FIELD_CREATED_BY);
eiColumn.setDescName("记录创建者");
eiMetadata.addMeta(eiColumn);
eiColumn = new EiColumn(FIELD_CREATED_NAME);
eiColumn.setDescName("记录创建名称");
eiMetadata.addMeta(eiColumn);
eiColumn = new EiColumn(FIELD_CREATED_TIME);
eiColumn.setDescName("记录创建时间");
eiMetadata.addMeta(eiColumn);
eiColumn = new EiColumn(FIELD_UPDATED_BY);
eiColumn.setDescName("记录修改者");
eiMetadata.addMeta(eiColumn);
eiColumn = new EiColumn(FIELD_UPDATED_NAME);
eiColumn.setDescName("记录修改名称");
eiMetadata.addMeta(eiColumn);
eiColumn = new EiColumn(FIELD_UPDATED_TIME);
eiColumn.setDescName("记录修改时间");
eiMetadata.addMeta(eiColumn);
eiColumn = new EiColumn(FIELD_DELETE_FLAG);
eiColumn.setDescName("0-未删除,1-已删除");
eiMetadata.addMeta(eiColumn);
eiColumn = new EiColumn(FIELD_COMPANY_CODE);
eiColumn.setDescName("公司编码");
eiMetadata.addMeta(eiColumn);
eiColumn = new EiColumn(FIELD_COMPANY_NAME);
eiColumn.setDescName("公司名称");
eiMetadata.addMeta(eiColumn);
eiColumn = new EiColumn(FIELD_CONTRACT_DATE);
eiColumn.setDescName("合同日期");
eiMetadata.addMeta(eiColumn);
eiColumn = new EiColumn(FIELD_CONTRACT_NO);
eiColumn.setDescName("合同号");
eiMetadata.addMeta(eiColumn);
eiColumn = new EiColumn(FIELD_PLAN_NO);
eiColumn.setDescName("计划单号");
eiMetadata.addMeta(eiColumn);
eiColumn = new EiColumn(FIELD_SUP_CODE);
eiColumn.setDescName("供应商编码");
eiMetadata.addMeta(eiColumn);
eiColumn = new EiColumn(FIELD_SUP_NAME);
eiColumn.setDescName("供应商名称");
eiMetadata.addMeta(eiColumn);
eiColumn = new EiColumn(FIELD_PUR_USER_ID);
eiColumn.setDescName("采购员");
eiMetadata.addMeta(eiColumn);
eiColumn = new EiColumn(FIELD_PUR_USER_NAME);
eiColumn.setDescName("采购员名称");
eiMetadata.addMeta(eiColumn);
eiColumn = new EiColumn(FIELD_INVENT_CODE);
eiColumn.setDescName("存货编码");
eiMetadata.addMeta(eiColumn);
eiColumn = new EiColumn(FIELD_INVENT_NAME);
eiColumn.setDescName("存货名称");
eiMetadata.addMeta(eiColumn);
eiColumn = new EiColumn(FIELD_SPEC);
eiColumn.setDescName("规格");
eiMetadata.addMeta(eiColumn);
eiColumn = new EiColumn(FIELD_MATERIAL);
eiColumn.setDescName("材质");
eiMetadata.addMeta(eiColumn);
eiColumn = new EiColumn(FIELD_LENGTH);
eiColumn.setType("N");
eiColumn.setScaleLength(3);
eiColumn.setFieldLength(20);
eiColumn.setDescName("长度");
eiMetadata.addMeta(eiColumn);
eiColumn = new EiColumn(FIELD_PUR_QTY);
eiColumn.setType("N");
eiColumn.setScaleLength(3);
eiColumn.setFieldLength(20);
eiColumn.setDescName("采购数量");
eiMetadata.addMeta(eiColumn);
eiColumn = new EiColumn(FIELD_PUR_WEIGHT);
eiColumn.setType("N");
eiColumn.setScaleLength(3);
eiColumn.setFieldLength(20);
eiColumn.setDescName("采购重量");
eiMetadata.addMeta(eiColumn);
eiColumn = new EiColumn(FIELD_STATUS);
eiColumn.setDescName("状态:0-未审批,1-审核通过,2-审核未通过");
eiMetadata.addMeta(eiColumn);
eiColumn = new EiColumn(FIELD_AUDIT_TIME);
eiColumn.setDescName("审核时间");
eiMetadata.addMeta(eiColumn);
eiColumn = new EiColumn(FIELD_AUDIT_USER_ID);
eiColumn.setDescName("审核人ID");
eiMetadata.addMeta(eiColumn);
eiColumn = new EiColumn(FIELD_AUDIT_USER_NAME);
eiColumn.setDescName("审核人名称");
eiMetadata.addMeta(eiColumn);
eiColumn = new EiColumn(FIELD_AUDIT_REASON);
eiColumn.setDescName("审核原因");
eiMetadata.addMeta(eiColumn);
}
/**
* the constructor.
*/
public HGCG002() {
initMetaData();
}
/**
* get the id .
* @return the id
*/
public Long getId() {
return this.id;
}
/**
* set the id .
*
* @param id
*/
public void setId(Long id) {
this.id = id;
}
/**
* get the accountCode - 企业编码.
* @return the accountCode
*/
public String getAccountCode() {
return this.accountCode;
}
/**
* set the accountCode - 企业编码.
*
* @param accountCode - 企业编码
*/
public void setAccountCode(String accountCode) {
this.accountCode = accountCode;
}
/**
* get the depCode - 部门编码.
* @return the depCode
*/
public String getDepCode() {
return this.depCode;
}
/**
* set the depCode - 部门编码.
*
* @param depCode - 部门编码
*/
public void setDepCode(String depCode) {
this.depCode = depCode;
}
/**
* get the createdBy - 记录创建者.
* @return the createdBy
*/
public String getCreatedBy() {
return this.createdBy;
}
/**
* set the createdBy - 记录创建者.
*
* @param createdBy - 记录创建者
*/
public void setCreatedBy(String createdBy) {
this.createdBy = createdBy;
}
/**
* get the createdName - 记录创建名称.
* @return the createdName
*/
public String getCreatedName() {
return this.createdName;
}
/**
* set the createdName - 记录创建名称.
*
* @param createdName - 记录创建名称
*/
public void setCreatedName(String createdName) {
this.createdName = createdName;
}
/**
* get the createdTime - 记录创建时间.
* @return the createdTime
*/
public String getCreatedTime() {
return this.createdTime;
}
/**
* set the createdTime - 记录创建时间.
*
* @param createdTime - 记录创建时间
*/
public void setCreatedTime(String createdTime) {
this.createdTime = createdTime;
}
/**
* get the updatedBy - 记录修改者.
* @return the updatedBy
*/
public String getUpdatedBy() {
return this.updatedBy;
}
/**
* set the updatedBy - 记录修改者.
*
* @param updatedBy - 记录修改者
*/
public void setUpdatedBy(String updatedBy) {
this.updatedBy = updatedBy;
}
/**
* get the updatedName - 记录修改名称.
* @return the updatedName
*/
public String getUpdatedName() {
return this.updatedName;
}
/**
* set the updatedName - 记录修改名称.
*
* @param updatedName - 记录修改名称
*/
public void setUpdatedName(String updatedName) {
this.updatedName = updatedName;
}
/**
* get the updatedTime - 记录修改时间.
* @return the updatedTime
*/
public String getUpdatedTime() {
return this.updatedTime;
}
/**
* set the updatedTime - 记录修改时间.
*
* @param updatedTime - 记录修改时间
*/
public void setUpdatedTime(String updatedTime) {
this.updatedTime = updatedTime;
}
/**
* get the deleteFlag - 0-未删除,1-已删除.
* @return the deleteFlag
*/
public Integer getDeleteFlag() {
return this.deleteFlag;
}
/**
* set the deleteFlag - 0-未删除,1-已删除.
*
* @param deleteFlag - 0-未删除,1-已删除
*/
public void setDeleteFlag(Integer deleteFlag) {
this.deleteFlag = deleteFlag;
}
/**
* get the companyCode - 公司编码.
* @return the companyCode
*/
public String getCompanyCode() {
return this.companyCode;
}
/**
* set the companyCode - 公司编码.
*
* @param companyCode - 公司编码
*/
public void setCompanyCode(String companyCode) {
this.companyCode = companyCode;
}
/**
* get the companyName - 公司名称.
* @return the companyName
*/
public String getCompanyName() {
return this.companyName;
}
/**
* set the companyName - 公司名称.
*
* @param companyName - 公司名称
*/
public void setCompanyName(String companyName) {
this.companyName = companyName;
}
/**
* get the contractDate - 合同日期.
* @return the contractDate
*/
public String getContractDate() {
return this.contractDate;
}
/**
* set the contractDate - 合同日期.
*
* @param contractDate - 合同日期
*/
public void setContractDate(String contractDate) {
this.contractDate = contractDate;
}
/**
* get the contractNo - 合同号.
* @return the contractNo
*/
public String getContractNo() {
return this.contractNo;
}
/**
* set the contractNo - 合同号.
*
* @param contractNo - 合同号
*/
public void setContractNo(String contractNo) {
this.contractNo = contractNo;
}
/**
* get the planNo - 计划单号.
* @return the planNo
*/
public String getPlanNo() {
return this.planNo;
}
/**
* set the planNo - 计划单号.
*
* @param planNo - 计划单号
*/
public void setPlanNo(String planNo) {
this.planNo = planNo;
}
/**
* get the supCode - 供应商编码.
* @return the supCode
*/
public String getSupCode() {
return this.supCode;
}
/**
* set the supCode - 供应商编码.
*
* @param supCode - 供应商编码
*/
public void setSupCode(String supCode) {
this.supCode = supCode;
}
/**
* get the supName - 供应商名称.
* @return the supName
*/
public String getSupName() {
return this.supName;
}
/**
* set the supName - 供应商名称.
*
* @param supName - 供应商名称
*/
public void setSupName(String supName) {
this.supName = supName;
}
/**
* get the purUserId - 采购员.
* @return the purUserId
*/
public String getPurUserId() {
return this.purUserId;
}
/**
* set the purUserId - 采购员.
*
* @param purUserId - 采购员
*/
public void setPurUserId(String purUserId) {
this.purUserId = purUserId;
}
/**
* get the purUserName - 采购员名称.
* @return the purUserName
*/
public String getPurUserName() {
return this.purUserName;
}
/**
* set the purUserName - 采购员名称.
*
* @param purUserName - 采购员名称
*/
public void setPurUserName(String purUserName) {
this.purUserName = purUserName;
}
/**
* get the inventCode - 存货编码.
* @return the inventCode
*/
public String getInventCode() {
return this.inventCode;
}
/**
* set the inventCode - 存货编码.
*
* @param inventCode - 存货编码
*/
public void setInventCode(String inventCode) {
this.inventCode = inventCode;
}
/**
* get the inventName - 存货名称.
* @return the inventName
*/
public String getInventName() {
return this.inventName;
}
/**
* set the inventName - 存货名称.
*
* @param inventName - 存货名称
*/
public void setInventName(String inventName) {
this.inventName = inventName;
}
/**
* get the spec - 规格.
* @return the spec
*/
public String getSpec() {
return this.spec;
}
/**
* set the spec - 规格.
*
* @param spec - 规格
*/
public void setSpec(String spec) {
this.spec = spec;
}
/**
* get the material - 材质.
* @return the material
*/
public String getMaterial() {
return this.material;
}
/**
* set the material - 材质.
*
* @param material - 材质
*/
public void setMaterial(String material) {
this.material = material;
}
/**
* get the length - 长度.
* @return the length
*/
public BigDecimal getLength() {
return this.length;
}
/**
* set the length - 长度.
*
* @param length - 长度
*/
public void setLength(BigDecimal length) {
this.length = length;
}
/**
* get the purQty - 采购数量.
* @return the purQty
*/
public BigDecimal getPurQty() {
return this.purQty;
}
/**
* set the purQty - 采购数量.
*
* @param purQty - 采购数量
*/
public void setPurQty(BigDecimal purQty) {
this.purQty = purQty;
}
/**
* get the purWeight - 采购重量.
* @return the purWeight
*/
public BigDecimal getPurWeight() {
return this.purWeight;
}
/**
* set the purWeight - 采购重量.
*
* @param purWeight - 采购重量
*/
public void setPurWeight(BigDecimal purWeight) {
this.purWeight = purWeight;
}
/**
* get the status - 状态:0-未审批,1-审核通过,2-审核未通过.
* @return the status
*/
public Integer getStatus() {
return this.status;
}
/**
* set the status - 状态:0-未审批,1-审核通过,2-审核未通过.
*
* @param status - 状态:0-未审批,1-审核通过,2-审核未通过
*/
public void setStatus(Integer status) {
this.status = status;
}
/**
* get the auditTime - 审核时间.
* @return the auditTime
*/
public String getAuditTime() {
return this.auditTime;
}
/**
* set the auditTime - 审核时间.
*
* @param auditTime - 审核时间
*/
public void setAuditTime(String auditTime) {
this.auditTime = auditTime;
}
/**
* get the auditUserId - 审核人ID.
* @return the auditUserId
*/
public String getAuditUserId() {
return this.auditUserId;
}
/**
* set the auditUserId - 审核人ID.
*
* @param auditUserId - 审核人ID
*/
public void setAuditUserId(String auditUserId) {
this.auditUserId = auditUserId;
}
/**
* get the auditUserName - 审核人名称.
* @return the auditUserName
*/
public String getAuditUserName() {
return this.auditUserName;
}
/**
* set the auditUserName - 审核人名称.
*
* @param auditUserName - 审核人名称
*/
public void setAuditUserName(String auditUserName) {
this.auditUserName = auditUserName;
}
/**
* get the auditReason - 审核原因.
* @return the auditReason
*/
public String getAuditReason() {
return this.auditReason;
}
/**
* set the auditReason - 审核原因.
*
* @param auditReason - 审核原因
*/
public void setAuditReason(String auditReason) {
this.auditReason = auditReason;
}
/**
* get the value from Map.
*
* @param map - source data map
*/
@Override
public void fromMap(Map map) {
setId(NumberUtils.toLong(StringUtils.toString(map.get(FIELD_ID)), id));
setAccountCode(StringUtils.defaultIfEmpty(StringUtils.toString(map.get(FIELD_ACCOUNT_CODE)), accountCode));
setDepCode(StringUtils.defaultIfEmpty(StringUtils.toString(map.get(FIELD_DEP_CODE)), depCode));
setCreatedBy(StringUtils.defaultIfEmpty(StringUtils.toString(map.get(FIELD_CREATED_BY)), createdBy));
setCreatedName(StringUtils.defaultIfEmpty(StringUtils.toString(map.get(FIELD_CREATED_NAME)), createdName));
setCreatedTime(StringUtils.defaultIfEmpty(StringUtils.toString(map.get(FIELD_CREATED_TIME)), createdTime));
setUpdatedBy(StringUtils.defaultIfEmpty(StringUtils.toString(map.get(FIELD_UPDATED_BY)), updatedBy));
setUpdatedName(StringUtils.defaultIfEmpty(StringUtils.toString(map.get(FIELD_UPDATED_NAME)), updatedName));
setUpdatedTime(StringUtils.defaultIfEmpty(StringUtils.toString(map.get(FIELD_UPDATED_TIME)), updatedTime));
setDeleteFlag(NumberUtils.toInteger(StringUtils.toString(map.get(FIELD_DELETE_FLAG)), deleteFlag));
setCompanyCode(StringUtils.defaultIfEmpty(StringUtils.toString(map.get(FIELD_COMPANY_CODE)), companyCode));
setCompanyName(StringUtils.defaultIfEmpty(StringUtils.toString(map.get(FIELD_COMPANY_NAME)), companyName));
setContractDate(StringUtils.defaultIfEmpty(StringUtils.toString(map.get(FIELD_CONTRACT_DATE)), contractDate));
setContractNo(StringUtils.defaultIfEmpty(StringUtils.toString(map.get(FIELD_CONTRACT_NO)), contractNo));
setPlanNo(StringUtils.defaultIfEmpty(StringUtils.toString(map.get(FIELD_PLAN_NO)), planNo));
setSupCode(StringUtils.defaultIfEmpty(StringUtils.toString(map.get(FIELD_SUP_CODE)), supCode));
setSupName(StringUtils.defaultIfEmpty(StringUtils.toString(map.get(FIELD_SUP_NAME)), supName));
setPurUserId(StringUtils.defaultIfEmpty(StringUtils.toString(map.get(FIELD_PUR_USER_ID)), purUserId));
setPurUserName(StringUtils.defaultIfEmpty(StringUtils.toString(map.get(FIELD_PUR_USER_NAME)), purUserName));
setInventCode(StringUtils.defaultIfEmpty(StringUtils.toString(map.get(FIELD_INVENT_CODE)), inventCode));
setInventName(StringUtils.defaultIfEmpty(StringUtils.toString(map.get(FIELD_INVENT_NAME)), inventName));
setSpec(StringUtils.defaultIfEmpty(StringUtils.toString(map.get(FIELD_SPEC)), spec));
setMaterial(StringUtils.defaultIfEmpty(StringUtils.toString(map.get(FIELD_MATERIAL)), material));
setLength(NumberUtils.toBigDecimal(StringUtils.toString(map.get(FIELD_LENGTH)), length));
setPurQty(NumberUtils.toBigDecimal(StringUtils.toString(map.get(FIELD_PUR_QTY)), purQty));
setPurWeight(NumberUtils.toBigDecimal(StringUtils.toString(map.get(FIELD_PUR_WEIGHT)), purWeight));
setStatus(NumberUtils.toInteger(StringUtils.toString(map.get(FIELD_STATUS)), status));
setAuditTime(StringUtils.defaultIfEmpty(StringUtils.toString(map.get(FIELD_AUDIT_TIME)), auditTime));
setAuditUserId(StringUtils.defaultIfEmpty(StringUtils.toString(map.get(FIELD_AUDIT_USER_ID)), auditUserId));
setAuditUserName(StringUtils.defaultIfEmpty(StringUtils.toString(map.get(FIELD_AUDIT_USER_NAME)), auditUserName));
setAuditReason(StringUtils.defaultIfEmpty(StringUtils.toString(map.get(FIELD_AUDIT_REASON)), auditReason));
}
/**
* 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_ACCOUNT_CODE, StringUtils.toString(accountCode, eiMetadata.getMeta(FIELD_ACCOUNT_CODE)));
map.put(FIELD_DEP_CODE, StringUtils.toString(depCode, eiMetadata.getMeta(FIELD_DEP_CODE)));
map.put(FIELD_CREATED_BY, StringUtils.toString(createdBy, eiMetadata.getMeta(FIELD_CREATED_BY)));
map.put(FIELD_CREATED_NAME, StringUtils.toString(createdName, eiMetadata.getMeta(FIELD_CREATED_NAME)));
map.put(FIELD_CREATED_TIME, StringUtils.toString(createdTime, eiMetadata.getMeta(FIELD_CREATED_TIME)));
map.put(FIELD_UPDATED_BY, StringUtils.toString(updatedBy, eiMetadata.getMeta(FIELD_UPDATED_BY)));
map.put(FIELD_UPDATED_NAME, StringUtils.toString(updatedName, eiMetadata.getMeta(FIELD_UPDATED_NAME)));
map.put(FIELD_UPDATED_TIME, StringUtils.toString(updatedTime, eiMetadata.getMeta(FIELD_UPDATED_TIME)));
map.put(FIELD_DELETE_FLAG, StringUtils.toString(deleteFlag, eiMetadata.getMeta(FIELD_DELETE_FLAG)));
map.put(FIELD_COMPANY_CODE, StringUtils.toString(companyCode, eiMetadata.getMeta(FIELD_COMPANY_CODE)));
map.put(FIELD_COMPANY_NAME, StringUtils.toString(companyName, eiMetadata.getMeta(FIELD_COMPANY_NAME)));
map.put(FIELD_CONTRACT_DATE, StringUtils.toString(contractDate, eiMetadata.getMeta(FIELD_CONTRACT_DATE)));
map.put(FIELD_CONTRACT_NO, StringUtils.toString(contractNo, eiMetadata.getMeta(FIELD_CONTRACT_NO)));
map.put(FIELD_PLAN_NO, StringUtils.toString(planNo, eiMetadata.getMeta(FIELD_PLAN_NO)));
map.put(FIELD_SUP_CODE, StringUtils.toString(supCode, eiMetadata.getMeta(FIELD_SUP_CODE)));
map.put(FIELD_SUP_NAME, StringUtils.toString(supName, eiMetadata.getMeta(FIELD_SUP_NAME)));
map.put(FIELD_PUR_USER_ID, StringUtils.toString(purUserId, eiMetadata.getMeta(FIELD_PUR_USER_ID)));
map.put(FIELD_PUR_USER_NAME, StringUtils.toString(purUserName, eiMetadata.getMeta(FIELD_PUR_USER_NAME)));
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_SPEC, StringUtils.toString(spec, eiMetadata.getMeta(FIELD_SPEC)));
map.put(FIELD_MATERIAL, StringUtils.toString(material, eiMetadata.getMeta(FIELD_MATERIAL)));
map.put(FIELD_LENGTH, StringUtils.toString(length, eiMetadata.getMeta(FIELD_LENGTH)));
map.put(FIELD_PUR_QTY, StringUtils.toString(purQty, eiMetadata.getMeta(FIELD_PUR_QTY)));
map.put(FIELD_PUR_WEIGHT, StringUtils.toString(purWeight, eiMetadata.getMeta(FIELD_PUR_WEIGHT)));
map.put(FIELD_STATUS, StringUtils.toString(status, eiMetadata.getMeta(FIELD_STATUS)));
map.put(FIELD_AUDIT_TIME, StringUtils.toString(auditTime, eiMetadata.getMeta(FIELD_AUDIT_TIME)));
map.put(FIELD_AUDIT_USER_ID, StringUtils.toString(auditUserId, eiMetadata.getMeta(FIELD_AUDIT_USER_ID)));
map.put(FIELD_AUDIT_USER_NAME, StringUtils.toString(auditUserName, eiMetadata.getMeta(FIELD_AUDIT_USER_NAME)));
map.put(FIELD_AUDIT_REASON, StringUtils.toString(auditReason, eiMetadata.getMeta(FIELD_AUDIT_REASON)));
return map;
}
}
package com.baosight.hggp.hg.cg.service;
import com.baosight.hggp.aspect.annotation.OperationLogAnnotation;
import com.baosight.hggp.common.DdynamicEnum;
import com.baosight.hggp.core.dao.DaoUtils;
import com.baosight.hggp.core.enums.DeleteFlagEnum;
import com.baosight.hggp.core.security.UserSessionUtils;
import com.baosight.hggp.hg.cg.domain.HGCG001;
import com.baosight.hggp.hg.cg.tools.HGCGTools;
import com.baosight.hggp.hg.cg.utils.HgCgUtils;
import com.baosight.hggp.hg.constant.HGConstant;
import com.baosight.hggp.hg.constant.HGSqlConstant;
import com.baosight.hggp.util.AssertUtils;
import com.baosight.hggp.util.CommonMethod;
import com.baosight.hggp.util.DateUtils;
import com.baosight.hggp.util.EiInfoUtils;
import com.baosight.hggp.util.LogUtils;
import com.baosight.hggp.util.MapUtils;
import com.baosight.hggp.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.ServiceBase;
import java.math.BigDecimal;
import java.util.Arrays;
import java.util.List;
import java.util.Map;
/**
* @author:songx
* @date:2024/5/9,11:04
*/
public class ServiceHGCG001 extends ServiceBase {
/**
* 画面初始化
*
* @param inInfo
* @return
*/
@Override
@OperationLogAnnotation(operModul = "采购计划", operType = "查询", operDesc = "初始化")
public EiInfo initLoad(EiInfo inInfo) {
try {
CommonMethod.initBlock(inInfo, Arrays.asList(DdynamicEnum.COMPANY_CODE_BLOCK_ID));
inInfo.addBlock(EiConstant.resultBlock).addBlockMeta(new HGCG001().eiMetadata);
} catch (PlatException e) {
LogUtils.setDetailMsg(inInfo, e, "初始化失败");
}
return inInfo;
}
/**
* 查询操作
*
* @param inInfo
* @return
*/
@Override
@OperationLogAnnotation(operModul = "采购计划", operType = "查询", operDesc = "查询")
public EiInfo query(EiInfo inInfo) {
try {
Map queryRow = EiInfoUtils.getFirstRow(inInfo);
HgCgUtils.HgCg001.setCondition(queryRow);
inInfo = super.query(inInfo, HGCG001.QUERY, new HGCG001());
} catch (Exception e) {
LogUtils.setDetailMsg(inInfo, e, "查询失败");
}
return inInfo;
}
/**
* 保存操作.
*
* @param inInfo
* @return
*/
@OperationLogAnnotation(operModul = "采购计划", operType = "修改", operDesc = "保存")
public EiInfo save(EiInfo inInfo) {
try {
List<HGCG001> fCg001s = MapUtils.toDaoEPBase(inInfo, HGCG001.class);
// db数据
Map<String, HGCG001> dbCg001Map = this.lockGetData(fCg001s);
// 数据校验
this.checkSaveData(fCg001s, dbCg001Map);
// 保存数据
this.saveData(fCg001s);
inInfo = this.query(inInfo);
inInfo.setStatus(EiConstant.STATUS_DEFAULT);
inInfo.setMsg("操作成功!本次对[" + fCg001s.size() + "]条数据保存成功!");
} catch (Exception e) {
LogUtils.setDetailMsg(inInfo, e, "保存失败");
}
return inInfo;
}
/**
* 数据校验
*
* @param fCg001s
* @param dbCg001Map
*/
private void checkSaveData(List<HGCG001> fCg001s, Map<String, HGCG001> dbCg001Map) {
for (HGCG001 fCg001 : fCg001s) {
String planNo = fCg001.getPlanNo();
HGCG001 dbCg001 = dbCg001Map.get(planNo);
AssertUtils.isNull(dbCg001, String.format("计划[%s]不存在", planNo));
AssertUtils.isNotEquals(HGConstant.planStatus.S_0, dbCg001.getStatus(),
String.format("计划[%s]状态不是\"待审核\",不允许操作", planNo));
AssertUtils.isGe(BigDecimal.ZERO, fCg001.getPurQty(), String.format("计划[%s]采购数量必须大于0", planNo));
AssertUtils.isGe(BigDecimal.ZERO, fCg001.getPurWeight(), String.format("计划[%s]采购重量必须大于0", planNo));
}
}
/**
* 数据保存
*
* @param fCg001s
*/
private void saveData(List<HGCG001> fCg001s) {
for (HGCG001 fCg001 : fCg001s) {
DaoUtils.update(HGSqlConstant.HgCg001.UPDATE_PUR, fCg001);
}
}
/**
* 删除操作.
*
* @param inInfo
* @return
*/
@OperationLogAnnotation(operModul = "采购计划", operType = "修改", operDesc = "删除")
public EiInfo remove(EiInfo inInfo) {
try {
List<HGCG001> fCg001s = MapUtils.toDaoEPBase(inInfo, HGCG001.class);
// db数据
Map<String, HGCG001> dbCg001Map = this.lockGetData(fCg001s);
// 数据校验
this.checkRemoveData(fCg001s, dbCg001Map);
// 保存数据
this.removeData(fCg001s);
inInfo = this.query(inInfo);
inInfo.setStatus(EiConstant.STATUS_DEFAULT);
inInfo.setMsg("操作成功!本次对[" + fCg001s.size() + "]条数据保存成功!");
} catch (Exception e) {
LogUtils.setDetailMsg(inInfo, e, "保存失败");
}
return inInfo;
}
/**
* 数据校验
*
* @param fCg001s
* @param dbCg001Map
*/
private void checkRemoveData(List<HGCG001> fCg001s, Map<String, HGCG001> dbCg001Map) {
for (HGCG001 fCg001 : fCg001s) {
String planNo = fCg001.getPlanNo();
HGCG001 dbCg001 = dbCg001Map.get(planNo);
AssertUtils.isNull(dbCg001, String.format("计划[%s]不存在", planNo));
AssertUtils.isNotEquals(HGConstant.planStatus.S_0, dbCg001.getStatus(),
String.format("计划[%s]状态不是\"待审核\",不允许操作", planNo));
}
}
/**
* 数据保存
*
* @param fCg001s
*/
private void removeData(List<HGCG001> fCg001s) {
for (HGCG001 fCg001 : fCg001s) {
fCg001.setDeleteFlag(DeleteFlagEnum.REMOVE.getCode());
DaoUtils.update(HGCG001.DELETE, fCg001);
}
}
/**
* 提交操作.
*
* @param inInfo
* @return
*/
@OperationLogAnnotation(operModul = "采购计划", operType = "修改", operDesc = "保存")
public EiInfo submit(EiInfo inInfo) {
try {
List<HGCG001> fCg001s = MapUtils.toDaoEPBase(inInfo, HGCG001.class);
// db数据
Map<String, HGCG001> dbCg001Map = this.lockGetData(fCg001s);
// 数据校验
this.checkSubmitData(fCg001s, dbCg001Map);
// 提交数据
this.submitData(fCg001s);
inInfo = this.query(inInfo);
inInfo.setStatus(EiConstant.STATUS_DEFAULT);
inInfo.setMsg("操作成功!本次对[" + fCg001s.size() + "]条数据提交成功!");
} catch (Exception e) {
LogUtils.setDetailMsg(inInfo, e, "保存失败");
}
return inInfo;
}
/**
* 数据校验
*
* @param fCg001s
* @param dbCg001Map
*/
private void checkSubmitData(List<HGCG001> fCg001s, Map<String, HGCG001> dbCg001Map) {
for (HGCG001 fCg001 : fCg001s) {
String planNo = fCg001.getPlanNo();
HGCG001 dbCg001 = dbCg001Map.get(planNo);
AssertUtils.isNull(dbCg001, String.format("计划[%s]不存在", planNo));
AssertUtils.isNotEquals(HGConstant.planStatus.S_0, dbCg001.getStatus(),
String.format("计划[%s]状态不是\"待审核\",不允许操作", planNo));
AssertUtils.isGe(BigDecimal.ZERO, dbCg001.getPurQty(), String.format("计划[%s]采购数量必须大于0", planNo));
AssertUtils.isGe(BigDecimal.ZERO, dbCg001.getPurWeight(), String.format("计划[%s]采购重量必须大于0", planNo));
}
}
/**
* 提交数据
*
* @param fCg001s
*/
private void submitData(List<HGCG001> fCg001s) {
for (HGCG001 fCg001 : fCg001s) {
fCg001.setStatus(HGConstant.planStatus.S_1);
fCg001.setAuditTime(DateUtils.shortDateTime());
fCg001.setAuditUserId(UserSessionUtils.getLoginName());
fCg001.setAuditUserName(UserSessionUtils.getLoginCName());
fCg001.setAuditReason("");
DaoUtils.update(HGSqlConstant.HgCg001.UPDATE_AUDIT, fCg001);
}
}
/**
* 锁并且获取数据
*
* @param fCg001s
* @return
*/
private Map<String, HGCG001> lockGetData(List<HGCG001> fCg001s) {
// 计划号
List<String> planNos = ObjectUtils.listEpKey(fCg001s, HGCG001.FIELD_PLAN_NO);
// 锁
HGCGTools.HgCg001.lock(planNos);
// db数据
return HGCGTools.HgCg001.map(planNos);
}
}
package com.baosight.hggp.hg.cg.service;
import com.baosight.hggp.aspect.annotation.OperationLogAnnotation;
import com.baosight.hggp.common.DdynamicEnum;
import com.baosight.hggp.core.dao.DaoUtils;
import com.baosight.hggp.core.enums.DeleteFlagEnum;
import com.baosight.hggp.core.security.UserSessionUtils;
import com.baosight.hggp.hg.cg.domain.HGCG002;
import com.baosight.hggp.hg.cg.tools.HGCGTools;
import com.baosight.hggp.hg.cg.utils.HgCgUtils;
import com.baosight.hggp.hg.constant.HGConstant;
import com.baosight.hggp.hg.constant.HGSqlConstant;
import com.baosight.hggp.util.AssertUtils;
import com.baosight.hggp.util.CommonMethod;
import com.baosight.hggp.util.DateUtils;
import com.baosight.hggp.util.EiInfoUtils;
import com.baosight.hggp.util.LogUtils;
import com.baosight.hggp.util.MapUtils;
import com.baosight.hggp.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.ServiceBase;
import java.util.Arrays;
import java.util.List;
import java.util.Map;
/**
* @author:songx
* @date:2024/5/9,11:04
*/
public class ServiceHGCG002 extends ServiceBase {
/**
* 画面初始化
*
* @param inInfo
* @return
*/
@Override
@OperationLogAnnotation(operModul = "采购合同", operType = "查询", operDesc = "初始化")
public EiInfo initLoad(EiInfo inInfo) {
try {
CommonMethod.initBlock(inInfo, Arrays.asList(DdynamicEnum.COMPANY_CODE_BLOCK_ID));
inInfo.addBlock(EiConstant.resultBlock).addBlockMeta(new HGCG002().eiMetadata);
} catch (PlatException e) {
LogUtils.setDetailMsg(inInfo, e, "初始化失败");
}
return inInfo;
}
/**
* 查询操作
*
* @param inInfo
* @return
*/
@Override
@OperationLogAnnotation(operModul = "采购合同", operType = "查询", operDesc = "查询")
public EiInfo query(EiInfo inInfo) {
try {
Map queryRow = EiInfoUtils.getFirstRow(inInfo);
HgCgUtils.HgCg002.setCondition(queryRow);
inInfo = super.query(inInfo, HGCG002.QUERY, new HGCG002());
} catch (Exception e) {
LogUtils.setDetailMsg(inInfo, e, "查询失败");
}
return inInfo;
}
/**
* 保存操作.
*
* @param inInfo
* @return
*/
@OperationLogAnnotation(operModul = "采购合同", operType = "修改", operDesc = "保存")
public EiInfo save(EiInfo inInfo) {
try {
List<HGCG002> fCg002s = MapUtils.toDaoEPBase(inInfo, HGCG002.class);
// db数据
Map<String, HGCG002> dbCg002Map = this.lockGetData(fCg002s);
// 数据校验
this.checkSaveData(fCg002s, dbCg002Map);
// 保存数据
this.saveData(fCg002s);
inInfo = this.query(inInfo);
inInfo.setStatus(EiConstant.STATUS_DEFAULT);
inInfo.setMsg("操作成功!本次对[" + fCg002s.size() + "]条数据保存成功!");
} catch (Exception e) {
LogUtils.setDetailMsg(inInfo, e, "保存失败");
}
return inInfo;
}
/**
* 数据校验
*
* @param fCg002s
* @param dbCg002Map
*/
private void checkSaveData(List<HGCG002> fCg002s, Map<String, HGCG002> dbCg002Map) {
for (HGCG002 fCg002 : fCg002s) {
String contractNo = fCg002.getContractNo();
HGCG002 dbCg002 = dbCg002Map.get(contractNo);
AssertUtils.isNull(dbCg002, String.format("合同[%s]不存在", contractNo));
AssertUtils.isNotEquals(HGConstant.planStatus.S_0, fCg002.getStatus(),
String.format("合同[%s]状态不是\"待审核\",不允许操作", contractNo));
}
}
/**
* 数据保存
*
* @param fCg002s
*/
private void saveData(List<HGCG002> fCg002s) {
for (HGCG002 fCg002 : fCg002s) {
DaoUtils.update(HGSqlConstant.HgCg002.UPDATE_PUR, fCg002);
}
}
/**
* 删除操作.
*
* @param inInfo
* @return
*/
@OperationLogAnnotation(operModul = "采购计划", operType = "修改", operDesc = "删除")
public EiInfo remove(EiInfo inInfo) {
try {
List<HGCG002> fCg002s = MapUtils.toDaoEPBase(inInfo, HGCG002.class);
// db数据
Map<String, HGCG002> dbCg002Map = this.lockGetData(fCg002s);
// 数据校验
this.checkRemoveData(fCg002s, dbCg002Map);
// 保存数据
this.removeData(fCg002s);
inInfo = this.query(inInfo);
inInfo.setStatus(EiConstant.STATUS_DEFAULT);
inInfo.setMsg("操作成功!本次对[" + fCg002s.size() + "]条数据保存成功!");
} catch (Exception e) {
LogUtils.setDetailMsg(inInfo, e, "保存失败");
}
return inInfo;
}
/**
* 数据校验
*
* @param fCg002s
* @param dbCg002Map
*/
private void checkRemoveData(List<HGCG002> fCg002s, Map<String, HGCG002> dbCg002Map) {
for (HGCG002 fCg002 : fCg002s) {
String contractNo = fCg002.getContractNo();
HGCG002 dbCg002 = dbCg002Map.get(contractNo);
AssertUtils.isNull(dbCg002, String.format("合同[%s]不存在", contractNo));
AssertUtils.isNotEquals(HGConstant.contractStatus.S_0, fCg002.getStatus(),
String.format("合同[%s]状态不是\"待审核\",不允许操作", contractNo));
}
}
/**
* 数据保存
*
* @param fCg002s
*/
private void removeData(List<HGCG002> fCg002s) {
for (HGCG002 fCg002 : fCg002s) {
fCg002.setDeleteFlag(DeleteFlagEnum.REMOVE.getCode());
DaoUtils.update(HGCG002.DELETE, fCg002);
}
}
/**
* 提交操作.
*
* @param inInfo
* @return
*/
@OperationLogAnnotation(operModul = "采购计划", operType = "修改", operDesc = "保存")
public EiInfo submit(EiInfo inInfo) {
try {
List<HGCG002> fCg002s = MapUtils.toDaoEPBase(inInfo, HGCG002.class);
// db数据
Map<String, HGCG002> dbCg002Map = this.lockGetData(fCg002s);
// 数据校验
this.checkSubmitData(fCg002s, dbCg002Map);
// 提交数据
this.submitData(fCg002s);
inInfo = this.query(inInfo);
inInfo.setStatus(EiConstant.STATUS_DEFAULT);
inInfo.setMsg("操作成功!本次对[" + fCg002s.size() + "]条数据提交成功!");
} catch (Exception e) {
LogUtils.setDetailMsg(inInfo, e, "保存失败");
}
return inInfo;
}
/**
* 数据校验
*
* @param fCg002s
* @param dbCg002Map
*/
private void checkSubmitData(List<HGCG002> fCg002s, Map<String, HGCG002> dbCg002Map) {
for (HGCG002 fCg002 : fCg002s) {
String contractNo = fCg002.getContractNo();
HGCG002 dbCg002 = dbCg002Map.get(contractNo);
AssertUtils.isNull(dbCg002, String.format("合同[%s]不存在", contractNo));
AssertUtils.isNotEquals(HGConstant.contractStatus.S_0, dbCg002.getStatus(),
String.format("合同[%s]状态不是\"待审核\",不允许操作", contractNo));
}
}
/**
* 提交数据
*
* @param fCg002s
*/
private void submitData(List<HGCG002> fCg002s) {
for (HGCG002 fCg002 : fCg002s) {
fCg002.setStatus(HGConstant.contractStatus.S_1);
fCg002.setAuditTime(DateUtils.shortDateTime());
fCg002.setAuditUserId(UserSessionUtils.getLoginName());
fCg002.setAuditUserName(UserSessionUtils.getLoginCName());
fCg002.setAuditReason("");
DaoUtils.update(HGSqlConstant.HgCg002.UPDATE_AUDIT, fCg002);
}
}
/**
* 锁并且获取数据
*
* @param fCg002s
* @return
*/
private Map<String, HGCG002> lockGetData(List<HGCG002> fCg002s) {
// 合同号
List<String> contractNos = ObjectUtils.listEpKey(fCg002s, HGCG002.FIELD_CONTRACT_NO);
// 锁
HGCGTools.HgCg002.lock(contractNos);
// db数据
return HGCGTools.HgCg002.map(contractNos);
}
}
package com.baosight.hggp.hg.cg.service;
import com.baosight.hggp.aspect.annotation.OperationLogAnnotation;
import com.baosight.hggp.common.DdynamicEnum;
import com.baosight.hggp.core.dao.DaoUtils;
import com.baosight.hggp.core.enums.DeleteFlagEnum;
import com.baosight.hggp.hg.cg.domain.HGCG001;
import com.baosight.hggp.hg.cg.domain.HGCG002;
import com.baosight.hggp.hg.cg.tools.HGCGTools;
import com.baosight.hggp.hg.cg.utils.HgCgUtils;
import com.baosight.hggp.hg.constant.HGConstant;
import com.baosight.hggp.util.AssertUtils;
import com.baosight.hggp.util.BeanUtils;
import com.baosight.hggp.util.CommonMethod;
import com.baosight.hggp.util.EiInfoUtils;
import com.baosight.hggp.util.LogUtils;
import com.baosight.hggp.util.MapUtils;
import com.baosight.hggp.util.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.ServiceBase;
import java.util.Arrays;
import java.util.List;
import java.util.Map;
/**
* @author:songx
* @date:2024/5/9,11:04
*/
public class ServiceHGCG002A extends ServiceBase {
/**
* 画面初始化
*
* @param inInfo
* @return
*/
@Override
@OperationLogAnnotation(operModul = "采购计划", operType = "查询", operDesc = "初始化")
public EiInfo initLoad(EiInfo inInfo) {
try {
CommonMethod.initBlock(inInfo, Arrays.asList(DdynamicEnum.COMPANY_CODE_BLOCK_ID));
inInfo.addBlock(EiConstant.resultBlock).addBlockMeta(new HGCG001().eiMetadata);
} catch (PlatException e) {
LogUtils.setDetailMsg(inInfo, e, "初始化失败");
}
return inInfo;
}
/**
* 查询操作
*
* @param inInfo
* @return
*/
@Override
@OperationLogAnnotation(operModul = "采购计划", operType = "查询", operDesc = "查询")
public EiInfo query(EiInfo inInfo) {
try {
Map queryRow = EiInfoUtils.getFirstRow(inInfo);
HgCgUtils.HgCg001.setCondition(queryRow);
// 仅审核通过
queryRow.put(HGCG001.FIELD_STATUS, HGConstant.planStatus.S_1);
inInfo = super.query(inInfo, HGCG001.QUERY, new HGCG001());
} catch (Exception e) {
LogUtils.setDetailMsg(inInfo, e, "查询失败");
}
return inInfo;
}
/**
* 确认操作.
*
* @param inInfo
* @return
*/
@OperationLogAnnotation(operModul = "采购计划", operType = "修改", operDesc = "确认")
public EiInfo confirm(EiInfo inInfo) {
try {
List<Map> resultRows = inInfo.getBlock(EiConstant.resultBlock).getRows();
List<HGCG001> fCg001s = MapUtils.toDaoEPBase(inInfo, HGCG001.class);
// db数据
Map<String, HGCG001> dbCg001Map = this.lockGetData(fCg001s);
// 数据校验
this.checkSaveData(fCg001s, dbCg001Map);
// 保存数据
this.confirmData(resultRows, dbCg001Map);
inInfo = this.query(inInfo);
inInfo.setStatus(EiConstant.STATUS_DEFAULT);
inInfo.setMsg("操作成功!本次对[" + fCg001s.size() + "]条数据保存成功!");
} catch (Exception e) {
LogUtils.setDetailMsg(inInfo, e, "保存失败");
}
return inInfo;
}
/**
* 数据校验
*
* @param fCg001s
* @param dbCg001Map
*/
private void checkSaveData(List<HGCG001> fCg001s, Map<String, HGCG001> dbCg001Map) {
for (HGCG001 fCg001 : fCg001s) {
String planNo = fCg001.getPlanNo();
HGCG001 dbCg001 = dbCg001Map.get(planNo);
AssertUtils.isNull(dbCg001, String.format("计划[%s]不存在", planNo));
AssertUtils.isNotEquals(HGConstant.planStatus.S_1, dbCg001.getStatus(),
String.format("计划[%s]状态不是\"审核通过\",不允许操作", planNo));
}
}
/**
* 数据保存
*
* @param resultRows
* @param dbCg001Map
*/
private void confirmData(List<Map> resultRows, Map<String, HGCG001> dbCg001Map) {
for (Map resultRow : resultRows) {
String planNo = MapUtils.getString(resultRow, HGCG001.FIELD_PLAN_NO);
String supCode = MapUtils.getString(resultRow, HGCG002.FIELD_SUP_CODE);
String supName = MapUtils.getString(resultRow, HGCG002.FIELD_SUP_NAME);
String purUserName = MapUtils.getString(resultRow, HGCG002.FIELD_PUR_USER_NAME);
HGCG002 newCg002 = BeanUtils.copy(dbCg001Map.get(planNo), HGCG002.class);
newCg002.setSupCode(supCode);
newCg002.setSupName(supName);
newCg002.setPurUserName(purUserName);
newCg002.setStatus(HGConstant.contractStatus.S_0);
newCg002.setDeleteFlag(DeleteFlagEnum.UN_REMOVE.getCode());
DaoUtils.insert(HGCG002.INSERT, newCg002);
}
}
/**
* 锁并且获取数据
*
* @param fCg001s
* @return
*/
private Map<String, HGCG001> lockGetData(List<HGCG001> fCg001s) {
// 计划号
List<String> planNos = ObjectUtils.listEpKey(fCg001s, HGCG001.FIELD_PLAN_NO);
// 锁
HGCGTools.HgCg001.lock(planNos);
// db数据
return HGCGTools.HgCg001.map(planNos);
}
}
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE sqlMap PUBLIC "-//iBATIS.com//DTD SQL Map 2.0//EN" "http://www.ibatis.com/dtd/sql-map-2.dtd">
<sqlMap namespace="HGCG001">
<sql id="column">
ID as "id",
ACCOUNT_CODE as "accountCode", <!-- 企业编码 -->
DEP_CODE as "depCode", <!-- 部门编码 -->
CREATED_BY as "createdBy", <!-- 记录创建者 -->
CREATED_NAME as "createdName", <!-- 记录创建名称 -->
CREATED_TIME as "createdTime", <!-- 记录创建时间 -->
UPDATED_BY as "updatedBy", <!-- 记录修改者 -->
UPDATED_NAME as "updatedName", <!-- 记录修改名称 -->
UPDATED_TIME as "updatedTime", <!-- 记录修改时间 -->
COMPANY_CODE as "companyCode", <!-- 公司编码 -->
COMPANY_NAME as "companyName", <!-- 公司名称 -->
PLAN_DATE as "planDate", <!-- 计划日期 -->
PLAN_NO as "planNo", <!-- 计划单号 -->
INVENT_CODE as "inventCode", <!-- 存货编码 -->
INVENT_NAME as "inventName", <!-- 存货名称 -->
SPEC as "spec", <!-- 规格 -->
MATERIAL as "material", <!-- 材质 -->
LENGTH as "length", <!-- 长度 -->
PLAN_WEIGHT as "planWeight", <!-- 计划重量 -->
PUR_QTY as "purQty", <!-- 采购数量 -->
PUR_WEIGHT as "purWeight", <!-- 采购重量 -->
STATUS as "status", <!-- 状态:0-未审批,1-审核通过,2-审核未通过 -->
AUDIT_TIME as "auditTime", <!-- 审核时间 -->
AUDIT_USER_ID as "auditUserId", <!-- 审核人ID -->
AUDIT_USER_NAME as "auditUserName", <!-- 审核人名称 -->
AUDIT_REASON as "auditReason" <!-- 审核原因 -->
</sql>
<sql id="authCondition">
<!-- 无权限时使用 -->
<isNotEmpty prepend=" AND " property="authDepCode">
DEP_CODE = #authDepCode#
</isNotEmpty>
<!-- 仅本人和部门组合 -->
<isEqual prepend=" AND " property="authCombination" compareValue="1">
(CREATED_BY = #authOnlyPeople# OR DEP_CODE IN <iterate close=")" open="(" conjunction="," property="authDepCodes">#authDepCodes[]#</iterate>)
</isEqual>
<!-- 仅本人或部门 -->
<isNotEqual prepend=" AND " property="authCombination" compareValue="1">
<isNotEmpty property="authOnlyPeople">
CREATED_BY = #authOnlyPeople#
</isNotEmpty>
<isNotEmpty property="authDepCodes">
DEP_CODE IN <iterate close=")" open="(" conjunction="," property="authDepCodes">#authDepCodes[]#</iterate>
</isNotEmpty>
</isNotEqual>
</sql>
<sql id="condition">
AND DELETE_FLAG = 0
<include refid="authCondition"/>
<include refid="idCondition"/>
<include refid="customCondition"/>
<isNotEmpty prepend=" AND " property="id">
ID = #id#
</isNotEmpty>
<isNotEmpty prepend=" AND " property="accountCode">
ACCOUNT_CODE = #accountCode#
</isNotEmpty>
<isNotEmpty prepend=" AND " property="depCode">
DEP_CODE = #depCode#
</isNotEmpty>
<isNotEmpty prepend=" AND " property="createdBy">
CREATED_BY = #createdBy#
</isNotEmpty>
<isNotEmpty prepend=" AND " property="createdName">
CREATED_NAME = #createdName#
</isNotEmpty>
<isNotEmpty prepend=" AND " property="updatedBy">
UPDATED_BY = #updatedBy#
</isNotEmpty>
<isNotEmpty prepend=" AND " property="updatedName">
UPDATED_NAME = #updatedName#
</isNotEmpty>
<isNotEmpty prepend=" AND " property="companyCode">
COMPANY_CODE = #companyCode#
</isNotEmpty>
<isNotEmpty prepend=" AND " property="companyName">
COMPANY_NAME = #companyName#
</isNotEmpty>
<isNotEmpty prepend=" AND " property="planDate">
PLAN_DATE = #planDate#
</isNotEmpty>
<isNotEmpty prepend=" AND " property="inventCode">
INVENT_CODE = #inventCode#
</isNotEmpty>
<isNotEmpty prepend=" AND " property="inventName">
INVENT_NAME = #inventName#
</isNotEmpty>
<isNotEmpty prepend=" AND " property="spec">
SPEC = #spec#
</isNotEmpty>
<isNotEmpty prepend=" AND " property="material">
MATERIAL = #material#
</isNotEmpty>
<isNotEmpty prepend=" AND " property="status">
STATUS = #status#
</isNotEmpty>
<isNotEmpty prepend=" AND " property="auditUserId">
AUDIT_USER_ID = #auditUserId#
</isNotEmpty>
<isNotEmpty prepend=" AND " property="auditUserName">
AUDIT_USER_NAME = #auditUserName#
</isNotEmpty>
</sql>
<sql id="idCondition">
<isNotEmpty prepend=" AND " property="planNo">
PLAN_NO = #planNo#
</isNotEmpty>
<isNotEmpty prepend=" AND " property="planNos">
PLAN_NO IN <iterate open="(" close=")" conjunction="," property="planNos">#planNos[]#</iterate>
</isNotEmpty>
</sql>
<sql id="customCondition">
<isNotEmpty prepend=" AND " property="createdTimeFrom">
CREATED_TIME &gt;= #createdTimeFrom#
</isNotEmpty>
<isNotEmpty prepend=" AND " property="createdTimeTo">
CREATED_TIME &lt;= #createdTimeTo#
</isNotEmpty>
</sql>
<!-- 公共修改字段 -->
<sql id="updateRevise">
UPDATED_BY = #updatedBy#,
UPDATED_NAME = #updatedName#,
UPDATED_TIME = #updatedTime#
</sql>
<sql id="orderBy">
<dynamic prepend="ORDER BY">
<isNotEmpty property="orderBy">
$orderBy$
</isNotEmpty>
<isEmpty property="orderBy">
ID DESC
</isEmpty>
</dynamic>
</sql>
<select id="query" resultClass="com.baosight.hggp.hg.cg.domain.HGCG001">
SELECT
<include refid="column"/>
FROM ${hggpSchema}.HGCG001
WHERE 1=1
<include refid="condition"/>
<include refid="orderBy"/>
</select>
<select id="count" resultClass="int">
SELECT COUNT(*) FROM ${hggpSchema}.HGCG001 WHERE 1=1
<include refid="condition"/>
</select>
<insert id="insert">
INSERT INTO ${hggpSchema}.HGCG001 (
ACCOUNT_CODE, <!-- 企业编码 -->
DEP_CODE, <!-- 部门编码 -->
CREATED_BY, <!-- 记录创建者 -->
CREATED_NAME, <!-- 记录创建名称 -->
CREATED_TIME, <!-- 记录创建时间 -->
COMPANY_CODE, <!-- 公司编码 -->
COMPANY_NAME, <!-- 公司名称 -->
PLAN_DATE, <!-- 计划日期 -->
PLAN_NO, <!-- 计划单号 -->
INVENT_CODE, <!-- 存货编码 -->
INVENT_NAME, <!-- 存货名称 -->
SPEC, <!-- 规格 -->
MATERIAL, <!-- 材质 -->
LENGTH, <!-- 长度 -->
PLAN_WEIGHT, <!-- 计划重量 -->
STATUS <!-- 状态:0-未审批,1-审核通过,2-审核未通过 -->
) VALUES (
#accountCode#, #depCode#, #createdBy#, #createdName#, #createdTime#,
#companyCode#, #companyName#, #planDate#, #planNo#, #inventCode#, #inventName#,
#spec#, #material#, #length#, #planWeight#, #status#
)
</insert>
<delete id="delete">
UPDATE ${hggpSchema}.HGCG001
SET
DELETE_FLAG = #deleteFlag#,
<include refid="updateRevise"/>
WHERE PLAN_NO = #planNo#
</delete>
<!-- 行锁 -->
<update id="lock">
UPDATE ${hggpSchema}.HGCG001
SET CREATED_TIME = CREATED_TIME
WHERE 1=1
<include refid="idCondition"/>
</update>
<!-- 修改采购信息 -->
<update id="updatePur">
UPDATE ${hggpSchema}.HGCG001
SET
PUR_QTY = #purQty#, <!-- 采购数量 -->
PUR_WEIGHT = #purWeight#, <!-- 采购重量 -->
<include refid="updateRevise"/>
WHERE PLAN_NO = #planNo#
</update>
<!-- 修改审核信息 -->
<update id="updateAudit">
UPDATE ${hggpSchema}.HGCG001
SET
STATUS = #status#, <!-- 状态:0-未审批,1-审核通过,2-审核未通过 -->
AUDIT_TIME = #auditTime#, <!-- 审核时间 -->
AUDIT_USER_ID = #auditUserId#, <!-- 审核人ID -->
AUDIT_USER_NAME = #auditUserName#, <!-- 审核人名称 -->
AUDIT_REASON = #auditReason#, <!-- 审核原因 -->
<include refid="updateRevise"/>
WHERE PLAN_NO = #planNo#
</update>
</sqlMap>
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE sqlMap PUBLIC "-//iBATIS.com//DTD SQL Map 2.0//EN" "http://www.ibatis.com/dtd/sql-map-2.dtd">
<sqlMap namespace="HGCG002">
<sql id="column">
ID as "id",
ACCOUNT_CODE as "accountCode", <!-- 企业编码 -->
DEP_CODE as "depCode", <!-- 部门编码 -->
CREATED_BY as "createdBy", <!-- 记录创建者 -->
CREATED_NAME as "createdName", <!-- 记录创建名称 -->
CREATED_TIME as "createdTime", <!-- 记录创建时间 -->
UPDATED_BY as "updatedBy", <!-- 记录修改者 -->
UPDATED_NAME as "updatedName", <!-- 记录修改名称 -->
UPDATED_TIME as "updatedTime", <!-- 记录修改时间 -->
DELETE_FLAG as "deleteFlag", <!-- 0-未删除,1-已删除 -->
COMPANY_CODE as "companyCode", <!-- 公司编码 -->
COMPANY_NAME as "companyName", <!-- 公司名称 -->
CONTRACT_DATE as "contractDate", <!-- 合同日期 -->
CONTRACT_NO as "contractNo", <!-- 合同号 -->
PLAN_NO as "planNo", <!-- 计划单号 -->
SUP_CODE as "supCode", <!-- 供应商编码 -->
SUP_NAME as "supName", <!-- 供应商名称 -->
PUR_USER_ID as "purUserId", <!-- 采购员 -->
PUR_USER_NAME as "purUserName", <!-- 采购员名称 -->
INVENT_CODE as "inventCode", <!-- 存货编码 -->
INVENT_NAME as "inventName", <!-- 存货名称 -->
SPEC as "spec", <!-- 规格 -->
MATERIAL as "material", <!-- 材质 -->
LENGTH as "length", <!-- 长度 -->
PUR_QTY as "purQty", <!-- 采购数量 -->
PUR_WEIGHT as "purWeight", <!-- 采购重量 -->
STATUS as "status", <!-- 状态:0-未审批,1-审核通过,2-审核未通过 -->
AUDIT_TIME as "auditTime", <!-- 审核时间 -->
AUDIT_USER_ID as "auditUserId", <!-- 审核人ID -->
AUDIT_USER_NAME as "auditUserName", <!-- 审核人名称 -->
AUDIT_REASON as "auditReason" <!-- 审核原因 -->
</sql>
<sql id="condition">
AND DELETE_FLAG = 0
<include refid="idCondition"/>
<include refid="customCondition"/>
<isNotEmpty prepend=" AND " property="id">
ID = #id#
</isNotEmpty>
<isNotEmpty prepend=" AND " property="accountCode">
ACCOUNT_CODE = #accountCode#
</isNotEmpty>
<isNotEmpty prepend=" AND " property="depCode">
DEP_CODE = #depCode#
</isNotEmpty>
<isNotEmpty prepend=" AND " property="createdBy">
CREATED_BY = #createdBy#
</isNotEmpty>
<isNotEmpty prepend=" AND " property="createdName">
CREATED_NAME = #createdName#
</isNotEmpty>
<isNotEmpty prepend=" AND " property="createdTime">
CREATED_TIME = #createdTime#
</isNotEmpty>
<isNotEmpty prepend=" AND " property="updatedBy">
UPDATED_BY = #updatedBy#
</isNotEmpty>
<isNotEmpty prepend=" AND " property="updatedName">
UPDATED_NAME = #updatedName#
</isNotEmpty>
<isNotEmpty prepend=" AND " property="updatedTime">
UPDATED_TIME = #updatedTime#
</isNotEmpty>
<isNotEmpty prepend=" AND " property="companyCode">
COMPANY_CODE = #companyCode#
</isNotEmpty>
<isNotEmpty prepend=" AND " property="companyName">
COMPANY_NAME = #companyName#
</isNotEmpty>
<isNotEmpty prepend=" AND " property="contractDate">
CONTRACT_DATE = #contractDate#
</isNotEmpty>
<isNotEmpty prepend=" AND " property="planNo">
PLAN_NO = #planNo#
</isNotEmpty>
<isNotEmpty prepend=" AND " property="supCode">
SUP_CODE = #supCode#
</isNotEmpty>
<isNotEmpty prepend=" AND " property="supName">
SUP_NAME = #supName#
</isNotEmpty>
<isNotEmpty prepend=" AND " property="purUserId">
PUR_USER_ID = #purUserId#
</isNotEmpty>
<isNotEmpty prepend=" AND " property="purUserName">
PUR_USER_NAME = #purUserName#
</isNotEmpty>
<isNotEmpty prepend=" AND " property="inventCode">
INVENT_CODE = #inventCode#
</isNotEmpty>
<isNotEmpty prepend=" AND " property="inventName">
INVENT_NAME = #inventName#
</isNotEmpty>
<isNotEmpty prepend=" AND " property="spec">
SPEC = #spec#
</isNotEmpty>
<isNotEmpty prepend=" AND " property="material">
MATERIAL = #material#
</isNotEmpty>
<isNotEmpty prepend=" AND " property="length">
LENGTH = #length#
</isNotEmpty>
<isNotEmpty prepend=" AND " property="purQty">
PUR_QTY = #purQty#
</isNotEmpty>
<isNotEmpty prepend=" AND " property="purWeight">
PUR_WEIGHT = #purWeight#
</isNotEmpty>
<isNotEmpty prepend=" AND " property="status">
STATUS = #status#
</isNotEmpty>
<isNotEmpty prepend=" AND " property="auditTime">
AUDIT_TIME = #auditTime#
</isNotEmpty>
<isNotEmpty prepend=" AND " property="auditUserId">
AUDIT_USER_ID = #auditUserId#
</isNotEmpty>
<isNotEmpty prepend=" AND " property="auditUserName">
AUDIT_USER_NAME = #auditUserName#
</isNotEmpty>
<isNotEmpty prepend=" AND " property="auditReason">
AUDIT_REASON = #auditReason#
</isNotEmpty>
</sql>
<sql id="idCondition">
<isNotEmpty prepend=" AND " property="contractNo">
CONTRACT_NO = #contractNo#
</isNotEmpty>
<isNotEmpty prepend=" AND " property="contractNos">
CONTRACT_NO IN <iterate open="(" close=")" conjunction="," property="contractNos">#contractNos[]#</iterate>
</isNotEmpty>
</sql>
<sql id="customCondition">
<isNotEmpty prepend=" AND " property="createdTimeFrom">
CREATED_TIME &gt;= #createdTimeFrom#
</isNotEmpty>
<isNotEmpty prepend=" AND " property="createdTimeTo">
CREATED_TIME &lt;= #createdTimeTo#
</isNotEmpty>
</sql>
<!-- 公共修改字段 -->
<sql id="updateRevise">
UPDATED_BY = #updatedBy#,
UPDATED_NAME = #updatedName#,
UPDATED_TIME = #updatedTime#
</sql>
<sql id="orderBy">
<dynamic prepend="ORDER BY">
<isNotEmpty property="orderBy">
$orderBy$
</isNotEmpty>
<isEmpty property="orderBy">
ID DESC
</isEmpty>
</dynamic>
</sql>
<select id="query" resultClass="com.baosight.hggp.hg.cg.domain.HGCG002">
SELECT
<include refid="column"/>
FROM ${hggpSchema}.HGCG002 WHERE 1=1
<include refid="condition"/>
<include refid="orderBy"/>
</select>
<select id="count" resultClass="int">
SELECT COUNT(*) FROM ${hggpSchema}.HGCG002 WHERE 1=1
<include refid="condition"/>
</select>
<insert id="insert">
INSERT INTO ${hggpSchema}.HGCG002 (
ACCOUNT_CODE, <!-- 企业编码 -->
DEP_CODE, <!-- 部门编码 -->
CREATED_BY, <!-- 记录创建者 -->
CREATED_NAME, <!-- 记录创建名称 -->
CREATED_TIME, <!-- 记录创建时间 -->
DELETE_FLAG, <!-- 0-未删除,1-已删除 -->
COMPANY_CODE, <!-- 公司编码 -->
COMPANY_NAME, <!-- 公司名称 -->
CONTRACT_DATE, <!-- 合同日期 -->
CONTRACT_NO, <!-- 合同号 -->
PLAN_NO, <!-- 计划单号 -->
INVENT_CODE, <!-- 存货编码 -->
INVENT_NAME, <!-- 存货名称 -->
SPEC, <!-- 规格 -->
MATERIAL, <!-- 材质 -->
LENGTH, <!-- 长度 -->
PUR_QTY, <!-- 采购数量 -->
PUR_WEIGHT, <!-- 采购重量 -->
STATUS <!-- 状态:0-未审批,1-审核通过,2-审核未通过 -->
) VALUES (
#accountCode#, #depCode#, #createdBy#, #createdName#, #createdTime#,
#deleteFlag#, #companyCode#, #companyName#, #contractDate#, #contractNo#, #planNo#,
#inventCode#, #inventName#, #spec#, #material#, #length#,
#purQty#, #purWeight#, #status#
)
</insert>
<delete id="delete">
UPDATE ${hggpSchema}.HGCG002
SET
DELETE_FLAG = #deleteFlag#,
<include refid="updateRevise"/>
WHERE CONTRACT_NO = #contractNo#
</delete>
<!-- 行锁 -->
<update id="lock">
UPDATE ${hggpSchema}.HGCG002
SET CREATED_TIME = CREATED_TIME
WHERE 1=1
<include refid="idCondition"/>
</update>
<!-- 修改审核信息 -->
<update id="updateAudit">
UPDATE ${hggpSchema}.HGCG002
SET
STATUS = #status#, <!-- 状态:0-未审批,1-审核通过,2-审核未通过 -->
AUDIT_TIME = #auditTime#, <!-- 审核时间 -->
AUDIT_USER_ID = #auditUserId#, <!-- 审核人ID -->
AUDIT_USER_NAME = #auditUserName#, <!-- 审核人名称 -->
AUDIT_REASON = #auditReason#, <!-- 审核原因 -->
<include refid="updateRevise"/>
WHERE CONTRACT_NO = #contractNo#
</update>
</sqlMap>
package com.baosight.hggp.hg.cg.tools;
import com.baosight.hggp.core.dao.DaoBase;
import com.baosight.hggp.hg.cg.domain.HGCG001;
import com.baosight.hggp.hg.cg.domain.HGCG002;
import com.baosight.hggp.hg.constant.HGSqlConstant;
import com.baosight.hggp.util.AssertUtils;
import org.apache.commons.collections.CollectionUtils;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
import java.util.stream.Collectors;
/**
* @author:songx
* @date:2024/5/9,14:33
*/
public class HGCGTools {
/**
* HGCG001 工具类
*
* @author:songx
* @date:2024/5/9,14:33
*/
public static class HgCg001 {
/**
* 锁
*
* @param planNos
* @return
*/
public static void lock(List<String> planNos) {
if (CollectionUtils.isEmpty(planNos)) {
return;
}
Map paramMap = new HashMap();
paramMap.put("planNos", planNos);
DaoBase.getInstance().update(HGSqlConstant.HgCg001.LOCK, paramMap);
}
/**
* 查询
*
* @param planNos
* @return
*/
public static List<HGCG001> list(List<String> planNos) {
AssertUtils.isEmpty(planNos, "计划号不能为空");
Map<String, Object> paramMap = new HashMap();
paramMap.put("planNos", planNos);
return DaoBase.getInstance().query(HGCG001.QUERY, paramMap);
}
/**
* 查询
*
* @param planNos
* @return
*/
public static Map<String, HGCG001> map(List<String> planNos) {
List<HGCG001> results = list(planNos);
return results.stream().collect(Collectors.toMap(HGCG001::getPlanNo, item -> item));
}
}
/**
* HGCG002 工具类
*
* @author:songx
* @date:2024/5/9,14:33
*/
public static class HgCg002 {
/**
* 锁
*
* @param contractNos
* @return
*/
public static void lock(List<String> contractNos) {
if (CollectionUtils.isEmpty(contractNos)) {
return;
}
Map paramMap = new HashMap();
paramMap.put("contractNos", contractNos);
DaoBase.getInstance().update(HGSqlConstant.HgCg002.LOCK, paramMap);
}
/**
* 查询
*
* @param contractNos
* @return
*/
public static List<HGCG002> list(List<String> contractNos) {
AssertUtils.isEmpty(contractNos, "计划号不能为空");
Map<String, Object> paramMap = new HashMap();
paramMap.put("contractNos", contractNos);
return DaoBase.getInstance().query(HGCG002.QUERY, paramMap);
}
/**
* 查询
*
* @param contractNos
* @return
*/
public static Map<String, HGCG002> map(List<String> contractNos) {
List<HGCG002> results = list(contractNos);
return results.stream().collect(Collectors.toMap(HGCG002::getContractNo, item -> item));
}
}
}
package com.baosight.hggp.hg.cg.utils;
import com.baosight.hggp.hg.cg.domain.HGCG001;
import com.baosight.hggp.hg.cg.domain.HGCG002;
import com.baosight.hggp.util.DateUtils;
import com.baosight.hggp.util.MapUtils;
import com.baosight.hggp.util.StringUtils;
import java.util.Map;
/**
* @author:songx
* @date:2024/5/9,13:50
*/
public class HgCgUtils {
/**
* 设置查询条件
*
* @param queryRow
*/
public static void setCondition(Map queryRow) {
// 创建时间
String createdTimeFrom = MapUtils.getString(queryRow, "createdTimeFrom");
if (StringUtils.isNotBlank(createdTimeFrom)) {
queryRow.put("createdTimeFrom", DateUtils.formatShort(createdTimeFrom));
}
String createdTimeTo = MapUtils.getString(queryRow, "createdTimeTo");
if (StringUtils.isNotBlank(createdTimeTo)) {
queryRow.put("createdTimeTo", DateUtils.formatShort(createdTimeTo));
}
}
/**
* HGCG001 工具类
*
* @author:songx
* @date:2024/5/9,16:57
*/
public static class HgCg001 {
/**
* 设置查询条件
*
* @param queryRow 集合
* @return
*/
public static void setCondition(Map queryRow) {
HgCgUtils.setCondition(queryRow);
// 计划日期
String planDate = MapUtils.getString(queryRow, HGCG001.FIELD_PLAN_DATE);
if (StringUtils.isNotBlank(planDate)) {
queryRow.put(HGCG001.FIELD_PLAN_DATE, DateUtils.formatShort(planDate));
}
}
}
/**
* HGCG002 工具类
*
* @author:songx
* @date:2024/5/9,16:58
*/
public static class HgCg002 {
/**
* 设置查询条件
*
* @param queryRow 集合
* @return
*/
public static void setCondition(Map queryRow) {
HgCgUtils.setCondition(queryRow);
// 合同日期
String contractDate = MapUtils.getString(queryRow, HGCG002.FIELD_CONTRACT_DATE);
if (StringUtils.isNotBlank(contractDate)) {
queryRow.put(HGCG002.FIELD_CONTRACT_DATE, DateUtils.formatShort(contractDate));
}
}
}
}
......@@ -5,14 +5,14 @@ package com.baosight.hggp.hg.constant;
* @date:2024/1/18,17:16
*/
public class HGConstant {
/**
* 序列号
*
* @author:songx
* @date:2021/8/17,15:22
*/
public class SequenceId {
public static class SequenceId {
// 用户ID
public static final String USER_ID = "USER_ID";
......@@ -40,7 +40,7 @@ public class HGConstant {
public static final String WH_CODE = "HGPZ007_WH_CODE";
// 项目性质编码
public static final String NAT_CODE = "HGPZ008_NAT_CODE";
//项目档案编号
public static final String PROJ_NUMBER = "PROJ_NUMBER";
// 盘点单号
......@@ -85,36 +85,56 @@ public class HGConstant {
public static final String DEVICE_CODE = "DEVICE_CODE";
//计划单号
public static final String PLAN_CODE = "PLAN_CODE";
// 计划号
public static final String PLAN_NO = "PLAN_NO";
}
/**
* 库存类型
* 计划状态
*
* @author:songx
* @date:2024/1/20,15:18
* @date:2024/2/22,13:57
*/
public class KcType {
// 采购
public static final String CG = "CG";
// 生产
public static final String SC = "SC";
// 其他
public static final String QT = "QT";
public static class planStatus {
// 待审核
public static final Integer S_0 = 0;
// 审核通过
public static final Integer S_1 = 1;
// 审核拒绝
public static final Integer S_2 = 2;
}
/**
* 计划状态常量
* 合同状态
*
* @author:songx
* @date:2024/2/22,13:57
*/
public static class planStatus {
public static class contractStatus {
// 计划中
// 待审核
public static final Integer S_0 = 0;
// 生产中
// 审核通过
public static final Integer S_1 = 1;
// 审核拒绝
public static final Integer S_2 = 2;
}
/**
* 库存类型
*
* @author:songx
* @date:2024/1/20,15:18
*/
public static class KcType {
// 采购
public static final String CG = "CG";
// 生产
public static final String SC = "SC";
// 其他
public static final String QT = "QT";
}
}
......@@ -25,6 +25,24 @@ public class HGSqlConstant {
}
/**
* HGCG002 SQL 定义
*
* @author:songx
* @date:2024/1/20,16:45
*/
public class HgCg002 {
// 模块名称
private static final String MODULE_NAME = "HGCG002.";
// 锁
public static final String LOCK = MODULE_NAME + "lock";
// 修改采购信息
public static final String UPDATE_PUR = MODULE_NAME + "updatePur";
// 修改审核信息
public static final String UPDATE_AUDIT = MODULE_NAME + "updateAudit";
}
/**
* HPKC001 SQL 定义
*
* @author:songx
......
......@@ -162,4 +162,41 @@ public class AssertUtils {
}
}
/**
* A大于等于B
*
* @param a
* @param b
*/
public static void isGe(BigDecimal a, BigDecimal b, String message) {
if (a.compareTo(b) > -1) {
throw new PlatException(message);
}
}
/**
* bool is true
*
* @param a
* @param b
* @param message
*/
public static void isEquals(Object a, Object b, String message) {
if (a == null || a.equals(b)) {
throw new PlatException(message);
}
}
/**
* bool is true
*
* @param a
* @param b
* @param message
*/
public static void isNotEquals(Object a, Object b, String message) {
if (a == null || !a.equals(b)) {
throw new PlatException(message);
}
}
}
package com.baosight.hggp.util;
import com.baosight.iplat4j.core.data.DaoEPBase;
import com.baosight.iplat4j.core.ei.EiConstant;
import com.baosight.iplat4j.core.ei.EiInfo;
import org.apache.commons.collections.CollectionUtils;
import org.apache.commons.lang3.StringUtils;
import java.math.BigDecimal;
......@@ -9,11 +13,15 @@ import java.util.HashMap;
import java.util.Iterator;
import java.util.List;
import java.util.Map;
import java.util.stream.Collectors;
import lombok.extern.slf4j.Slf4j;
/**
* @author:songx
* @date:2021/7/24,14:45
*/
@Slf4j
public class MapUtils extends org.apache.commons.collections.MapUtils {
/**
......@@ -148,4 +156,51 @@ public class MapUtils extends org.apache.commons.collections.MapUtils {
return resultMap;
}
/**
* map 转 DaoEPBase
*
* @param inInfo
* @param clazz
* @param <T>
*/
public static <T extends DaoEPBase> List<T> toDaoEPBase(EiInfo inInfo, Class<T> clazz) {
return toDaoEPBase(inInfo, EiConstant.resultBlock, clazz);
}
/**
* map 转 DaoEPBase
*
* @param inInfo
* @param blockId
* @param clazz
* @param <T>
*/
public static <T extends DaoEPBase> List<T> toDaoEPBase(EiInfo inInfo, String blockId, Class<T> clazz) {
List<Map> rows = inInfo.getBlock(blockId).getRows();
return toDaoEPBase(rows, clazz);
}
/**
* map 转 DaoEPBase
*
* @param maps
* @param clazz
* @param <T>
*/
public static <T extends DaoEPBase> List<T> toDaoEPBase(List<Map> maps, Class<T> clazz) {
if (CollectionUtils.isEmpty(maps) || clazz == null) {
return null;
}
return maps.stream().map(row -> {
T newBean = null;
try {
newBean = clazz.newInstance();
newBean.fromMap(row);
} catch (Exception e) {
log.error("class new instance fail:{}", e.getMessage(), e);
}
return newBean;
}).filter(t -> t != null).collect(Collectors.toList());
}
}
$(function () {
IPLATUI.EFGrid = {
"result": {
exportGrid: false, // 隐藏右侧自定义导出按钮
pageable: {
pageSize: 20,
pageSizes: [20, 50, 70, 100],
},
columns: [{
field: "length",
template: function (options) {
return options.length == 0 ? "-" : options.length;
}
}],
loadComplete: function (grid) {
// 提交
$(document.body).on("click", "#SUBMIT", submit);
},
onSave: function (e) {
// 阻止后台请求,使用自定义
e.preventDefault();
save();
},
onDelete: function (e) {
// 阻止后台请求,使用自定义
e.preventDefault();
remove();
}
}
}
// 查询
$("#QUERY").on("click", query);
downKeyUp();
});
/**
* 页面加载时执行
*/
$(window).load(function () {
// 查询
query();
});
/**
* 查询
*/
let query = function () {
resultGrid.dataSource.page(1);
}
/**
* 保存
*/
let save = function () {
let rows = resultGrid.getCheckedRows();
if (rows.length < 1) {
message("请选择数据");
return;
}
for (let i = 0; i < rows.length; i++) {
if (!isPositiveNumber(rows[i]['purQty'])) {
message("勾选的第" + (i + 1) + "行采购数量必须是大于0的数字");
return;
}
if (!isPositiveNumber(rows[i]['purWeight'])) {
message("勾选的第" + (i + 1) + "行采购重量必须是大于0的数字");
return;
}
}
JSUtils.confirm("确定对勾选中的[" + rows.length + "]条数据做\"保存\"操作? ", {
ok: function () {
JSUtils.submitGridsData("result", "HGCG001", "save", true);
}
});
}
/**
* 删除
*/
let remove = function () {
let rows = resultGrid.getCheckedRows();
if (rows.length < 1) {
message("请选择数据");
return;
}
JSUtils.confirm("确定对勾选中的[" + rows.length + "]条数据做\"删除\"操作? ", {
ok: function () {
JSUtils.submitGridsData("result", "HGCG001", "remove", true);
}
});
}
/**
* 提交
*/
let submit = function () {
let rows = resultGrid.getCheckedRows();
if (rows.length < 1) {
message("请选择数据");
return;
}
JSUtils.confirm("确定对勾选中的[" + rows.length + "]条数据做\"提交\"操作? ", {
ok: function () {
JSUtils.submitGridsData("result", "HGCG001", "submit", true);
}
});
}
<!DOCTYPE html>
<%@ page contentType="text/html; charset=UTF-8" %>
<%@ taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c" %>
<%@ taglib prefix="EF" tagdir="/WEB-INF/tags/EF" %>
<c:set var="ctx" value="${pageContext.request.contextPath}"/>
<EF:EFPage title="采购计划">
<EF:EFRegion id="inqu" title="查询条件">
<div class="row">
<EF:EFDatePicker cname="计划日期" blockId="inqu_status" ename="planDate" row="0" colWidth="3"
role="date" format="yyyy-MM-dd" readonly="true"/>
<EF:EFInput cname="计划单号" blockId="inqu_status" ename="planNo" row="0" colWidth="3"/>
<EF:EFSelect cname="公司名称" blockId="inqu_status" ename="companyCode" row="0" colWidth="3"
filter="contains" optionLabel="全部" defultValue="">
<EF:EFOptions blockId="company_code_block_id" textField="textField" valueField="valueField"/>
</EF:EFSelect>
<EF:EFSelect cname="状态" blockId="inqu_status" ename="status" row="0" colWidth="3" optionLabel="全部"
defultValue="">
<EF:EFCodeOption codeName="hggp.hgcg.planStatus"/>
</EF:EFSelect>
</div>
<div class="row">
<EF:EFSelect cname="存货名称" blockId="inqu_status" ename="inventCode" row="0" colWidth="3"
filter="contains" optionLabel="全部" defultValue="">
<EF:EFOptions blockId="invent_name_block_id" textField="textField" valueField="valueField"/>
</EF:EFSelect>
<EF:EFSelect cname="规格" ename="inqu_status-0-spec" colWidth="3" filter="contains" optionLabel="全部"
defultValue="">
<EF:EFOptions blockId="spec_name_block_id" textField="textField" valueField="valueField"/>
</EF:EFSelect>
<EF:EFDateSpan startCname="创建时间(从)" endCname="至" blockId="inqu_status"
startName="createdTimeFrom" endName="createdTimeTo" row="0" role="datetime"
format="yyyy-MM-dd HH:mm:ss" ratio="3:3" satrtRatio="4:8" endRatio="4:8" readonly="true">
</EF:EFDateSpan>
</div>
</EF:EFRegion>
<EF:EFRegion id="result" title="明细信息">
<EF:EFGrid blockId="result" autoDraw="override" isFloat="true" checkMode="row">
<EF:EFColumn ename="id" cname="内码" hidden="true"/>
<EF:EFColumn ename="companyCode" cname="公司编码" enable="false" width="100" align="center" hidden="true"/>
<EF:EFColumn ename="companyName" cname="公司名称" enable="false" width="130" align="center"/>
<EF:EFColumn ename="planDate" cname="计划日期" enable="false" width="100" align="center" editType="date"
dateFormat="yyyy-MM-dd" parseFormats="['yyyyMMdd']"/>
<EF:EFColumn ename="planNo" cname="计划单号" enable="false" width="120" align="center"/>
<EF:EFComboColumn ename="status" cname="状态" enable="false" width="80" align="center">
<EF:EFCodeOption codeName="hggp.hgcg.planStatus"/>
</EF:EFComboColumn>
<EF:EFColumn ename="inventCode" cname="存货编码" enable="false" width="100" align="center"/>
<EF:EFColumn ename="inventName" cname="存货名称" enable="false" width="100" align="center"/>
<EF:EFColumn ename="inventRecordId" cname="规格ID" enable="false" width="120" align="center"
hidden="true"/>
<EF:EFColumn ename="spec" cname="规格" enable="false" width="120" align="center"/>
<EF:EFColumn ename="material" cname="材质" enable="false" width="80" align="center"/>
<EF:EFColumn ename="length" cname="长(M)" enable="false" width="80" align="right" format="{0:N3}"/>
<EF:EFColumn ename="planWeight" cname="计划重量" enable="false" width="120" align="right" format="{0:N3}"/>
<EF:EFColumn ename="purQty" cname="采购数量" width="120" align="right" format="{0:N3}" required="true"/>
<EF:EFColumn ename="purWeight" cname="采购重量" width="120" align="right" format="{0:N3}" required="true"/>
<EF:EFColumn ename="createdName" cname="创建人" enable="false" width="100" align="center"/>
<EF:EFColumn ename="createdTime" cname="创建时间" enable="false" width="140" align="center"
editType="datetime" parseFormats="['yyyyMMddHHmmss']"/>
</EF:EFGrid>
</EF:EFRegion>
</EF:EFPage>
$(function () {
IPLATUI.EFGrid = {
"result": {
exportGrid: false, // 隐藏右侧自定义导出按钮
pageable: {
pageSize: 20,
pageSizes: [20, 50, 70, 100],
},
columns: [{
field: "length",
template: function (options) {
return options.length == 0 ? "-" : options.length;
}
}],
loadComplete: function (grid) {
// 提交
$(document.body).on("click", "#SUBMIT", submit);
},
onSave: function (e) {
// 阻止后台请求,使用自定义
e.preventDefault();
save();
},
onDelete: function (e) {
// 阻止后台请求,使用自定义
e.preventDefault();
remove();
}
}
}
// 查询
$("#QUERY").on("click", query);
// 选择计划
$("#SELECT_PLAN").on("click", selectPlan);
downKeyUp();
});
/**
* 页面加载时执行
*/
$(window).load(function () {
// 查询
query();
});
/**
* 查询
*/
let query = function () {
resultGrid.dataSource.page(1);
}
/**
* 保存
*/
let save = function () {
let rows = resultGrid.getCheckedRows();
if (rows.length < 1) {
message("请选择数据");
return;
}
for (let i = 0; i < rows.length; i++) {
if (!isPositiveNumber(rows[i]['purQty'])) {
message("勾选的第" + (i + 1) + "行采购数量必须是大于0的数字");
return;
}
if (!isPositiveNumber(rows[i]['purWeight'])) {
message("勾选的第" + (i + 1) + "行采购重量必须是大于0的数字");
return;
}
}
JSUtils.confirm("确定对勾选中的[" + rows.length + "]条数据做\"保存\"操作? ", {
ok: function () {
JSUtils.submitGridsData("result", "HGCG001", "save", true);
}
});
}
/**
* 删除
*/
let remove = function () {
let rows = resultGrid.getCheckedRows();
if (rows.length < 1) {
message("请选择数据");
return;
}
JSUtils.confirm("确定对勾选中的[" + rows.length + "]条数据做\"删除\"操作? ", {
ok: function () {
JSUtils.submitGridsData("result", "HGCG001", "remove", true);
}
});
}
/**
* 提交
*/
let submit = function () {
let rows = resultGrid.getCheckedRows();
if (rows.length < 1) {
message("请选择数据");
return;
}
JSUtils.confirm("确定对勾选中的[" + rows.length + "]条数据做\"提交\"操作? ", {
ok: function () {
JSUtils.submitGridsData("result", "HGCG001", "submit", true);
}
});
}
/**
* 选择计划
*/
let selectPlan = function () {
JSColorbox.open({
href: "HGCG002A?methodName=initLoad",
title: "<div style='text-align: center;'>计划查询</div>",
width: "80%",
height: "70%",
callbackName: selectPlanCallback
});
}
/**
* 选择计划回调
*/
let selectPlanCallback = function () {
// 刷新页面
query();
// 关闭弹窗
JSColorbox.close();
}
<!DOCTYPE html>
<%@ page contentType="text/html; charset=UTF-8" %>
<%@ taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c" %>
<%@ taglib prefix="EF" tagdir="/WEB-INF/tags/EF" %>
<c:set var="ctx" value="${pageContext.request.contextPath}"/>
<EF:EFPage title="采购合同">
<EF:EFRegion id="inqu" title="查询条件">
<div class="row">
<EF:EFDatePicker cname="计划日期" blockId="inqu_status" ename="contractDate" row="0" colWidth="3"
role="date" format="yyyy-MM-dd" readonly="true"/>
<EF:EFInput cname="合同号" blockId="inqu_status" ename="contractNo" row="0" colWidth="3"/>
<EF:EFInput cname="计划单号" blockId="inqu_status" ename="planNo" row="0" colWidth="3"/>
<EF:EFSelect cname="状态" blockId="inqu_status" ename="status" row="0" colWidth="3" optionLabel="全部"
defultValue="">
<EF:EFCodeOption codeName="hggp.hgcg.planStatus"/>
</EF:EFSelect>
</div>
<div class="row">
<EF:EFSelect cname="公司名称" blockId="inqu_status" ename="companyCode" row="0" colWidth="3"
filter="contains" optionLabel="全部" defultValue="">
<EF:EFOptions blockId="company_code_block_id" textField="textField" valueField="valueField"/>
</EF:EFSelect>
<EF:EFSelect cname="供应商名称" blockId="inqu_status" ename="supCode" row="0" colWidth="3"
filter="contains" optionLabel="全部" defultValue="">
<EF:EFOptions blockId="company_code_block_id" textField="textField" valueField="valueField"/>
</EF:EFSelect>
<EF:EFSelect cname="存货名称" blockId="inqu_status" ename="inventCode" row="0" colWidth="3"
filter="contains" optionLabel="全部" defultValue="">
<EF:EFOptions blockId="invent_name_block_id" textField="textField" valueField="valueField"/>
</EF:EFSelect>
<EF:EFSelect cname="规格" ename="inqu_status-0-spec" colWidth="3" filter="contains" optionLabel="全部"
defultValue="">
<EF:EFOptions blockId="spec_name_block_id" textField="textField" valueField="valueField"/>
</EF:EFSelect>
</div>
<div class="row">
<EF:EFDateSpan startCname="创建时间(从)" endCname="至" blockId="inqu_status"
startName="createdTimeFrom" endName="createdTimeTo" row="0" role="datetime"
format="yyyy-MM-dd HH:mm:ss" ratio="3:3" satrtRatio="4:8" endRatio="4:8" readonly="true">
</EF:EFDateSpan>
</div>
</EF:EFRegion>
<EF:EFRegion id="result" title="明细信息">
<EF:EFGrid blockId="result" autoDraw="override" isFloat="true" checkMode="row">
<EF:EFColumn ename="id" cname="内码" hidden="true"/>
<EF:EFColumn ename="companyCode" cname="公司编码" enable="false" width="100" align="center" hidden="true"/>
<EF:EFColumn ename="companyName" cname="公司名称" enable="false" width="130" align="center"/>
<EF:EFColumn ename="contractDate" cname="合同日期" enable="false" width="100" align="center" editType="date"
dateFormat="yyyy-MM-dd" parseFormats="['yyyyMMdd']"/>
<EF:EFColumn ename="contractNo" cname="合同号" enable="false" width="120" align="center"/>
<EF:EFColumn ename="planNo" cname="计划单号" enable="false" width="120" align="center"/>
<EF:EFComboColumn ename="status" cname="状态" enable="false" width="80" align="center">
<EF:EFCodeOption codeName="hggp.hgcg.planStatus"/>
</EF:EFComboColumn>
<EF:EFComboColumn ename="supCode" cname="供应商名称" width="120" align="left" defaultValue=""
filter="contains" required="true">
<EF:EFOptions blockId="factory_record_block_id" valueField="valueField" textField="textField"/>
</EF:EFComboColumn>
<EF:EFColumn ename="purUserName" cname="采购员" width="100" align="center" required="true"/>
<EF:EFColumn ename="inventCode" cname="存货编码" enable="false" width="100" align="center"/>
<EF:EFColumn ename="inventName" cname="存货名称" enable="false" width="100" align="center"/>
<EF:EFColumn ename="inventRecordId" cname="规格ID" enable="false" width="120" align="center" hidden="true"/>
<EF:EFColumn ename="spec" cname="规格" enable="false" width="120" align="center"/>
<EF:EFColumn ename="material" cname="材质" enable="false" width="80" align="center"/>
<EF:EFColumn ename="purQty" cname="采购数量" width="120" align="right" format="{0:N3}"/>
<EF:EFColumn ename="purWeight" cname="采购重量" width="120" align="right" format="{0:N3}"/>
<EF:EFColumn ename="createdName" cname="创建人" enable="false" width="100" align="center"/>
<EF:EFColumn ename="createdTime" cname="创建时间" enable="false" width="140" align="center"
editType="datetime" parseFormats="['yyyyMMddHHmmss']"/>
</EF:EFGrid>
</EF:EFRegion>
</EF:EFPage>
$(function () {
IPLATUI.EFGrid = {
"result": {
columns: []
}
}
$("#ef_form_head").hide();
// 查询
$("#QUERY").on("click", query);
// 确认
$("#CONFIRM").on("click", confirm);
downKeyUp();
});
/**
* 页面加载时执行
*/
$(window).load(function () {
// 初始化查询
query();
});
/**
* 查询
*/
var query = function (e) {
resultGrid.dataSource.page(1);
};
/**
* 选择
*/
let confirm = function () {
let rows = resultGrid.getCheckedRows();
if (rows.length < 1) {
message("请选择数据")
return;
}
for (let i = 0; i < rows.length; i++) {
}
JSUtils.confirm("确定对勾选的[" + rows.length + "]条数据生成\"采购合同\"吗? ", {
ok: function () {
JSUtils.submitGridsData("result", "HGCG002A", "confirm",
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="计划日期" blockId="inqu_status" ename="planDate" row="0" colWidth="3"
role="date" format="yyyy-MM-dd" readonly="true"/>
<EF:EFInput cname="计划单号" blockId="inqu_status" ename="planNo" row="0" colWidth="3"/>
<EF:EFSelect cname="公司名称" blockId="inqu_status" ename="companyCode" row="0" colWidth="3"
filter="contains" optionLabel="全部" defultValue="">
<EF:EFOptions blockId="company_code_block_id" textField="textField" valueField="valueField"/>
</EF:EFSelect>
<EF:EFSelect cname="存货名称" blockId="inqu_status" ename="inventCode" row="0" colWidth="3"
filter="contains" optionLabel="全部" defultValue="">
<EF:EFOptions blockId="invent_name_block_id" textField="textField" valueField="valueField"/>
</EF:EFSelect>
</div>
<div class="row">
<EF:EFSelect cname="规格" ename="inqu_status-0-spec" colWidth="3" filter="contains" optionLabel="全部"
defultValue="">
<EF:EFOptions blockId="spec_name_block_id" textField="textField" valueField="valueField"/>
</EF:EFSelect>
<EF:EFDateSpan startCname="创建时间(从)" endCname="至" blockId="inqu_status"
startName="createdTimeFrom" endName="createdTimeTo" row="0" role="datetime"
format="yyyy-MM-dd HH:mm:ss" ratio="3:3" satrtRatio="4:8" endRatio="4:8" readonly="true">
</EF:EFDateSpan>
</div>
</EF:EFRegion>
<EF:EFRegion id="result" title="记录集">
<EF:EFGrid blockId="result" autoDraw="override" isFloat="true" checkMode="row">
<EF:EFColumn ename="id" cname="内码" hidden="true"/>
<EF:EFColumn ename="companyCode" cname="公司编码" enable="false" width="100" align="center" hidden="true"/>
<EF:EFColumn ename="companyName" cname="公司名称" enable="false" width="130" align="center"/>
<EF:EFColumn ename="planDate" cname="计划日期" enable="false" width="100" align="center" editType="date"
dateFormat="yyyy-MM-dd" parseFormats="['yyyyMMdd']"/>
<EF:EFColumn ename="planNo" cname="计划单号" enable="false" width="120" align="center"/>
<EF:EFColumn ename="inventCode" cname="存货编码" enable="false" width="100" align="center"/>
<EF:EFColumn ename="inventName" cname="存货名称" enable="false" width="100" align="center"/>
<EF:EFColumn ename="inventRecordId" cname="规格ID" enable="false" width="120" align="center"
hidden="true"/>
<EF:EFColumn ename="spec" cname="规格" enable="false" width="120" align="center"/>
<EF:EFColumn ename="material" cname="材质" enable="false" width="80" align="center"/>
<EF:EFColumn ename="length" cname="长(M)" enable="false" width="80" align="right" format="{0:N3}"/>
<EF:EFColumn ename="purQty" cname="采购数量" enable="false" width="120" align="right" format="{0:N3}"/>
<EF:EFColumn ename="purWeight" cname="采购重量" enable="false" width="120" align="right" format="{0:N3}"/>
<EF:EFColumn ename="createdName" cname="创建人" enable="false" width="100" align="center"/>
<EF:EFColumn ename="createdTime" cname="创建时间" enable="false" width="140" align="center"
editType="datetime" parseFormats="['yyyyMMddHHmmss']"/>
</EF:EFGrid>
</EF:EFRegion>
</EF:EFPage>
......@@ -33,7 +33,7 @@
editType="datetime" parseFormats="['yyyyMMddHHmmss','yyyy-MM-dd HH:mm:ss']"/>
</EF:EFGrid>
<br/>
<span style='color: red;font-size: 13px;'>说明:新增企业时会同步新增企业管理员账户,账号和密码与企业编码相同</span>
<span style='color: red;font-size: 13px;'>说明:新增企业时会同步新增企业管理员账户,账户=登录前缀0000,例如:登录前缀是HG,初始账账户就是HG0000,密码与账账户相同</span></br>
</EF:EFRegion>
</EF:EFPage>
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment