Commit ea751d9a by 宋祥

1.委外入库质检单

parent a7052ae5
...@@ -51,6 +51,8 @@ public class HGConstant { ...@@ -51,6 +51,8 @@ public class HGConstant {
public static final String HPZL001_NUMBER = "HPZL001_NUMBER"; public static final String HPZL001_NUMBER = "HPZL001_NUMBER";
// 巡检单号 // 巡检单号
public static final String SCLL_QUALITY_NO = "SCLL_QUALITY_NO"; public static final String SCLL_QUALITY_NO = "SCLL_QUALITY_NO";
// 委外入库质检单
public static final String WWRK_QUALITY_NO = "WWRK_QUALITY_NO";
//采购入库单号 //采购入库单号
public static final String HPKC001_NUMBER = "HPKC001_NUMBER"; public static final String HPKC001_NUMBER = "HPKC001_NUMBER";
......
package com.baosight.hggp.hg.dm.service; package com.baosight.hggp.hg.dm.service;
import com.baosight.hggp.core.constant.CommonConstant; import com.baosight.hggp.core.constant.CommonConstant;
import com.baosight.hggp.core.constant.S3Constant;
import com.baosight.hggp.core.dao.DaoUtils; import com.baosight.hggp.core.dao.DaoUtils;
import com.baosight.hggp.core.utils.Iplat4jUtils; import com.baosight.hggp.core.utils.Iplat4jUtils;
import com.baosight.hggp.hg.dm.domain.HGDM099; import com.baosight.hggp.hg.dm.domain.HGDM099;
import com.baosight.hggp.util.AssertUtils;
import com.baosight.hggp.util.LogUtils; import com.baosight.hggp.util.LogUtils;
import com.baosight.hggp.util.MapUtils; import com.baosight.hggp.util.MapUtils;
import com.baosight.iplat4j.core.ei.EiConstant; import com.baosight.iplat4j.core.ei.EiConstant;
...@@ -62,6 +62,9 @@ public class ServiceHGDM099 extends ServiceEPBase { ...@@ -62,6 +62,9 @@ public class ServiceHGDM099 extends ServiceEPBase {
public EiInfo upload(EiInfo inInfo) { public EiInfo upload(EiInfo inInfo) {
try { try {
HGDM099 fDm099 = MapUtils.toDaoEPBase(inInfo, HGDM099.class); HGDM099 fDm099 = MapUtils.toDaoEPBase(inInfo, HGDM099.class);
AssertUtils.isEmpty(fDm099.getBizId(), "业务ID不能为空");
AssertUtils.isEmpty(fDm099.getBizType(), "业务类型不能为空");
AssertUtils.isEmpty(fDm099.getDocId(), "文件ID不能为空");
fDm099.setDeleteFlag(CommonConstant.YesNo.NO_0); fDm099.setDeleteFlag(CommonConstant.YesNo.NO_0);
DaoUtils.insert(HGDM099.INSERT, fDm099); DaoUtils.insert(HGDM099.INSERT, fDm099);
inInfo.setStatus(EiConstant.STATUS_DEFAULT); inInfo.setStatus(EiConstant.STATUS_DEFAULT);
......
...@@ -28,7 +28,34 @@ public class HgKcConst { ...@@ -28,7 +28,34 @@ public class HgKcConst {
public static final Integer S1 = 1; public static final Integer S1 = 1;
// 质检中 // 质检中
public static final Integer S2 = 2; public static final Integer S2 = 2;
// 已完成 // 已出库
public static final Integer S3 = 3;
}
}
/**
* HGKC014 定义
*
* @author:songx
* @date:2024/1/20,16:45
*/
public static class HgKc014 {
/**
* 提交状态
*
* @author:songx
* @date:2024/5/15,15:18
*/
public static class Status {
// 未提交
public static final Integer S0 = 0;
// 已提交
public static final Integer S1 = 1;
// 质检中
public static final Integer S2 = 2;
// 已入库
public static final Integer S3 = 3; public static final Integer S3 = 3;
} }
} }
......
...@@ -42,4 +42,36 @@ public class HgKcSqlConst { ...@@ -42,4 +42,36 @@ public class HgKcSqlConst {
public static final String BATCH_DELETE = "HGKC008A.batchDelete"; public static final String BATCH_DELETE = "HGKC008A.batchDelete";
} }
/**
* HGKC014 SQL 定义
*
* @author:songx
* @date:2024/1/20,16:45
*/
public class HgKc014 {
// 锁
public static final String LOCK = "HGKC014.lock";
// 修改状态
public static final String UPDATE_STATUS = "HGKC014.updateStatus";
// 修改
public static final String UPDATE_RECEIVE_TYPE = "HGKC014.updateReceiveType";
}
/**
* HGKC014A SQL 定义
*
* @author:songx
* @date:2024/1/20,16:45
*/
public class HgKc014A {
// 锁
public static final String LOCK = "HGKC014A.lock";
// 修改状态
public static final String UPDATE_STATUS = "HGKC014A.updateStatus";
// 批量删除
public static final String BATCH_DELETE = "HGKC014A.batchDelete";
}
} }
package com.baosight.hggp.hg.kc.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.util.HashMap;
import java.util.Map;
/**
* Project: <br>
* Title:Hgkc014.java <br>
* Description: <br>
*
* Copyrigth:Baosight Software LTD.co Copyright (c) 2019. <br>
*
* @version 1.0
* @history 2024-09-30 13:25:30 create
*/
public class HGKC014 extends DaoEPBase {
private static final long serialVersionUID = 1L;
public static final String FIELD_ID = "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_DEPOSIT_DATE = "depositDate"; /* 委托入库日期*/
public static final String FIELD_DEPOSIT_CODE = "depositCode"; /* 委托入库单号*/
public static final String FIELD_WH_CODE = "whCode"; /* 仓库编码*/
public static final String FIELD_WH_NAME = "whName"; /* 仓库名称*/
public static final String FIELD_USER_ID = "userId"; /* 仓库人员*/
public static final String FIELD_STATUS = "status"; /* 提交状态 0-未入库 1-已入库*/
public static final String COL_ID = "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_DEPOSIT_DATE = "DEPOSIT_DATE"; /* 委托入库日期*/
public static final String COL_DEPOSIT_CODE = "DEPOSIT_CODE"; /* 委托入库单号*/
public static final String COL_WH_CODE = "WH_CODE"; /* 仓库编码*/
public static final String COL_WH_NAME = "WH_NAME"; /* 仓库名称*/
public static final String COL_USER_ID = "USER_ID"; /* 仓库人员*/
public static final String COL_STATUS = "STATUS"; /* 提交状态 0-未入库 1-已入库*/
public static final String QUERY = "HGKC014.query";
public static final String COUNT = "HGKC014.count";
public static final String INSERT = "HGKC014.insert";
public static final String UPDATE = "HGKC014.update";
public static final String DELETE = "HGKC014.delete";
private Long id = new Long(0); /* ID*/
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-否1-是*/
private String companyCode = " "; /* 公司编码*/
private String companyName = " "; /* 公司名称*/
private String depositDate = " "; /* 委托入库日期*/
private String depositCode = " "; /* 委托入库单号*/
private String whCode = " "; /* 仓库编码*/
private String whName = " "; /* 仓库名称*/
private String userId = " "; /* 仓库人员*/
private Integer status; /* 提交状态 0-未入库 1-已入库*/
/**
* initialize the metadata.
*/
public void initMetaData() {
EiColumn eiColumn;
eiColumn = new EiColumn(FIELD_ID);
eiColumn.setPrimaryKey(true);
eiColumn.setDescName("ID");
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_DEPOSIT_DATE);
eiColumn.setDescName("委托入库日期");
eiMetadata.addMeta(eiColumn);
eiColumn = new EiColumn(FIELD_DEPOSIT_CODE);
eiColumn.setDescName("委托入库单号");
eiMetadata.addMeta(eiColumn);
eiColumn = new EiColumn(FIELD_WH_CODE);
eiColumn.setDescName("仓库编码");
eiMetadata.addMeta(eiColumn);
eiColumn = new EiColumn(FIELD_WH_NAME);
eiColumn.setDescName("仓库名称");
eiMetadata.addMeta(eiColumn);
eiColumn = new EiColumn(FIELD_USER_ID);
eiColumn.setDescName("仓库人员");
eiMetadata.addMeta(eiColumn);
eiColumn = new EiColumn(FIELD_STATUS);
eiColumn.setDescName("提交状态 0-未入库 1-已入库");
eiMetadata.addMeta(eiColumn);
}
/**
* the constructor.
*/
public HGKC014() {
initMetaData();
}
/**
* get the id - ID.
* @return the id
*/
public Long getId() {
return this.id;
}
/**
* set the id - ID.
*
* @param id - 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 depositDate - 委托入库日期.
* @return the depositDate
*/
public String getDepositDate() {
return this.depositDate;
}
/**
* set the depositDate - 委托入库日期.
*
* @param depositDate - 委托入库日期
*/
public void setDepositDate(String depositDate) {
this.depositDate = depositDate;
}
/**
* get the depositCode - 委托入库单号.
* @return the depositCode
*/
public String getDepositCode() {
return this.depositCode;
}
/**
* set the depositCode - 委托入库单号.
*
* @param depositCode - 委托入库单号
*/
public void setDepositCode(String depositCode) {
this.depositCode = depositCode;
}
/**
* get the whCode - 仓库编码.
* @return the whCode
*/
public String getWhCode() {
return this.whCode;
}
/**
* set the whCode - 仓库编码.
*
* @param whCode - 仓库编码
*/
public void setWhCode(String whCode) {
this.whCode = whCode;
}
/**
* get the whName - 仓库名称.
* @return the whName
*/
public String getWhName() {
return this.whName;
}
/**
* set the whName - 仓库名称.
*
* @param whName - 仓库名称
*/
public void setWhName(String whName) {
this.whName = whName;
}
/**
* get the userId - 仓库人员.
* @return the userId
*/
public String getUserId() {
return this.userId;
}
/**
* set the userId - 仓库人员.
*
* @param userId - 仓库人员
*/
public void setUserId(String userId) {
this.userId = userId;
}
/**
* get the status - 提交状态 0-未入库 1-已入库.
* @return the status
*/
public Integer getStatus() {
return this.status;
}
/**
* set the status - 提交状态 0-未入库 1-已入库.
*
* @param status - 提交状态 0-未入库 1-已入库
*/
public void setStatus(Integer status) {
this.status = status;
}
/**
* get the 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));
setDepositDate(StringUtils.defaultIfEmpty(StringUtils.toString(map.get(FIELD_DEPOSIT_DATE)), depositDate));
setDepositCode(StringUtils.defaultIfEmpty(StringUtils.toString(map.get(FIELD_DEPOSIT_CODE)), depositCode));
setWhCode(StringUtils.defaultIfEmpty(StringUtils.toString(map.get(FIELD_WH_CODE)), whCode));
setWhName(StringUtils.defaultIfEmpty(StringUtils.toString(map.get(FIELD_WH_NAME)), whName));
setUserId(StringUtils.defaultIfEmpty(StringUtils.toString(map.get(FIELD_USER_ID)), userId));
setStatus(NumberUtils.toInteger(StringUtils.toString(map.get(FIELD_STATUS)), status));
}
/**
* 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_DEPOSIT_DATE, StringUtils.toString(depositDate, eiMetadata.getMeta(FIELD_DEPOSIT_DATE)));
map.put(FIELD_DEPOSIT_CODE, StringUtils.toString(depositCode, eiMetadata.getMeta(FIELD_DEPOSIT_CODE)));
map.put(FIELD_WH_CODE, StringUtils.toString(whCode, eiMetadata.getMeta(FIELD_WH_CODE)));
map.put(FIELD_WH_NAME, StringUtils.toString(whName, eiMetadata.getMeta(FIELD_WH_NAME)));
map.put(FIELD_USER_ID, StringUtils.toString(userId, eiMetadata.getMeta(FIELD_USER_ID)));
map.put(FIELD_STATUS, StringUtils.toString(status, eiMetadata.getMeta(FIELD_STATUS)));
return map;
}
}
package com.baosight.hggp.hg.kc.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:Hgkc014a.java <br>
* Description: <br>
*
* Copyrigth:Baosight Software LTD.co Copyright (c) 2019. <br>
*
* @version 1.0
* @history 2024-09-30 13:25:33 create
*/
public class HGKC014A extends DaoEPBase {
private static final long serialVersionUID = 1L;
public static final String FIELD_ID = "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_STATUS = "status"; /* 提交状态 0-未入库 1-已入库*/
public static final String FIELD_COMPANY_CODE = "companyCode"; /* 公司编码*/
public static final String FIELD_COMPANY_NAME = "companyName"; /* 公司名称*/
public static final String FIELD_PARENT_ID = "parentId"; /* 委托ID*/
public static final String FIELD_CONTRACT_CODE = "contractCode"; /* 委外单号*/
public static final String FIELD_DEPOSIT_CODE = "depositCode"; /* 委外入库单号*/
public static final String FIELD_INVENT_TYPE = "inventType"; /* 存货类型*/
public static final String FIELD_PRODUCT_CODE = "productCode"; /* 成品编码*/
public static final String FIELD_PRODUCT_NAME = "productName"; /* 成品名称*/
public static final String FIELD_SPEC = "spec"; /* 规格*/
public static final String FIELD_UNIT = "unit"; /* 单位*/
public static final String FIELD_DEPOSIT_QTY = "depositQty"; /* 入库数量*/
public static final String FIELD_DEPOSIT_WEIGHT = "depositWeight"; /* 入库重量*/
public static final String COL_ID = "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_STATUS = "STATUS"; /* 提交状态 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_PARENT_ID = "PARENT_ID"; /* 委托ID*/
public static final String COL_CONTRACT_CODE = "CONTRACT_CODE"; /* 委外单号*/
public static final String COL_DEPOSIT_CODE = "DEPOSIT_CODE"; /* 委外入库单号*/
public static final String COL_INVENT_TYPE = "INVENT_TYPE"; /* 存货类型*/
public static final String COL_PRODUCT_CODE = "PRODUCT_CODE"; /* 成品编码*/
public static final String COL_PRODUCT_NAME = "PRODUCT_NAME"; /* 成品名称*/
public static final String COL_SPEC = "SPEC"; /* 规格*/
public static final String COL_UNIT = "UNIT"; /* 单位*/
public static final String COL_DEPOSIT_QTY = "DEPOSIT_QTY"; /* 入库数量*/
public static final String COL_DEPOSIT_WEIGHT = "DEPOSIT_WEIGHT"; /* 入库重量*/
public static final String QUERY = "HGKC014A.query";
public static final String COUNT = "HGKC014A.count";
public static final String INSERT = "HGKC014A.insert";
public static final String UPDATE = "HGKC014A.update";
public static final String DELETE = "HGKC014A.delete";
private Long id = new Long(0); /* ID*/
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-否1-是*/
private Integer status; /* 提交状态 0-未入库 1-已入库*/
private String companyCode = " "; /* 公司编码*/
private String companyName = " "; /* 公司名称*/
private Long parentId = new Long(0); /* 委托ID*/
private String contractCode = " "; /* 委外单号*/
private String depositCode = " "; /* 委外入库单号*/
private String inventType = " "; /* 存货类型*/
private String productCode = " "; /* 成品编码*/
private String productName = " "; /* 成品名称*/
private String spec = " "; /* 规格*/
private String unit = " "; /* 单位*/
private BigDecimal depositQty = new BigDecimal("0"); /* 入库数量*/
private BigDecimal depositWeight = new BigDecimal("0"); /* 入库重量*/
/**
* initialize the metadata.
*/
public void initMetaData() {
EiColumn eiColumn;
eiColumn = new EiColumn(FIELD_ID);
eiColumn.setPrimaryKey(true);
eiColumn.setDescName("ID");
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_STATUS);
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_PARENT_ID);
eiColumn.setDescName("委托ID");
eiMetadata.addMeta(eiColumn);
eiColumn = new EiColumn(FIELD_CONTRACT_CODE);
eiColumn.setDescName("委外单号");
eiMetadata.addMeta(eiColumn);
eiColumn = new EiColumn(FIELD_DEPOSIT_CODE);
eiColumn.setDescName("委外入库单号");
eiMetadata.addMeta(eiColumn);
eiColumn = new EiColumn(FIELD_INVENT_TYPE);
eiColumn.setDescName("存货类型");
eiMetadata.addMeta(eiColumn);
eiColumn = new EiColumn(FIELD_PRODUCT_CODE);
eiColumn.setDescName("成品编码");
eiMetadata.addMeta(eiColumn);
eiColumn = new EiColumn(FIELD_PRODUCT_NAME);
eiColumn.setDescName("成品名称");
eiMetadata.addMeta(eiColumn);
eiColumn = new EiColumn(FIELD_SPEC);
eiColumn.setDescName("规格");
eiMetadata.addMeta(eiColumn);
eiColumn = new EiColumn(FIELD_UNIT);
eiColumn.setDescName("单位");
eiMetadata.addMeta(eiColumn);
eiColumn = new EiColumn(FIELD_DEPOSIT_QTY);
eiColumn.setType("N");
eiColumn.setScaleLength(0);
eiColumn.setFieldLength(20);
eiColumn.setDescName("入库数量");
eiMetadata.addMeta(eiColumn);
eiColumn = new EiColumn(FIELD_DEPOSIT_WEIGHT);
eiColumn.setType("N");
eiColumn.setScaleLength(3);
eiColumn.setFieldLength(17);
eiColumn.setDescName("入库重量");
eiMetadata.addMeta(eiColumn);
}
/**
* the constructor.
*/
public HGKC014A() {
initMetaData();
}
/**
* get the id - ID.
* @return the id
*/
public Long getId() {
return this.id;
}
/**
* set the id - ID.
*
* @param id - 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 status - 提交状态 0-未入库 1-已入库.
* @return the status
*/
public Integer getStatus() {
return this.status;
}
/**
* set the status - 提交状态 0-未入库 1-已入库.
*
* @param status - 提交状态 0-未入库 1-已入库
*/
public void setStatus(Integer status) {
this.status = status;
}
/**
* get the 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 parentId - 委托ID.
* @return the parentId
*/
public Long getParentId() {
return this.parentId;
}
/**
* set the parentId - 委托ID.
*
* @param parentId - 委托ID
*/
public void setParentId(Long parentId) {
this.parentId = parentId;
}
/**
* get the contractCode - 委外单号.
* @return the contractCode
*/
public String getContractCode() {
return this.contractCode;
}
/**
* set the contractCode - 委外单号.
*
* @param contractCode - 委外单号
*/
public void setContractCode(String contractCode) {
this.contractCode = contractCode;
}
/**
* get the depositCode - 委外入库单号.
* @return the depositCode
*/
public String getDepositCode() {
return this.depositCode;
}
/**
* set the depositCode - 委外入库单号.
*
* @param depositCode - 委外入库单号
*/
public void setDepositCode(String depositCode) {
this.depositCode = depositCode;
}
/**
* get the inventType - 存货类型.
* @return the inventType
*/
public String getInventType() {
return this.inventType;
}
/**
* set the inventType - 存货类型.
*
* @param inventType - 存货类型
*/
public void setInventType(String inventType) {
this.inventType = inventType;
}
/**
* get the productCode - 成品编码.
* @return the productCode
*/
public String getProductCode() {
return this.productCode;
}
/**
* set the productCode - 成品编码.
*
* @param productCode - 成品编码
*/
public void setProductCode(String productCode) {
this.productCode = productCode;
}
/**
* get the productName - 成品名称.
* @return the productName
*/
public String getProductName() {
return this.productName;
}
/**
* set the productName - 成品名称.
*
* @param productName - 成品名称
*/
public void setProductName(String productName) {
this.productName = productName;
}
/**
* 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 unit - 单位.
* @return the unit
*/
public String getUnit() {
return this.unit;
}
/**
* set the unit - 单位.
*
* @param unit - 单位
*/
public void setUnit(String unit) {
this.unit = unit;
}
/**
* get the depositQty - 入库数量.
* @return the depositQty
*/
public BigDecimal getDepositQty() {
return this.depositQty;
}
/**
* set the depositQty - 入库数量.
*
* @param depositQty - 入库数量
*/
public void setDepositQty(BigDecimal depositQty) {
this.depositQty = depositQty;
}
/**
* get the depositWeight - 入库重量.
* @return the depositWeight
*/
public BigDecimal getDepositWeight() {
return this.depositWeight;
}
/**
* set the depositWeight - 入库重量.
*
* @param depositWeight - 入库重量
*/
public void setDepositWeight(BigDecimal depositWeight) {
this.depositWeight = depositWeight;
}
/**
* 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));
setStatus(NumberUtils.toInteger(StringUtils.toString(map.get(FIELD_STATUS)), status));
setCompanyCode(StringUtils.defaultIfEmpty(StringUtils.toString(map.get(FIELD_COMPANY_CODE)), companyCode));
setCompanyName(StringUtils.defaultIfEmpty(StringUtils.toString(map.get(FIELD_COMPANY_NAME)), companyName));
setParentId(NumberUtils.toLong(StringUtils.toString(map.get(FIELD_PARENT_ID)), parentId));
setContractCode(StringUtils.defaultIfEmpty(StringUtils.toString(map.get(FIELD_CONTRACT_CODE)), contractCode));
setDepositCode(StringUtils.defaultIfEmpty(StringUtils.toString(map.get(FIELD_DEPOSIT_CODE)), depositCode));
setInventType(StringUtils.defaultIfEmpty(StringUtils.toString(map.get(FIELD_INVENT_TYPE)), inventType));
setProductCode(StringUtils.defaultIfEmpty(StringUtils.toString(map.get(FIELD_PRODUCT_CODE)), productCode));
setProductName(StringUtils.defaultIfEmpty(StringUtils.toString(map.get(FIELD_PRODUCT_NAME)), productName));
setSpec(StringUtils.defaultIfEmpty(StringUtils.toString(map.get(FIELD_SPEC)), spec));
setUnit(StringUtils.defaultIfEmpty(StringUtils.toString(map.get(FIELD_UNIT)), unit));
setDepositQty(NumberUtils.toBigDecimal(StringUtils.toString(map.get(FIELD_DEPOSIT_QTY)), depositQty));
setDepositWeight(NumberUtils.toBigDecimal(StringUtils.toString(map.get(FIELD_DEPOSIT_WEIGHT)), depositWeight));
}
/**
* 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_PARENT_ID, StringUtils.toString(parentId, eiMetadata.getMeta(FIELD_PARENT_ID)));
map.put(FIELD_CONTRACT_CODE, StringUtils.toString(contractCode, eiMetadata.getMeta(FIELD_CONTRACT_CODE)));
map.put(FIELD_DEPOSIT_CODE, StringUtils.toString(depositCode, eiMetadata.getMeta(FIELD_DEPOSIT_CODE)));
map.put(FIELD_INVENT_TYPE, StringUtils.toString(inventType, eiMetadata.getMeta(FIELD_INVENT_TYPE)));
map.put(FIELD_PRODUCT_CODE, StringUtils.toString(productCode, eiMetadata.getMeta(FIELD_PRODUCT_CODE)));
map.put(FIELD_PRODUCT_NAME, StringUtils.toString(productName, eiMetadata.getMeta(FIELD_PRODUCT_NAME)));
map.put(FIELD_SPEC, StringUtils.toString(spec, eiMetadata.getMeta(FIELD_SPEC)));
map.put(FIELD_UNIT, StringUtils.toString(unit, eiMetadata.getMeta(FIELD_UNIT)));
map.put(FIELD_DEPOSIT_QTY, StringUtils.toString(depositQty, eiMetadata.getMeta(FIELD_DEPOSIT_QTY)));
map.put(FIELD_DEPOSIT_WEIGHT, StringUtils.toString(depositWeight, eiMetadata.getMeta(FIELD_DEPOSIT_WEIGHT)));
map.put(FIELD_STATUS, StringUtils.toString(status, eiMetadata.getMeta(FIELD_STATUS)));
return map;
}
}
...@@ -36,14 +36,22 @@ import java.util.stream.Collectors; ...@@ -36,14 +36,22 @@ import java.util.stream.Collectors;
*/ */
public class ServiceHGKC008A extends ServiceBase { public class ServiceHGKC008A extends ServiceBase {
/**
* 初始化
*
* @param inInfo
* @return
*/
public EiInfo initLoad(EiInfo inInfo) { public EiInfo initLoad(EiInfo inInfo) {
try { try {
inInfo = super.query(inInfo, HGKC008A.QUERY, new HGKC008A()); Map queryMap = EiInfoUtils.getFirstRow(inInfo);
// 主信息
HGKC008 dbKc088 = HGKCTools.HgKc008.getById(MapUtils.getLong(queryMap, "receiveId"));
inInfo.addBlock("main").addRow(dbKc088);
String whCode = inInfo.getCellStr(EiConstant.queryBlock, ACConstants.ROW_CODE_0, HGKC008A.FIELD_WH_CODE); String whCode = inInfo.getCellStr(EiConstant.queryBlock, ACConstants.ROW_CODE_0, HGKC008A.FIELD_WH_CODE);
Map map = new HashMap(); Map map = new HashMap();
map.put(HGKC008A.FIELD_ACCOUNT_CODE, UserSessionUtils.getAccountCode()); map.put(HGKC008A.FIELD_ACCOUNT_CODE, UserSessionUtils.getAccountCode());
map.put(HGKC008A.FIELD_WH_CODE, whCode); map.put(HGKC008A.FIELD_WH_CODE, whCode);
// map.put(HGPZ004.FIELD_INVENT_TYPE_DETAILS, InventTypeDetailEnum.getInentTypeThree());
CommonMethod.initBlock(inInfo, CommonMethod.initBlock(inInfo,
Arrays.asList(DdynamicEnum.INVENT_TYPE_BOX_BLOCK_ID, DdynamicEnum.INVENT_CODE_BOX_BLOCK_ID), map, Arrays.asList(DdynamicEnum.INVENT_TYPE_BOX_BLOCK_ID, DdynamicEnum.INVENT_CODE_BOX_BLOCK_ID), map,
false false
...@@ -54,6 +62,12 @@ public class ServiceHGKC008A extends ServiceBase { ...@@ -54,6 +62,12 @@ public class ServiceHGKC008A extends ServiceBase {
return inInfo; return inInfo;
} }
/**
* 查询
*
* @param inInfo
* @return
*/
public EiInfo query(EiInfo inInfo) { public EiInfo query(EiInfo inInfo) {
try { try {
inInfo = super.query(inInfo, HGKC008A.QUERY, new HGKC008A()); inInfo = super.query(inInfo, HGKC008A.QUERY, new HGKC008A());
......
...@@ -27,6 +27,8 @@ import com.baosight.hggp.hg.kc.domain.HGKC010A; ...@@ -27,6 +27,8 @@ import com.baosight.hggp.hg.kc.domain.HGKC010A;
import com.baosight.hggp.hg.kc.domain.HGKC011; import com.baosight.hggp.hg.kc.domain.HGKC011;
import com.baosight.hggp.hg.kc.domain.HGKC013; import com.baosight.hggp.hg.kc.domain.HGKC013;
import com.baosight.hggp.hg.kc.domain.HGKC013A; import com.baosight.hggp.hg.kc.domain.HGKC013A;
import com.baosight.hggp.hg.kc.domain.HGKC014;
import com.baosight.hggp.hg.kc.domain.HGKC014A;
import com.baosight.hggp.hg.kc.utils.HGKCUtils; import com.baosight.hggp.hg.kc.utils.HGKCUtils;
import com.baosight.hggp.hg.pz.domain.HGPZ005; import com.baosight.hggp.hg.pz.domain.HGPZ005;
import com.baosight.hggp.hg.pz.domain.HGPZ005A; import com.baosight.hggp.hg.pz.domain.HGPZ005A;
...@@ -67,6 +69,49 @@ import cn.hutool.core.collection.CollectionUtil; ...@@ -67,6 +69,49 @@ import cn.hutool.core.collection.CollectionUtil;
public class HGKCTools { public class HGKCTools {
/** /**
* 更新库存
*
* @param whCode
* @param inventRecordId
* @param amount
* @param weight
*/
public static void updateStock(String whCode, Long inventRecordId, BigDecimal amount, BigDecimal weight,
String companyCode, String companyName) {
updateStock(whCode, inventRecordId, amount, weight, weight, companyCode, companyName);
}
/**
* 更新库存
*
* @param whCode
* @param inventRecordId
* @param amount
* @param unitWeight
* @param weight
*/
public static void updateStock(String whCode, Long inventRecordId, BigDecimal amount, BigDecimal unitWeight,
BigDecimal weight, String companyCode, String companyName) {
if (amount.compareTo(BigDecimal.ZERO) == 0) {
throw new PlatException("入库数量不能为空");
}
EiInfo inInfo = new EiInfo();
inInfo.set("whCode", whCode);
inInfo.set("specId", inventRecordId);
inInfo.set("invQty", amount);
inInfo.set("invUnitWeight", unitWeight);
inInfo.set("invWeight", weight);
inInfo.set("companyCode", companyCode);
inInfo.set("companyName", companyName);
inInfo.set(EiConstant.serviceName, "HGKC010");
inInfo.set(EiConstant.methodName, "updateStock");
EiInfo outInfo = XLocalManager.call(inInfo);
if (outInfo.getStatus() < 0) {
throw new PlatException("跟新库存失败:" + outInfo.getMsg());
}
}
/**
* HGKC001 工具类 * HGKC001 工具类
* *
* @author:songx * @author:songx
...@@ -89,6 +134,7 @@ public class HGKCTools { ...@@ -89,6 +134,7 @@ public class HGKCTools {
AssertUtils.isEmpty(list, "采购入库单为空!"); AssertUtils.isEmpty(list, "采购入库单为空!");
return list.get(0); return list.get(0);
} }
/** /**
* 锁 * 锁
* *
...@@ -159,6 +205,7 @@ public class HGKCTools { ...@@ -159,6 +205,7 @@ public class HGKCTools {
/** /**
* 生产入库(入库质检单) * 生产入库(入库质检单)
*
* @param receiveId * @param receiveId
*/ */
public static void putInStorageDataAndSubmit(Long receiveId) { public static void putInStorageDataAndSubmit(Long receiveId) {
...@@ -168,7 +215,8 @@ public class HGKCTools { ...@@ -168,7 +215,8 @@ public class HGKCTools {
Map<Long, HGCG003B> dbCg003BMap = HGCGUtils.HgCg003B.lockGetData(receiveIDsList); Map<Long, HGCG003B> dbCg003BMap = HGCGUtils.HgCg003B.lockGetData(receiveIDsList);
HGCG003B dbCg003B = dbCg003BMap.get(receiveId); HGCG003B dbCg003B = dbCg003BMap.get(receiveId);
HGKC001 newKc001 = new HGKC001(); HGKC001 newKc001 = new HGKC001();
BeanUtils.copyProperties(dbCg003B, newKc001,"id","createdBy","createdName","createdTime","updatedBy","updatedName","updatedTime"); BeanUtils.copyProperties(dbCg003B, newKc001, "id", "createdBy", "createdName", "createdTime", "updatedBy",
"updatedName", "updatedTime");
newKc001.setDepositDate(DateUtils.shortDate()); newKc001.setDepositDate(DateUtils.shortDate());
newKc001.setDepositNo(SequenceGenerator.getNextSequence(HGConstant.SequenceId.CG_DEPOSIT_NO)); newKc001.setDepositNo(SequenceGenerator.getNextSequence(HGConstant.SequenceId.CG_DEPOSIT_NO));
newKc001.setDepositQty(dbCg003B.getDepositQty()); newKc001.setDepositQty(dbCg003B.getDepositQty());
...@@ -181,9 +229,10 @@ public class HGKCTools { ...@@ -181,9 +229,10 @@ public class HGKCTools {
newKc001.setReceiveDetailId(dbCg003B.getId()); newKc001.setReceiveDetailId(dbCg003B.getId());
List<HGPZ007> hgpz007List = HGPZTools.HgPz007.allList(); List<HGPZ007> hgpz007List = HGPZTools.HgPz007.allList();
//获取仓库信息 //获取仓库信息
HGPZ007 hgpz007 = hgpz007List.stream().filter(wh->wh.getInventTypeDetail() != null && wh.getInventTypeDetail().intValue() == newKc001.getInventTypeDetail()).findAny().orElse(null); HGPZ007 hgpz007 = hgpz007List.stream().filter(wh -> wh.getInventTypeDetail() != null
&& wh.getInventTypeDetail().intValue() == newKc001.getInventTypeDetail()).findAny().orElse(null);
AssertUtils.isNull(hgpz007, "仓库信息未获取到,请检查仓库档案是否维护存货大类!"); AssertUtils.isNull(hgpz007, "仓库信息未获取到,请检查仓库档案是否维护存货大类!");
if(Objects.nonNull(hgpz007)){ if (Objects.nonNull(hgpz007)) {
newKc001.setWhCode(hgpz007.getWhCode()); newKc001.setWhCode(hgpz007.getWhCode());
newKc001.setWhName(hgpz007.getWhName()); newKc001.setWhName(hgpz007.getWhName());
} }
...@@ -198,6 +247,7 @@ public class HGKCTools { ...@@ -198,6 +247,7 @@ public class HGKCTools {
/** /**
* 查询 * 查询
* 成本核算数据检查 * 成本核算数据检查
*
* @param paramMap * @param paramMap
* @return * @return
*/ */
...@@ -256,7 +306,6 @@ public class HGKCTools { ...@@ -256,7 +306,6 @@ public class HGKCTools {
} }
/** /**
* HGKC003 工具类 * HGKC003 工具类
* *
...@@ -300,80 +349,93 @@ public class HGKCTools { ...@@ -300,80 +349,93 @@ public class HGKCTools {
/** /**
* 校验生产入库信息,整改单就不用校验了 * 校验生产入库信息,整改单就不用校验了
*
* @param hgzl002List * @param hgzl002List
*/ */
public static void putInStorageCheckData(List<HGZL002> hgzl002List) { public static void putInStorageCheckData(List<HGZL002> hgzl002List) {
for(HGZL002 hgzl002 : hgzl002List){ for (HGZL002 hgzl002 : hgzl002List) {
AssertUtils.isEmpty(hgzl002.getCompanyCode(), "公司编码不能为空!"); AssertUtils.isEmpty(hgzl002.getCompanyCode(), "公司编码不能为空!");
AssertUtils.isEmpty(hgzl002.getCompanyName(), "公司名称不能为空!"); AssertUtils.isEmpty(hgzl002.getCompanyName(), "公司名称不能为空!");
AssertUtils.isEmpty(hgzl002.getProjCode(), "项目编号不能为空!"); AssertUtils.isEmpty(hgzl002.getProjCode(), "项目编号不能为空!");
AssertUtils.isEmpty(hgzl002.getProjName(), "项目名称不能为空!"); AssertUtils.isEmpty(hgzl002.getProjName(), "项目名称不能为空!");
AssertUtils.isEmpty(hgzl002.getProductCode(), "存货编码不能为空!"); AssertUtils.isEmpty(hgzl002.getProductCode(), "存货编码不能为空!");
AssertUtils.isEmpty(hgzl002.getProductName(), "存货名称不能为空!"); AssertUtils.isEmpty(hgzl002.getProductName(), "存货名称不能为空!");
AssertUtils.isTrue(Objects.isNull(hgzl002.getId())||hgzl002.getId()<=0, "质检单明细ID不能为空!"); AssertUtils.isTrue(Objects.isNull(hgzl002.getId()) || hgzl002.getId() <= 0, "质检单明细ID不能为空!");
AssertUtils.isTrue(hgzl002.getPassQuantity().compareTo(BigDecimal.ZERO) == 0 AssertUtils.isTrue(hgzl002.getPassQuantity().compareTo(BigDecimal.ZERO) == 0
&& hgzl002.getUnpassQuantity().compareTo(BigDecimal.ZERO) == 0, "合格数量与不合格数量不能都为0!"); && hgzl002.getUnpassQuantity().compareTo(BigDecimal.ZERO) == 0, "合格数量与不合格数量不能都为0!");
} }
} }
/** /**
* 生产入库(工序质检单) * 生产入库(工序质检单)
*
* @param hgzl002List * @param hgzl002List
*/ */
public static void putInStorageData(List<HGZL002> hgzl002List) { public static void putInStorageData(List<HGZL002> hgzl002List) {
List<HGKC003> hgkc003List = new LinkedList<>(); List<HGKC003> hgkc003List = new LinkedList<>();
//入库校验 //入库校验
putInStorageCheckData(hgzl002List); putInStorageCheckData(hgzl002List);
setHgkc003Data(hgzl002List,hgkc003List, null, null); setHgkc003Data(hgzl002List, hgkc003List, null, null);
DaoUtils.insertBatch(HGKC003.INSERT,hgkc003List); DaoUtils.insertBatch(HGKC003.INSERT, hgkc003List);
//可能全部不合格 //可能全部不合格
if(!CollectionUtils.isEmpty(hgkc003List)){ if (!CollectionUtils.isEmpty(hgkc003List)) {
//查看是否能获取到账期,获取不到就提示 //查看是否能获取到账期,获取不到就提示
List<String> inventCodes = hgkc003List.stream().map(HGKC003::getPrdtCode).collect(Collectors.toList()); List<String> inventCodes = hgkc003List.stream().map(HGKC003::getPrdtCode).collect(Collectors.toList());
List<HGPZ005A> hgpz005AList = HGPZTools.HgPz005A.queryByInventCodes(inventCodes); List<HGPZ005A> hgpz005AList = HGPZTools.HgPz005A.queryByInventCodes(inventCodes);
hgkc003List.forEach(hgkc003->{ hgkc003List.forEach(hgkc003 -> {
//修改计划生产任务完工数量 //修改计划生产任务完工数量
HGSCTools.complete(hgkc003.getQualityId(),hgkc003.getInvQty(),hgkc003.getRectificationId(),HGConstant.StorageType.RK); HGSCTools.complete(hgkc003.getQualityId(), hgkc003.getInvQty(), hgkc003.getRectificationId(),
HGConstant.StorageType.RK);
//查询当前工序 //查询当前工序
HGPZ005A hgpz005A = hgpz005AList.stream().filter(o -> o.getId().equals(hgkc003.getInventProcessId())).findAny().orElse(null); HGPZ005A hgpz005A = hgpz005AList.stream()
.filter(o -> o.getId().equals(hgkc003.getInventProcessId())).findAny().orElse(null);
AssertUtils.isNull(hgpz005A, "未获取到当前工序信息!"); AssertUtils.isNull(hgpz005A, "未获取到当前工序信息!");
//查询比当前工序靠后的工序是否存在,不存在说明是最后工序,修改实时库存 //查询比当前工序靠后的工序是否存在,不存在说明是最后工序,修改实时库存
List<HGPZ005A> nextHgpz005AList = hgpz005AList.stream().filter(o->o.getProcessOrder().compareTo(hgpz005A.getProcessOrder()) == 1).collect(Collectors.toList()); List<HGPZ005A> nextHgpz005AList = hgpz005AList.stream()
if(CollectionUtils.isEmpty(nextHgpz005AList)){ .filter(o -> o.getProcessOrder().compareTo(hgpz005A.getProcessOrder()) == 1)
.collect(Collectors.toList());
if (CollectionUtils.isEmpty(nextHgpz005AList)) {
// 修改库存 // 修改库存
HGKCUtils.HgKc010.updateInv(hgkc003.getCompanyCode(), hgkc003.getWhCode(), hgkc003.getPrdtCode(), HGKCUtils.HgKc010.updateInv(hgkc003.getCompanyCode(), hgkc003.getWhCode(),
hgkc003.getPrdtCode(),
hgkc003.getInvQty(), hgkc003.getInvWeight()); hgkc003.getInvQty(), hgkc003.getInvWeight());
} }
}); });
} }
} }
/** /**
* 对象赋值(工序质检单) * 对象赋值(工序质检单)
*
* @param hgzl002List * @param hgzl002List
* @param code * @param code
* @param hgzl004List * @param hgzl004List
*/ */
private static void setHgkc003Data(List<HGZL002> hgzl002List, List<HGKC003> hgkc003List, Integer code, List<HGZL004> hgzl004List) { private static void setHgkc003Data(List<HGZL002> hgzl002List, List<HGKC003> hgkc003List, Integer code,
List<HGZL004> hgzl004List) {
List<String> inventCodes = hgzl002List.stream().map(HGZL002::getProductCode).collect(Collectors.toList()); List<String> inventCodes = hgzl002List.stream().map(HGZL002::getProductCode).collect(Collectors.toList());
List<HGPZ005> hgpz005List = HGPZTools.HgPz005.listByInventCodes(inventCodes); List<HGPZ005> hgpz005List = HGPZTools.HgPz005.listByInventCodes(inventCodes);
List<HGPZ007> hgpz007List = HGPZTools.HgPz007.allList(); List<HGPZ007> hgpz007List = HGPZTools.HgPz007.allList();
hgzl002List.forEach(o->{ hgzl002List.forEach(o -> {
HGPZ005 hgpz005 = hgpz005List.stream().filter(h->h.getInventCode().equals(o.getProductCode())).findAny().orElse(null); HGPZ005 hgpz005 = hgpz005List.stream().filter(h -> h.getInventCode().equals(o.getProductCode()))
.findAny().orElse(null);
HGSC008 hgsc008 = HGSCTools.THGSC008.getById(o.getWorkId()); HGSC008 hgsc008 = HGSCTools.THGSC008.getById(o.getWorkId());
if(Objects.nonNull(hgpz005)){ if (Objects.nonNull(hgpz005)) {
HGKC003 hgkc003 = new HGKC003(); HGKC003 hgkc003 = new HGKC003();
BeanUtil.copyProperties(o,hgkc003,"id"); BeanUtil.copyProperties(o, hgkc003, "id");
hgkc003.setDepositNo(SequenceGenerator.getNextSequence(HGConstant.SequenceId.PROD_DEPOSIT_NO)); hgkc003.setDepositNo(SequenceGenerator.getNextSequence(HGConstant.SequenceId.PROD_DEPOSIT_NO));
hgkc003.setQualityId(o.getId()); hgkc003.setQualityId(o.getId());
if(Objects.nonNull(code)){ if (Objects.nonNull(code)) {
HGZL004 hgzl004 = hgzl004List.stream().filter(h->h.getCheckId().equals(o.getId())).findAny().orElse(null); HGZL004 hgzl004 = hgzl004List.stream().filter(h -> h.getCheckId().equals(o.getId())).findAny()
.orElse(null);
//整改通知单 //整改通知单
hgkc003.setInvQty(o.getUnpassQuantity()); hgkc003.setInvQty(o.getUnpassQuantity());
hgkc003.setRectificationId(hgzl004.getId()); hgkc003.setRectificationId(hgzl004.getId());
}else{ } else {
//工序质检单 //工序质检单
hgkc003.setInvQty(o.getPassQuantity()); hgkc003.setInvQty(o.getPassQuantity());
} }
if(hgkc003.getInvQty().compareTo(BigDecimal.ZERO) == 0){ if (hgkc003.getInvQty().compareTo(BigDecimal.ZERO) == 0) {
return; return;
} }
//单重 //单重
...@@ -392,13 +454,15 @@ public class HGKCTools { ...@@ -392,13 +454,15 @@ public class HGKCTools {
hgkc003.setPrdtThick(hgpz005.getThick()); hgkc003.setPrdtThick(hgpz005.getThick());
hgkc003.setInventTypeDetail(hgpz005.getInventTypeDetail()); hgkc003.setInventTypeDetail(hgpz005.getInventTypeDetail());
AssertUtils.isNull(hgpz005.getInventTypeDetail(), "存货:"+hgpz005.getInventCode()+", 未维护存货大类!"); AssertUtils.isNull(hgpz005.getInventTypeDetail(), "存货:" + hgpz005.getInventCode() + ", 未维护存货大类!");
//获取仓库信息 //获取仓库信息
HGPZ007 hgpz007 = hgpz007List.stream().filter(wh->wh.getInventTypeDetail() != null && wh.getInventTypeDetail().intValue() == hgpz005.getInventTypeDetail()).findAny().orElse(null); HGPZ007 hgpz007 = hgpz007List.stream().filter(wh -> wh.getInventTypeDetail() != null
if(Objects.nonNull(hgpz007)){ && wh.getInventTypeDetail().intValue() == hgpz005.getInventTypeDetail()).findAny()
.orElse(null);
if (Objects.nonNull(hgpz007)) {
hgkc003.setWhCode(hgpz007.getWhCode()); hgkc003.setWhCode(hgpz007.getWhCode());
hgkc003.setWhName(hgpz007.getWhName()); hgkc003.setWhName(hgpz007.getWhName());
}else{ } else {
AssertUtils.isNull(hgpz007.getId(), "仓库信息未获取到,请检查仓库档案是否维护存货大类!"); AssertUtils.isNull(hgpz007.getId(), "仓库信息未获取到,请检查仓库档案是否维护存货大类!");
} }
hgkc003.setDepositDate(DateUtils.shortDate()); hgkc003.setDepositDate(DateUtils.shortDate());
...@@ -416,6 +480,7 @@ public class HGKCTools { ...@@ -416,6 +480,7 @@ public class HGKCTools {
/** /**
* 生产入库(整改通知单) * 生产入库(整改通知单)
*
* @param ids * @param ids
*/ */
public static void putInStorageByHgzl004(List<Long> ids) { public static void putInStorageByHgzl004(List<Long> ids) {
...@@ -425,18 +490,20 @@ public class HGKCTools { ...@@ -425,18 +490,20 @@ public class HGKCTools {
paramMap.put("checkType", CheckTypeEnum.PROCESS_CHECK.getCode()); paramMap.put("checkType", CheckTypeEnum.PROCESS_CHECK.getCode());
List<HGZL004> hgzl004List = DaoBase.getInstance().query(HGZL004.QUERY, paramMap); List<HGZL004> hgzl004List = DaoBase.getInstance().query(HGZL004.QUERY, paramMap);
//获取工序质检单信息,里面包含了不合格数量,在整改单审批通过时就取不合格数量 //获取工序质检单信息,里面包含了不合格数量,在整改单审批通过时就取不合格数量
List<Long> checkIds = hgzl004List.stream().filter(o->o.getCheckType().equals(CheckTypeEnum.PROCESS_CHECK.getCode())).map(HGZL004::getCheckId).collect(Collectors.toList()); List<Long> checkIds = hgzl004List.stream()
if(CollectionUtil.isNotEmpty(checkIds)){ .filter(o -> o.getCheckType().equals(CheckTypeEnum.PROCESS_CHECK.getCode()))
.map(HGZL004::getCheckId).collect(Collectors.toList());
if (CollectionUtil.isNotEmpty(checkIds)) {
Map<String, Object> checkParamMap = new HashMap(); Map<String, Object> checkParamMap = new HashMap();
checkParamMap.put("ids", checkIds); checkParamMap.put("ids", checkIds);
List<HGZL002> hgzl002List = DaoBase.getInstance().query(HGZL002.QUERY, checkParamMap); List<HGZL002> hgzl002List = DaoBase.getInstance().query(HGZL002.QUERY, checkParamMap);
//赋值 //赋值
setHgkc003Data(hgzl002List,hgkc003List,CheckTypeEnum.PROCESS_CHECK.getCode(),hgzl004List); setHgkc003Data(hgzl002List, hgkc003List, CheckTypeEnum.PROCESS_CHECK.getCode(), hgzl004List);
DaoUtils.insertBatch(HGKC003.INSERT,hgkc003List); DaoUtils.insertBatch(HGKC003.INSERT, hgkc003List);
//查看是否为最后工序,如果最后工序则不需要再进行提交 //查看是否为最后工序,如果最后工序则不需要再进行提交
List<String> inventCodes = hgkc003List.stream().map(HGKC003::getPrdtCode).collect(Collectors.toList()); List<String> inventCodes = hgkc003List.stream().map(HGKC003::getPrdtCode).collect(Collectors.toList());
List<HGPZ005A> hgpz005AList = HGPZTools.HgPz005A.queryByInventCodes(inventCodes); List<HGPZ005A> hgpz005AList = HGPZTools.HgPz005A.queryByInventCodes(inventCodes);
hgkc003List.forEach(hgkc003->{ hgkc003List.forEach(hgkc003 -> {
//修改计划生产任务完工数量 //修改计划生产任务完工数量
HGSCTools.complete(hgkc003.getQualityId(), hgkc003.getInvQty(), hgkc003.getRectificationId(), HGSCTools.complete(hgkc003.getQualityId(), hgkc003.getInvQty(), hgkc003.getRectificationId(),
HGConstant.StorageType.RK); HGConstant.StorageType.RK);
...@@ -444,10 +511,13 @@ public class HGKCTools { ...@@ -444,10 +511,13 @@ public class HGKCTools {
HGPZ005A hgpz005A = hgpz005AList.stream() HGPZ005A hgpz005A = hgpz005AList.stream()
.filter(o -> o.getInventCode().equals(hgkc003.getPrdtCode())).findAny().orElse(null); .filter(o -> o.getInventCode().equals(hgkc003.getPrdtCode())).findAny().orElse(null);
//查询比当前工序靠后的工序是否存在,不存在说明是最后工序,修改实时库存 //查询比当前工序靠后的工序是否存在,不存在说明是最后工序,修改实时库存
List<HGPZ005A> nextHgpz005AList = hgpz005AList.stream().filter(o->o.getProcessOrder().compareTo(hgpz005A.getProcessOrder()) == 1).collect(Collectors.toList()); List<HGPZ005A> nextHgpz005AList = hgpz005AList.stream()
if(CollectionUtils.isEmpty(nextHgpz005AList)){ .filter(o -> o.getProcessOrder().compareTo(hgpz005A.getProcessOrder()) == 1)
.collect(Collectors.toList());
if (CollectionUtils.isEmpty(nextHgpz005AList)) {
// 修改库存 // 修改库存
HGKCUtils.HgKc010.updateInv(hgkc003.getCompanyCode(), hgkc003.getWhCode(), hgkc003.getPrdtCode(), HGKCUtils.HgKc010.updateInv(hgkc003.getCompanyCode(), hgkc003.getWhCode(),
hgkc003.getPrdtCode(),
hgkc003.getInvQty(), hgkc003.getInvWeight()); hgkc003.getInvQty(), hgkc003.getInvWeight());
} }
}); });
...@@ -496,6 +566,7 @@ public class HGKCTools { ...@@ -496,6 +566,7 @@ public class HGKCTools {
/** /**
* 查询 * 查询
* 成本核算数据检查 * 成本核算数据检查
*
* @param paramMap * @param paramMap
* @return * @return
*/ */
...@@ -507,6 +578,7 @@ public class HGKCTools { ...@@ -507,6 +578,7 @@ public class HGKCTools {
/** /**
* 查询 * 查询
* 成本核算数据检查 * 成本核算数据检查
*
* @param paramMap * @param paramMap
* @return * @return
*/ */
...@@ -627,6 +699,7 @@ public class HGKCTools { ...@@ -627,6 +699,7 @@ public class HGKCTools {
/** /**
* 查询 * 查询
* 成本核算数据检查 * 成本核算数据检查
*
* @param paramMap * @param paramMap
* @return * @return
*/ */
...@@ -706,48 +779,6 @@ public class HGKCTools { ...@@ -706,48 +779,6 @@ public class HGKCTools {
} }
/**
* 更新库存
*
* @param whCode
* @param inventRecordId
* @param amount
* @param weight
*/
public static void updateStock(String whCode, Long inventRecordId, BigDecimal amount, BigDecimal weight,String companyCode,String companyName) {
updateStock(whCode, inventRecordId, amount,weight, weight,companyCode,companyName);
}
/**
* 更新库存
*
* @param whCode
* @param inventRecordId
* @param amount
* @param unitWeight
* @param weight
*/
public static void updateStock(String whCode, Long inventRecordId, BigDecimal amount, BigDecimal unitWeight,
BigDecimal weight,String companyCode,String companyName) {
if (amount.compareTo(BigDecimal.ZERO) == 0) {
throw new PlatException("入库数量不能为空");
}
EiInfo inInfo = new EiInfo();
inInfo.set("whCode", whCode);
inInfo.set("specId", inventRecordId);
inInfo.set("invQty", amount);
inInfo.set("invUnitWeight", unitWeight);
inInfo.set("invWeight", weight);
inInfo.set("companyCode", companyCode);
inInfo.set("companyName", companyName);
inInfo.set(EiConstant.serviceName, "HGKC010");
inInfo.set(EiConstant.methodName, "updateStock");
EiInfo outInfo = XLocalManager.call(inInfo);
if (outInfo.getStatus() < 0) {
throw new PlatException("跟新库存失败:" + outInfo.getMsg());
}
}
public static void updateStock(HGKC005 hgKc005) { public static void updateStock(HGKC005 hgKc005) {
if (hgKc005.getDiffAmount().compareTo(BigDecimal.ZERO) == 0) { if (hgKc005.getDiffAmount().compareTo(BigDecimal.ZERO) == 0) {
// throw new PlatException("入库数量不能为空"); // throw new PlatException("入库数量不能为空");
...@@ -771,6 +802,7 @@ public class HGKCTools { ...@@ -771,6 +802,7 @@ public class HGKCTools {
} }
public static class HgKc006 { public static class HgKc006 {
public static HGKC006 getById(Long id) { public static HGKC006 getById(Long id) {
AssertUtils.isEmpty(Collections.singleton(id), "ID为空!"); AssertUtils.isEmpty(Collections.singleton(id), "ID为空!");
HGKC006 result = (HGKC006) DaoBase.getInstance().get(HGKC006.QUERY, HGKC006.FIELD_ID, id); HGKC006 result = (HGKC006) DaoBase.getInstance().get(HGKC006.QUERY, HGKC006.FIELD_ID, id);
...@@ -779,13 +811,15 @@ public class HGKCTools { ...@@ -779,13 +811,15 @@ public class HGKCTools {
public static HGKC006 getByOtherEnterNo(String otherEnterNo) { public static HGKC006 getByOtherEnterNo(String otherEnterNo) {
AssertUtils.isEmpty(otherEnterNo, "申请编号为空!"); AssertUtils.isEmpty(otherEnterNo, "申请编号为空!");
HGKC006 result = (HGKC006) DaoBase.getInstance().get(HGKC006.QUERY, HGKC006.FIELD_OTHER_ENTER_NO, otherEnterNo); HGKC006 result = (HGKC006) DaoBase.getInstance()
.get(HGKC006.QUERY, HGKC006.FIELD_OTHER_ENTER_NO, otherEnterNo);
return result; return result;
} }
/** /**
* 查询 * 查询
* 成本核算数据检查 * 成本核算数据检查
*
* @param paramMap * @param paramMap
* @return * @return
*/ */
...@@ -802,10 +836,10 @@ public class HGKCTools { ...@@ -802,10 +836,10 @@ public class HGKCTools {
private static void checkData(HGKC006 hgkc006) { private static void checkData(HGKC006 hgkc006) {
AssertUtils.isEmpty(hgkc006.getDetailList(), "其它入库单明细不能为空"); AssertUtils.isEmpty(hgkc006.getDetailList(), "其它入库单明细不能为空");
AssertUtils.isTrue(Objects.isNull(hgkc006.getId())||hgkc006.getId()<=0, "其它入库单ID不能为空!"); AssertUtils.isTrue(Objects.isNull(hgkc006.getId()) || hgkc006.getId() <= 0, "其它入库单ID不能为空!");
AssertUtils.isTrue(Objects.isNull(hgkc006.getSource())||hgkc006.getSource()<=0, "其它入库单数据来源不能为空!"); AssertUtils.isTrue(Objects.isNull(hgkc006.getSource()) || hgkc006.getSource() <= 0, "其它入库单数据来源不能为空!");
AssertUtils.isTrue(StringUtils.isBlank(hgkc006.getWhCode()), "其它入库单仓库不能为空!"); AssertUtils.isTrue(StringUtils.isBlank(hgkc006.getWhCode()), "其它入库单仓库不能为空!");
hgkc006.getDetailList().forEach(o->{ hgkc006.getDetailList().forEach(o -> {
AssertUtils.isTrue(StringUtils.isBlank(o.getWhCode()), "其它入库单明细仓库不能为空!"); AssertUtils.isTrue(StringUtils.isBlank(o.getWhCode()), "其它入库单明细仓库不能为空!");
AssertUtils.isTrue(StringUtils.isBlank(o.getInventCode()), "其它入库单明细存货编码不能为空!"); AssertUtils.isTrue(StringUtils.isBlank(o.getInventCode()), "其它入库单明细存货编码不能为空!");
AssertUtils.isTrue(StringUtils.isBlank(o.getInventName()), "其它入库单明细存货名称不能为空!"); AssertUtils.isTrue(StringUtils.isBlank(o.getInventName()), "其它入库单明细存货名称不能为空!");
...@@ -817,6 +851,7 @@ public class HGKCTools { ...@@ -817,6 +851,7 @@ public class HGKCTools {
} }
public static class HgKc006A { public static class HgKc006A {
public static List<HGKC006A> getHgkc006aList(Long primaryId) { public static List<HGKC006A> getHgkc006aList(Long primaryId) {
Map paramMap = new HashMap(); Map paramMap = new HashMap();
paramMap.put("primaryId", primaryId); paramMap.put("primaryId", primaryId);
...@@ -827,6 +862,7 @@ public class HGKCTools { ...@@ -827,6 +862,7 @@ public class HGKCTools {
} }
public static class HgKc007 { public static class HgKc007 {
public static HGKC007 getById(Long id) { public static HGKC007 getById(Long id) {
AssertUtils.isEmpty(Collections.singleton(id), "ID为空!"); AssertUtils.isEmpty(Collections.singleton(id), "ID为空!");
HGKC007 result = (HGKC007) DaoBase.getInstance().get(HGKC007.QUERY, HGKC007.FIELD_ID, id); HGKC007 result = (HGKC007) DaoBase.getInstance().get(HGKC007.QUERY, HGKC007.FIELD_ID, id);
...@@ -836,6 +872,7 @@ public class HGKCTools { ...@@ -836,6 +872,7 @@ public class HGKCTools {
/** /**
* 查询 * 查询
* 成本核算数据检查 * 成本核算数据检查
*
* @param paramMap * @param paramMap
* @return * @return
*/ */
...@@ -852,10 +889,10 @@ public class HGKCTools { ...@@ -852,10 +889,10 @@ public class HGKCTools {
private static void checkData(HGKC007 hgkc007) { private static void checkData(HGKC007 hgkc007) {
AssertUtils.isEmpty(hgkc007.getDetailList(), "其它出库单明细不能为空"); AssertUtils.isEmpty(hgkc007.getDetailList(), "其它出库单明细不能为空");
AssertUtils.isTrue(Objects.isNull(hgkc007.getId())||hgkc007.getId()<=0, "其它出库单ID不能为空!"); AssertUtils.isTrue(Objects.isNull(hgkc007.getId()) || hgkc007.getId() <= 0, "其它出库单ID不能为空!");
AssertUtils.isTrue(Objects.isNull(hgkc007.getSource())||hgkc007.getSource()<=0, "其它出库单数据来源不能为空!"); AssertUtils.isTrue(Objects.isNull(hgkc007.getSource()) || hgkc007.getSource() <= 0, "其它出库单数据来源不能为空!");
AssertUtils.isTrue(StringUtils.isBlank(hgkc007.getWhCode()), "其它出库单仓库不能为空!"); AssertUtils.isTrue(StringUtils.isBlank(hgkc007.getWhCode()), "其它出库单仓库不能为空!");
hgkc007.getDetailList().forEach(o->{ hgkc007.getDetailList().forEach(o -> {
AssertUtils.isTrue(StringUtils.isBlank(o.getWhCode()), "其它出库单明细仓库不能为空!"); AssertUtils.isTrue(StringUtils.isBlank(o.getWhCode()), "其它出库单明细仓库不能为空!");
AssertUtils.isTrue(StringUtils.isBlank(o.getInventCode()), "其它出库单明细存货编码不能为空!"); AssertUtils.isTrue(StringUtils.isBlank(o.getInventCode()), "其它出库单明细存货编码不能为空!");
AssertUtils.isTrue(StringUtils.isBlank(o.getInventName()), "其它出库单明细存货名称不能为空!"); AssertUtils.isTrue(StringUtils.isBlank(o.getInventName()), "其它出库单明细存货名称不能为空!");
...@@ -868,6 +905,7 @@ public class HGKCTools { ...@@ -868,6 +905,7 @@ public class HGKCTools {
} }
public static class HgKc007A { public static class HgKc007A {
public static List<HGKC007A> getHgkc007aList(Long primaryId) { public static List<HGKC007A> getHgkc007aList(Long primaryId) {
Map paramMap = new HashMap(); Map paramMap = new HashMap();
paramMap.put("primaryId", primaryId); paramMap.put("primaryId", primaryId);
...@@ -879,7 +917,7 @@ public class HGKCTools { ...@@ -879,7 +917,7 @@ public class HGKCTools {
Map paramMap = new HashMap(); Map paramMap = new HashMap();
paramMap.put("primaryId", kc007.getId()); paramMap.put("primaryId", kc007.getId());
List<HGKC007A> results = DaoBase.getInstance().query(HGKC007A.QUERY, paramMap); List<HGKC007A> results = DaoBase.getInstance().query(HGKC007A.QUERY, paramMap);
results.forEach(o->{ results.forEach(o -> {
o.setWhName(kc007.getWhName()); o.setWhName(kc007.getWhName());
o.setWhCode(kc007.getWhCode()); o.setWhCode(kc007.getWhCode());
o.setCompanyCode(kc007.getCompanyCode()); o.setCompanyCode(kc007.getCompanyCode());
...@@ -887,9 +925,10 @@ public class HGKCTools { ...@@ -887,9 +925,10 @@ public class HGKCTools {
o.setProjCode(kc007.getProjCode()); o.setProjCode(kc007.getProjCode());
o.setProjName(kc007.getProjName()); o.setProjName(kc007.getProjName());
}); });
if (!CollectionUtil.isEmpty(results)){ if (!CollectionUtil.isEmpty(results)) {
List<String> inventCodes = results.stream().map(o -> o.getInventCode()).collect(Collectors.toList()); List<String> inventCodes = results.stream().map(o -> o.getInventCode()).collect(Collectors.toList());
List<HGKC010> kc010List = HGKCTools.HgKc010.getListByBussiness(kc007.getCompanyCode(),kc007.getWhCode(),inventCodes); List<HGKC010> kc010List = HGKCTools.HgKc010.getListByBussiness(kc007.getCompanyCode(),
kc007.getWhCode(), inventCodes);
results.forEach(o -> { results.forEach(o -> {
HGKC010 kc010 = kc010List.stream().filter(k -> k.getInventCode().equals(o.getInventCode())) HGKC010 kc010 = kc010List.stream().filter(k -> k.getInventCode().equals(o.getInventCode()))
.findAny().orElse(null); .findAny().orElse(null);
...@@ -1177,7 +1216,7 @@ public class HGKCTools { ...@@ -1177,7 +1216,7 @@ public class HGKCTools {
Map paramMap = new HashMap(); Map paramMap = new HashMap();
paramMap.put("receiveId", kc008.getId()); paramMap.put("receiveId", kc008.getId());
List<HGKC008A> results = DaoBase.getInstance().query(HGKC008A.QUERY, paramMap); List<HGKC008A> results = DaoBase.getInstance().query(HGKC008A.QUERY, paramMap);
results.forEach(o->{ results.forEach(o -> {
o.setWhName(kc008.getWhName()); o.setWhName(kc008.getWhName());
o.setWhCode(kc008.getWhCode()); o.setWhCode(kc008.getWhCode());
o.setCompanyCode(kc008.getCompanyCode()); o.setCompanyCode(kc008.getCompanyCode());
...@@ -1185,12 +1224,16 @@ public class HGKCTools { ...@@ -1185,12 +1224,16 @@ public class HGKCTools {
o.setProjCode(kc008.getProjCode()); o.setProjCode(kc008.getProjCode());
o.setProjName(kc008.getProjName()); o.setProjName(kc008.getProjName());
}); });
if (!CollectionUtil.isEmpty(results)){ if (!CollectionUtil.isEmpty(results)) {
List<String> inventCodes = results.stream().map(o -> o.getInventCode()).collect(Collectors.toList()); List<String> inventCodes = results.stream().map(o -> o.getInventCode()).collect(Collectors.toList());
List<HGKC010> kc010List = HGKCTools.HgKc010.getListByBussiness(kc008.getCompanyCode(),kc008.getWhCode(),inventCodes); List<HGKC010> kc010List = HGKCTools.HgKc010.getListByBussiness(kc008.getCompanyCode(),
results.forEach(o ->{ kc008.getWhCode(), inventCodes);
HGKC010 kc010 = kc010List.stream().filter(k -> k.getInventCode().equals(o.getInventCode())).findAny().orElse(null); results.forEach(o -> {
AssertUtils.isTrue(Objects.isNull(kc010), "仓库("+kc008.getWhCode()+"|"+kc008.getWhName()+"),不存在存货信息:("+o.getInventCode()+"|"+o.getInventName()+")"); HGKC010 kc010 = kc010List.stream().filter(k -> k.getInventCode().equals(o.getInventCode()))
.findAny().orElse(null);
AssertUtils.isTrue(Objects.isNull(kc010),
"仓库(" + kc008.getWhCode() + "|" + kc008.getWhName() + "),不存在存货信息:(" + o.getInventCode()
+ "|" + o.getInventName() + ")");
}); });
DaoUtils.updateBatch(HGKC008A.UPDATE, results); DaoUtils.updateBatch(HGKC008A.UPDATE, results);
...@@ -1310,6 +1353,7 @@ public class HGKCTools { ...@@ -1310,6 +1353,7 @@ public class HGKCTools {
* @date:2024/5/9,14:33 * @date:2024/5/9,14:33
*/ */
public static class HgKc010A { public static class HgKc010A {
/** /**
* 查询 * 查询
* *
...@@ -1322,6 +1366,7 @@ public class HGKCTools { ...@@ -1322,6 +1366,7 @@ public class HGKCTools {
paramMap.put("ids", ids); paramMap.put("ids", ids);
return DaoBase.getInstance().query(HGKC010A.QUERY, paramMap); return DaoBase.getInstance().query(HGKC010A.QUERY, paramMap);
} }
/** /**
* 查询 * 查询
* *
...@@ -1420,6 +1465,7 @@ public class HGKCTools { ...@@ -1420,6 +1465,7 @@ public class HGKCTools {
} }
public static class HgKc013 { public static class HgKc013 {
public static HGKC013 getId(Long id) { public static HGKC013 getId(Long id) {
AssertUtils.isEmpty(Collections.singleton(id), "调拨单为空!"); AssertUtils.isEmpty(Collections.singleton(id), "调拨单为空!");
Map<String, Object> paramMap = new HashMap(); Map<String, Object> paramMap = new HashMap();
...@@ -1440,4 +1486,79 @@ public class HGKCTools { ...@@ -1440,4 +1486,79 @@ public class HGKCTools {
} }
} }
/**
* HGKC014 定义
*
* @author:songx
* @date:2024/9/29,10:15
*/
public static class HgKc014 {
/**
* 修改状态
*
* @param depositCode
* @param status
* @return
*/
public static void updateStatus(String depositCode, Integer status) {
AssertUtils.isEmpty(depositCode, "入库单号不能为空");
AssertUtils.isNull(status, "状态不能为空");
Map paramMap = new HashMap();
paramMap.put(HGKC008.FIELD_APPLY_CODE, depositCode);
paramMap.put(HGKC008.FIELD_STATUS, status);
DaoBase.getInstance().update(HgKcSqlConst.HgKc014.UPDATE_STATUS, paramMap);
}
}
/**
* HGKC014A 定义
*
* @author:songx
* @date:2024/9/29,10:15
*/
public static class HgKc014A {
/**
* 修改状态
*
* @param id
* @param status
* @return
*/
public static void updateStatus(Long id, Integer status) {
AssertUtils.isNull(id, "入库单行ID不能为空");
AssertUtils.isNull(status, "状态不能为空");
Map paramMap = new HashMap();
paramMap.put(HGKC014A.FIELD_ID, id);
paramMap.put(HGKC014A.FIELD_STATUS, status);
DaoBase.getInstance().update(HgKcSqlConst.HgKc014A.UPDATE_STATUS, paramMap);
}
/**
* 查询
*
* @param ids
* @return
*/
public static List<HGKC014A> list(List<Long> ids) {
AssertUtils.isEmpty(ids, "库存ID不能为空");
Map<String, Object> paramMap = new HashMap();
paramMap.put("ids", ids);
return DaoBase.getInstance().query(HGKC014A.QUERY, paramMap);
}
/**
* 查询
*
* @param ids
* @return
*/
public static Map<Long, HGKC014A> map(List<Long> ids) {
List<HGKC014A> results = list(ids);
return results.stream().collect(Collectors.toMap(HGKC014A::getId, item -> item));
}
}
} }
...@@ -462,7 +462,8 @@ public class HGKCUtils { ...@@ -462,7 +462,8 @@ public class HGKCUtils {
private static void updateInvData(HGKC010 newKc010, HGKC010 dbKc010) { private static void updateInvData(HGKC010 newKc010, HGKC010 dbKc010) {
BigDecimal newQty = newKc010.getInvQty().add(dbKc010.getInvQty()); BigDecimal newQty = newKc010.getInvQty().add(dbKc010.getInvQty());
AssertUtils.isGt(BigDecimal.ZERO, newQty, String.format("更新后的库存数量小于0(%s),请检查", newQty)); AssertUtils.isGt(BigDecimal.ZERO, newQty, String.format("更新后的库存数量小于0(%s),请检查", newQty));
BigDecimal newWeight = newKc010.getInvWeight().add(dbKc010.getInvWeight()); BigDecimal newWeight = newQty.compareTo(BigDecimal.ZERO) == 0 ? BigDecimal.ZERO
: newKc010.getInvWeight().add(dbKc010.getInvWeight());
BigDecimal newUnitWeight = newQty.compareTo(BigDecimal.ZERO) == 0 ? BigDecimal.ZERO BigDecimal newUnitWeight = newQty.compareTo(BigDecimal.ZERO) == 0 ? BigDecimal.ZERO
: newWeight.divide(newQty, 3, RoundingMode.HALF_UP); : newWeight.divide(newQty, 3, RoundingMode.HALF_UP);
dbKc010.setInvQty(newQty); dbKc010.setInvQty(newQty);
......
...@@ -27,4 +27,25 @@ public class HgZlConst { ...@@ -27,4 +27,25 @@ public class HgZlConst {
} }
} }
/**
* @author:songx
* @date:2024/9/29,13:38
*/
public static class HgZl012 {
/**
* 状态
*
* @author:songx
* @date:2024/5/15,15:18
*/
public static class Status {
// 未处理
public static final Integer S0 = 0;
// 已处理
public static final Integer S1 = 1;
}
}
} }
...@@ -20,4 +20,18 @@ public class HgZlSqlConst { ...@@ -20,4 +20,18 @@ public class HgZlSqlConst {
public static final String PROCESS = "HGZL011.process"; public static final String PROCESS = "HGZL011.process";
} }
/**
* HGZL012
*
* @author:songx
* @date:2024/5/7,16:36
*/
public static class HgZl012 {
// 锁
public static final String LOCK = "HGZL012.lock";
// 处理
public static final String PROCESS = "HGZL012.process";
}
} }
package com.baosight.hggp.hg.zl.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:Hgzl012.java <br>
* Description: <br>
*
* Copyrigth:Baosight Software LTD.co Copyright (c) 2019. <br>
*
* @version 1.0
* @history 2024-09-30 11:01:14 create
*/
public class HGZL012 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_STATUS = "status"; /* 状态:0-质检中,1-质检完成*/
public static final String FIELD_QUALITY_NO = "qualityNo"; /* 质检单号*/
public static final String FIELD_QUALITY_DATE = "qualityDate"; /* 单据日期*/
public static final String FIELD_COMPANY_CODE = "companyCode"; /* 公司编码*/
public static final String FIELD_COMPANY_NAME = "companyName"; /* 公司名称*/
public static final String FIELD_INVENT_TYPE = "inventType"; /* 存货类型*/
public static final String FIELD_INVENT_CODE = "inventCode"; /* 存货编码*/
public static final String FIELD_INVENT_NAME = "inventName"; /* 存货名称*/
public static final String FIELD_SPEC_ID = "specId"; /* 规格ID*/
public static final String FIELD_SPEC = "spec"; /* 规格*/
public static final String FIELD_UNIT = "unit"; /* 单位*/
public static final String FIELD_APPLY_QTY = "applyQty"; /* 入库数量*/
public static final String FIELD_APPLY_UNIT_WEIGHT = "applyUnitWeight"; /* 入库单重*/
public static final String FIELD_APPLY_WEIGHT = "applyWeight"; /* 入库重量*/
public static final String FIELD_QUALITY_QTY = "qualityQty"; /* 合格数量*/
public static final String FIELD_UN_QUALITY_QTY = "unQualityQty"; /* 不合格数量*/
public static final String FIELD_DEPOSIT_CODE = "depositCode"; /* 委外入库单号*/
public static final String FIELD_DEPOSIT_LINE_CODE = "depositLineCode"; /* 委外入库行号*/
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_STATUS = "STATUS"; /* 状态:0-质检中,1-质检完成*/
public static final String COL_QUALITY_NO = "QUALITY_NO"; /* 质检单号*/
public static final String COL_QUALITY_DATE = "QUALITY_DATE"; /* 单据日期*/
public static final String COL_COMPANY_CODE = "COMPANY_CODE"; /* 公司编码*/
public static final String COL_COMPANY_NAME = "COMPANY_NAME"; /* 公司名称*/
public static final String COL_INVENT_TYPE = "INVENT_TYPE"; /* 存货类型*/
public static final String COL_INVENT_CODE = "INVENT_CODE"; /* 存货编码*/
public static final String COL_INVENT_NAME = "INVENT_NAME"; /* 存货名称*/
public static final String COL_SPEC_ID = "SPEC_ID"; /* 规格ID*/
public static final String COL_SPEC = "SPEC"; /* 规格*/
public static final String COL_UNIT = "UNIT"; /* 单位*/
public static final String COL_APPLY_QTY = "APPLY_QTY"; /* 入库数量*/
public static final String COL_APPLY_UNIT_WEIGHT = "APPLY_UNIT_WEIGHT"; /* 入库单重*/
public static final String COL_APPLY_WEIGHT = "APPLY_WEIGHT"; /* 入库重量*/
public static final String COL_QUALITY_QTY = "QUALITY_QTY"; /* 合格数量*/
public static final String COL_UN_QUALITY_QTY = "UN_QUALITY_QTY"; /* 不合格数量*/
public static final String COL_DEPOSIT_CODE = "DEPOSIT_CODE"; /* 委外入库单号*/
public static final String COL_DEPOSIT_LINE_CODE = "DEPOSIT_LINE_CODE"; /* 委外入库行号*/
public static final String QUERY = "HGZL012.query";
public static final String COUNT = "HGZL012.count";
public static final String INSERT = "HGZL012.insert";
public static final String UPDATE = "HGZL012.update";
public static final String DELETE = "HGZL012.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 = new Integer(0); /* 0-未删除,1-已删除*/
private Integer status = new Integer(0); /* 状态:0-质检中,1-质检完成*/
private String qualityNo = " "; /* 质检单号*/
private String qualityDate = " "; /* 单据日期*/
private String companyCode = " "; /* 公司编码*/
private String companyName = " "; /* 公司名称*/
private String inventType = " "; /* 存货类型*/
private String inventCode = " "; /* 存货编码*/
private String inventName = " "; /* 存货名称*/
private Long specId = new Long(0); /* 规格ID*/
private String spec = " "; /* 规格*/
private String unit = " "; /* 单位*/
private BigDecimal applyQty = new BigDecimal(0.000); /* 入库数量*/
private BigDecimal applyUnitWeight = new BigDecimal(0.000); /* 入库单重*/
private BigDecimal applyWeight = new BigDecimal(0.000); /* 入库重量*/
private BigDecimal qualityQty = new BigDecimal(0.000); /* 合格数量*/
private BigDecimal unQualityQty = new BigDecimal(0.000); /* 不合格数量*/
private String depositCode = " "; /* 委外入库单号*/
private Long depositLineCode = new Long(0); /* 委外入库行号*/
/**
* 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_STATUS);
eiColumn.setDescName("状态:0-质检中,1-质检完成");
eiMetadata.addMeta(eiColumn);
eiColumn = new EiColumn(FIELD_QUALITY_NO);
eiColumn.setDescName("质检单号");
eiMetadata.addMeta(eiColumn);
eiColumn = new EiColumn(FIELD_QUALITY_DATE);
eiColumn.setDescName("单据日期");
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_INVENT_TYPE);
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_ID);
eiColumn.setDescName("规格ID");
eiMetadata.addMeta(eiColumn);
eiColumn = new EiColumn(FIELD_SPEC);
eiColumn.setDescName("规格");
eiMetadata.addMeta(eiColumn);
eiColumn = new EiColumn(FIELD_UNIT);
eiColumn.setDescName("单位");
eiMetadata.addMeta(eiColumn);
eiColumn = new EiColumn(FIELD_APPLY_QTY);
eiColumn.setType("N");
eiColumn.setScaleLength(3);
eiColumn.setFieldLength(20);
eiColumn.setDescName("入库数量");
eiMetadata.addMeta(eiColumn);
eiColumn = new EiColumn(FIELD_APPLY_UNIT_WEIGHT);
eiColumn.setType("N");
eiColumn.setScaleLength(3);
eiColumn.setFieldLength(20);
eiColumn.setDescName("入库单重");
eiMetadata.addMeta(eiColumn);
eiColumn = new EiColumn(FIELD_APPLY_WEIGHT);
eiColumn.setType("N");
eiColumn.setScaleLength(3);
eiColumn.setFieldLength(20);
eiColumn.setDescName("入库重量");
eiMetadata.addMeta(eiColumn);
eiColumn = new EiColumn(FIELD_QUALITY_QTY);
eiColumn.setType("N");
eiColumn.setScaleLength(3);
eiColumn.setFieldLength(20);
eiColumn.setDescName("合格数量");
eiMetadata.addMeta(eiColumn);
eiColumn = new EiColumn(FIELD_UN_QUALITY_QTY);
eiColumn.setType("N");
eiColumn.setScaleLength(3);
eiColumn.setFieldLength(20);
eiColumn.setDescName("不合格数量");
eiMetadata.addMeta(eiColumn);
eiColumn = new EiColumn(FIELD_DEPOSIT_CODE);
eiColumn.setDescName("委外入库单号");
eiMetadata.addMeta(eiColumn);
eiColumn = new EiColumn(FIELD_DEPOSIT_LINE_CODE);
eiColumn.setDescName("委外入库行号");
eiMetadata.addMeta(eiColumn);
}
/**
* the constructor.
*/
public HGZL012() {
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 status - 状态:0-质检中,1-质检完成.
* @return the status
*/
public Integer getStatus() {
return this.status;
}
/**
* set the status - 状态:0-质检中,1-质检完成.
*
* @param status - 状态:0-质检中,1-质检完成
*/
public void setStatus(Integer status) {
this.status = status;
}
/**
* get the qualityNo - 质检单号.
* @return the qualityNo
*/
public String getQualityNo() {
return this.qualityNo;
}
/**
* set the qualityNo - 质检单号.
*
* @param qualityNo - 质检单号
*/
public void setQualityNo(String qualityNo) {
this.qualityNo = qualityNo;
}
/**
* get the qualityDate - 单据日期.
* @return the qualityDate
*/
public String getQualityDate() {
return this.qualityDate;
}
/**
* set the qualityDate - 单据日期.
*
* @param qualityDate - 单据日期
*/
public void setQualityDate(String qualityDate) {
this.qualityDate = qualityDate;
}
/**
* 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 inventType - 存货类型.
* @return the inventType
*/
public String getInventType() {
return this.inventType;
}
/**
* set the inventType - 存货类型.
*
* @param inventType - 存货类型
*/
public void setInventType(String inventType) {
this.inventType = inventType;
}
/**
* 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 specId - 规格ID.
* @return the specId
*/
public Long getSpecId() {
return this.specId;
}
/**
* set the specId - 规格ID.
*
* @param specId - 规格ID
*/
public void setSpecId(Long specId) {
this.specId = specId;
}
/**
* 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 unit - 单位.
* @return the unit
*/
public String getUnit() {
return this.unit;
}
/**
* set the unit - 单位.
*
* @param unit - 单位
*/
public void setUnit(String unit) {
this.unit = unit;
}
/**
* get the applyQty - 入库数量.
* @return the applyQty
*/
public BigDecimal getApplyQty() {
return this.applyQty;
}
/**
* set the applyQty - 入库数量.
*
* @param applyQty - 入库数量
*/
public void setApplyQty(BigDecimal applyQty) {
this.applyQty = applyQty;
}
/**
* get the applyUnitWeight - 入库单重.
* @return the applyUnitWeight
*/
public BigDecimal getApplyUnitWeight() {
return this.applyUnitWeight;
}
/**
* set the applyUnitWeight - 入库单重.
*
* @param applyUnitWeight - 入库单重
*/
public void setApplyUnitWeight(BigDecimal applyUnitWeight) {
this.applyUnitWeight = applyUnitWeight;
}
/**
* get the applyWeight - 入库重量.
* @return the applyWeight
*/
public BigDecimal getApplyWeight() {
return this.applyWeight;
}
/**
* set the applyWeight - 入库重量.
*
* @param applyWeight - 入库重量
*/
public void setApplyWeight(BigDecimal applyWeight) {
this.applyWeight = applyWeight;
}
/**
* get the qualityQty - 合格数量.
* @return the qualityQty
*/
public BigDecimal getQualityQty() {
return this.qualityQty;
}
/**
* set the qualityQty - 合格数量.
*
* @param qualityQty - 合格数量
*/
public void setQualityQty(BigDecimal qualityQty) {
this.qualityQty = qualityQty;
}
/**
* get the unQualityQty - 不合格数量.
* @return the unQualityQty
*/
public BigDecimal getUnQualityQty() {
return this.unQualityQty;
}
/**
* set the unQualityQty - 不合格数量.
*
* @param unQualityQty - 不合格数量
*/
public void setUnQualityQty(BigDecimal unQualityQty) {
this.unQualityQty = unQualityQty;
}
/**
* get the depositCode - 委外入库单号.
* @return the depositCode
*/
public String getDepositCode() {
return this.depositCode;
}
/**
* set the depositCode - 委外入库单号.
*
* @param depositCode - 委外入库单号
*/
public void setDepositCode(String depositCode) {
this.depositCode = depositCode;
}
/**
* get the depositLineCode - 委外入库行号.
* @return the depositLineCode
*/
public Long getDepositLineCode() {
return this.depositLineCode;
}
/**
* set the depositLineCode - 委外入库行号.
*
* @param depositLineCode - 委外入库行号
*/
public void setDepositLineCode(Long depositLineCode) {
this.depositLineCode = depositLineCode;
}
/**
* 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));
setStatus(NumberUtils.toInteger(StringUtils.toString(map.get(FIELD_STATUS)), status));
setQualityNo(StringUtils.defaultIfEmpty(StringUtils.toString(map.get(FIELD_QUALITY_NO)), qualityNo));
setQualityDate(StringUtils.defaultIfEmpty(StringUtils.toString(map.get(FIELD_QUALITY_DATE)), qualityDate));
setCompanyCode(StringUtils.defaultIfEmpty(StringUtils.toString(map.get(FIELD_COMPANY_CODE)), companyCode));
setCompanyName(StringUtils.defaultIfEmpty(StringUtils.toString(map.get(FIELD_COMPANY_NAME)), companyName));
setInventType(StringUtils.defaultIfEmpty(StringUtils.toString(map.get(FIELD_INVENT_TYPE)), inventType));
setInventCode(StringUtils.defaultIfEmpty(StringUtils.toString(map.get(FIELD_INVENT_CODE)), inventCode));
setInventName(StringUtils.defaultIfEmpty(StringUtils.toString(map.get(FIELD_INVENT_NAME)), inventName));
setSpecId(NumberUtils.toLong(StringUtils.toString(map.get(FIELD_SPEC_ID)), specId));
setSpec(StringUtils.defaultIfEmpty(StringUtils.toString(map.get(FIELD_SPEC)), spec));
setUnit(StringUtils.defaultIfEmpty(StringUtils.toString(map.get(FIELD_UNIT)), unit));
setApplyQty(NumberUtils.toBigDecimal(StringUtils.toString(map.get(FIELD_APPLY_QTY)), applyQty));
setApplyUnitWeight(NumberUtils.toBigDecimal(StringUtils.toString(map.get(FIELD_APPLY_UNIT_WEIGHT)), applyUnitWeight));
setApplyWeight(NumberUtils.toBigDecimal(StringUtils.toString(map.get(FIELD_APPLY_WEIGHT)), applyWeight));
setQualityQty(NumberUtils.toBigDecimal(StringUtils.toString(map.get(FIELD_QUALITY_QTY)), qualityQty));
setUnQualityQty(NumberUtils.toBigDecimal(StringUtils.toString(map.get(FIELD_UN_QUALITY_QTY)), unQualityQty));
setDepositCode(StringUtils.defaultIfEmpty(StringUtils.toString(map.get(FIELD_DEPOSIT_CODE)), depositCode));
setDepositLineCode(NumberUtils.toLong(StringUtils.toString(map.get(FIELD_DEPOSIT_LINE_CODE)), depositLineCode));
}
/**
* 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_STATUS, StringUtils.toString(status, eiMetadata.getMeta(FIELD_STATUS)));
map.put(FIELD_QUALITY_NO, StringUtils.toString(qualityNo, eiMetadata.getMeta(FIELD_QUALITY_NO)));
map.put(FIELD_QUALITY_DATE, StringUtils.toString(qualityDate, eiMetadata.getMeta(FIELD_QUALITY_DATE)));
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_INVENT_TYPE, StringUtils.toString(inventType, eiMetadata.getMeta(FIELD_INVENT_TYPE)));
map.put(FIELD_INVENT_CODE, StringUtils.toString(inventCode, eiMetadata.getMeta(FIELD_INVENT_CODE)));
map.put(FIELD_INVENT_NAME, StringUtils.toString(inventName, eiMetadata.getMeta(FIELD_INVENT_NAME)));
map.put(FIELD_SPEC_ID, StringUtils.toString(specId, eiMetadata.getMeta(FIELD_SPEC_ID)));
map.put(FIELD_SPEC, StringUtils.toString(spec, eiMetadata.getMeta(FIELD_SPEC)));
map.put(FIELD_UNIT, StringUtils.toString(unit, eiMetadata.getMeta(FIELD_UNIT)));
map.put(FIELD_APPLY_QTY, StringUtils.toString(applyQty, eiMetadata.getMeta(FIELD_APPLY_QTY)));
map.put(FIELD_APPLY_UNIT_WEIGHT, StringUtils.toString(applyUnitWeight, eiMetadata.getMeta(FIELD_APPLY_UNIT_WEIGHT)));
map.put(FIELD_APPLY_WEIGHT, StringUtils.toString(applyWeight, eiMetadata.getMeta(FIELD_APPLY_WEIGHT)));
map.put(FIELD_QUALITY_QTY, StringUtils.toString(qualityQty, eiMetadata.getMeta(FIELD_QUALITY_QTY)));
map.put(FIELD_UN_QUALITY_QTY, StringUtils.toString(unQualityQty, eiMetadata.getMeta(FIELD_UN_QUALITY_QTY)));
map.put(FIELD_DEPOSIT_CODE, StringUtils.toString(depositCode, eiMetadata.getMeta(FIELD_DEPOSIT_CODE)));
map.put(FIELD_DEPOSIT_LINE_CODE, StringUtils.toString(depositLineCode, eiMetadata.getMeta(FIELD_DEPOSIT_LINE_CODE)));
return map;
}
}
...@@ -56,7 +56,7 @@ public class ServiceHGZL011 extends ServiceBase { ...@@ -56,7 +56,7 @@ public class ServiceHGZL011 extends ServiceBase {
CommonMethod.initBlock(inInfo, Arrays.asList(DdynamicEnum.INVENT_RECORD_BLOCK_ID)); CommonMethod.initBlock(inInfo, Arrays.asList(DdynamicEnum.INVENT_RECORD_BLOCK_ID));
CommonMethod.initBlock(inInfo, Arrays.asList(DdynamicEnum.SPEC_NAME_BLOCK_ID)); CommonMethod.initBlock(inInfo, Arrays.asList(DdynamicEnum.SPEC_NAME_BLOCK_ID));
EiInfoUtils.addBlock(inInfo, "roleCompany", UserSessionUtils.getRoleCompany(), Company.class); EiInfoUtils.addBlock(inInfo, "roleCompany", UserSessionUtils.getRoleCompany(), Company.class);
inInfo.addBlock(EiConstant.resultBlock).addBlockMeta(new HGZL001().eiMetadata); inInfo.addBlock(EiConstant.resultBlock).addBlockMeta(new HGZL011().eiMetadata);
} catch (Exception e) { } catch (Exception e) {
LogUtils.setMsg(inInfo, e, "初始化失败"); LogUtils.setMsg(inInfo, e, "初始化失败");
} }
...@@ -248,7 +248,7 @@ public class ServiceHGZL011 extends ServiceBase { ...@@ -248,7 +248,7 @@ public class ServiceHGZL011 extends ServiceBase {
String applyCode = fZl011.getApplyCode(); String applyCode = fZl011.getApplyCode();
HGKCTools.HgKc008.updateStatus(applyCode, HgKcConst.HgKc008.Status.S3); HGKCTools.HgKc008.updateStatus(applyCode, HgKcConst.HgKc008.Status.S3);
// 如果存在不合格数量生产一笔负数领料单 // 如果存在不合格数量生产一笔负数领料单
if (fZl011.getUnQualityQty().compareTo(BigDecimal.ZERO) > 0) { if (fZl011.getUnQualityQty().compareTo(BigDecimal.ZERO) < 1) {
return; return;
} }
HGKC008A dbKc008A = dbKc008AMap.get(applyLineCode); HGKC008A dbKc008A = dbKc008AMap.get(applyLineCode);
......
package com.baosight.hggp.hg.zl.service;
import com.baosight.hggp.aspect.annotation.OperationLogAnnotation;
import com.baosight.hggp.common.DdynamicEnum;
import com.baosight.hggp.core.constant.CommonConstant;
import com.baosight.hggp.core.dao.DaoUtils;
import com.baosight.hggp.core.enums.DeleteFlagEnum;
import com.baosight.hggp.core.security.UserSessionUtils;
import com.baosight.hggp.hg.constant.HGConstant;
import com.baosight.hggp.hg.kc.constant.HgKcConst;
import com.baosight.hggp.hg.kc.domain.HGKC008A;
import com.baosight.hggp.hg.kc.domain.HGKC014;
import com.baosight.hggp.hg.kc.domain.HGKC014A;
import com.baosight.hggp.hg.kc.tools.HGKCTools;
import com.baosight.hggp.hg.kc.utils.HGKCUtils;
import com.baosight.hggp.hg.xs.domain.Company;
import com.baosight.hggp.hg.zl.constant.HgZlConst;
import com.baosight.hggp.hg.zl.constant.HgZlSqlConst;
import com.baosight.hggp.hg.zl.domain.HGZL001;
import com.baosight.hggp.hg.zl.domain.HGZL012;
import com.baosight.hggp.hg.zl.domain.HGZL012;
import com.baosight.hggp.hg.zl.utils.HGZLUtils;
import com.baosight.hggp.util.AssertUtils;
import com.baosight.hggp.util.BeanUtils;
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.service.impl.ServiceBase;
import com.baosight.iplat4j.ed.util.SequenceGenerator;
import java.math.BigDecimal;
import java.util.Arrays;
import java.util.List;
import java.util.Map;
/**
* 委外入库质检
*
* @author:songx
* @date:2024/9/29,9:45
*/
public class ServiceHGZL012 extends ServiceBase {
/**
* 画面初始化
*
* @param inInfo
* @return
*/
@Override
public EiInfo initLoad(EiInfo inInfo) {
try {
CommonMethod.initBlock(inInfo, Arrays.asList(DdynamicEnum.COMPANY_CODE_BLOCK_ID));
CommonMethod.initBlock(inInfo, Arrays.asList(DdynamicEnum.INVENT_RECORD_BLOCK_ID));
CommonMethod.initBlock(inInfo, Arrays.asList(DdynamicEnum.SPEC_NAME_BLOCK_ID));
EiInfoUtils.addBlock(inInfo, "roleCompany", UserSessionUtils.getRoleCompany(), Company.class);
inInfo.addBlock(EiConstant.resultBlock).addBlockMeta(new HGZL012().eiMetadata);
} catch (Exception e) {
LogUtils.setMsg(inInfo, e, "初始化失败");
}
return inInfo;
}
/**
* 查询操作
*
* @param inInfo
* @return
*/
@Override
public EiInfo query(EiInfo inInfo) {
try {
Map queryMap = EiInfoUtils.getFirstRow(inInfo);
HGZLUtils.HgZl012.setCondition(queryMap);
inInfo = super.query(inInfo, HGZL012.QUERY, new HGZL012());
} catch (Exception e) {
LogUtils.setMsg(inInfo, e, "查询失败");
}
return inInfo;
}
/**
* 保存
*
* @param inInfo
* @return
*/
public EiInfo save(EiInfo inInfo) {
try {
List<HGZL012> fZl012s = MapUtils.toDaoEPBases(inInfo, HGZL012.class);
for (HGZL012 fZl012 : fZl012s) {
AssertUtils.isNotEquals(HgZlConst.HgZl012.Status.S0, fZl012.getStatus(),
String.format("质检单【%s】状态不是\"未处理\",不允许操作", fZl012.getQualityNo()));
// 去除日期字符串中的-
fZl012.setQualityDate(DateUtils.formatShort(fZl012.getQualityDate()));
DaoUtils.update(HGZL012.UPDATE, fZl012.toMap());
}
inInfo = this.query(inInfo);
inInfo.setMsg("操作成功!本次对[" + fZl012s.size() + "]条数据修改成功!");
} catch (Exception e) {
LogUtils.setMsg(inInfo, e, "修改失败");
}
return inInfo;
}
/**
* 删除操作
*
* @param inInfo
* @return
*/
@OperationLogAnnotation(operModul = "入库质检单", operType = "删除", operDesc = "删除")
public EiInfo remove(EiInfo inInfo) {
try {
List<HGZL012> fZl012s = MapUtils.toDaoEPBases(inInfo, HGZL012.class);
Map<String, HGZL012> dbZl012Map = HGZLUtils.HgZl012.lockGetDataEp(fZl012s);
// 数据校验
this.checkRemoveData(fZl012s, dbZl012Map);
// 删除数据
this.removeData(fZl012s, dbZl012Map);
inInfo = this.query(inInfo);
inInfo.setMsg("操作成功!本次对[" + fZl012s.size() + "]条数据删除成功!");
} catch (Exception e) {
LogUtils.setMsg(inInfo, e, "删除失败");
}
return inInfo;
}
/**
* 数据校验
*
* @param fZl012s
* @param dbZl012Map
*/
private void checkRemoveData(List<HGZL012> fZl012s, Map<String, HGZL012> dbZl012Map) {
for (HGZL012 fZl012 : fZl012s) {
String qualityNo = fZl012.getQualityNo();
HGZL012 dbZl012 = dbZl012Map.get(qualityNo);
this.checkData(qualityNo, dbZl012);
}
}
/**
* 删除数据
*
* @param fZl012s
* @param dbZl012Map
*/
private void removeData(List<HGZL012> fZl012s, Map<String, HGZL012> dbZl012Map) {
for (HGZL012 fZl012 : fZl012s) {
String qualityNo = fZl012.getQualityNo();
HGZL012 dbZl012 = dbZl012Map.get(qualityNo);
fZl012.setDeleteFlag(DeleteFlagEnum.REMOVE.getCode());
DaoUtils.update(HGZL012.DELETE, fZl012.toMap());
// 更新入库单主状态
HGKCTools.HgKc014.updateStatus(dbZl012.getDepositCode(), HgKcConst.HgKc008.Status.S1);
// 更新入库单明细状态
HGKCTools.HgKc014A.updateStatus(dbZl012.getDepositLineCode(), HgKcConst.HgKc008.Status.S1);
}
}
/**
* 已处理
*
* @param inInfo
* @return
*/
public EiInfo process(EiInfo inInfo) {
try {
List<HGZL012> fZl012s = MapUtils.toDaoEPBases(inInfo, HGZL012.class);
Map<String, HGZL012> dbZl012Map = HGZLUtils.HgZl012.lockGetDataEp(fZl012s);
// 获取收货明细数据
List<Long> depositLineCodes = ObjectUtils.listEpKey(fZl012s, HGZL012.FIELD_DEPOSIT_LINE_CODE);
Map<Long, HGKC014A> dbKc014AMap = HGKCTools.HgKc014A.map(depositLineCodes);
// 数据校验
this.checkProcessData(fZl012s, dbZl012Map, dbKc014AMap);
// 保存数据
this.processData(fZl012s, dbZl012Map, dbKc014AMap);
inInfo = this.query(inInfo);
inInfo.setStatus(EiConstant.STATUS_DEFAULT);
inInfo.setMsg("操作成功!本次对[" + fZl012s.size() + "]条数据处理成功!");
} catch (Exception e) {
LogUtils.setMsg(inInfo, e, "处理失败");
}
return inInfo;
}
/**
* 校验数据
*
* @param fZl012s
* @param dbZl012Map
* @param dbKc014AMap
*/
private void checkProcessData(List<HGZL012> fZl012s, Map<String, HGZL012> dbZl012Map,
Map<Long, HGKC014A> dbKc014AMap) {
for (HGZL012 fZl012 : fZl012s) {
String qualityNo = fZl012.getQualityNo();
HGZL012 dbZl012 = dbZl012Map.get(qualityNo);
// 质检校验
this.checkData(qualityNo, dbZl012);
// 领料信息
HGKC014A dbKc014A = dbKc014AMap.get(dbZl012.getId());
AssertUtils.isNull(dbKc014A, String.format("质检单【%s】关联的领料单【%s】不存在", qualityNo,
dbZl012.getId()));
AssertUtils.isGt(BigDecimal.ZERO, fZl012.getQualityQty(),
String.format("质检单[%s]的合格数量【%s】不能为负数", qualityNo, fZl012.getQualityQty()));
AssertUtils.isGt(BigDecimal.ZERO, fZl012.getUnQualityQty(),
String.format("质检单[%s]的不合格数量【%s】不能为负数", qualityNo, fZl012.getUnQualityQty()));
AssertUtils.isNotEquals(fZl012.getQualityQty().add(fZl012.getUnQualityQty()), dbKc014A.getDepositQty(),
String.format("质检单[%s]的合格数量加不合格数量必须等于入库数量", qualityNo));
}
}
/**
* 保存数据
*
* @param fZl012s
* @param dbZl012Map
* @param dbKc014AMap
*/
private void processData(List<HGZL012> fZl012s, Map<String, HGZL012> dbZl012Map,
Map<Long, HGKC014A> dbKc014AMap) {
for (HGZL012 fZl012 : fZl012s) {
String qualityNo = fZl012.getQualityNo();
// 更新质检单状态
HGZL012 dbZl012 = dbZl012Map.get(qualityNo);
dbZl012.setQualityQty(fZl012.getQualityQty());
dbZl012.setUnQualityQty(fZl012.getUnQualityQty());
dbZl012.setStatus(HgZlConst.HgZl012.Status.S1);
DaoUtils.update(HgZlSqlConst.HgZl012.PROCESS, dbZl012.toMap());
// 更新领料单明细状态
this.updateApplyDetail(fZl012, dbKc014AMap);
}
}
/**
* 更新领料单明细状态
*
* @param fZl012
* @param dbKc014AMap
*/
private void updateApplyDetail(HGZL012 fZl012, Map<Long, HGKC014A> dbKc014AMap) {
Long depositLineCode = fZl012.getDepositLineCode();
HGKCTools.HgKc014A.updateStatus(depositLineCode, HgKcConst.HgKc014.Status.S3);
String depositCode = fZl012.getDepositCode();
HGKCTools.HgKc014.updateStatus(depositCode, HgKcConst.HgKc014.Status.S3);
HGKC014A dbKc014A = dbKc014AMap.get(depositLineCode);
// 合格数量大于0增加库存
if (fZl012.getQualityQty().compareTo(BigDecimal.ZERO) > 0) {
BigDecimal qualityWeight = fZl012.getQualityQty().multiply(fZl012.getApplyUnitWeight());
HGKCUtils.HgKc010.updateInv(dbKc014A.getCompanyCode(), "",
dbKc014A.getProductCode(), fZl012.getQualityQty(), fZl012.getApplyUnitWeight(),
qualityWeight);
}
}
/**
* 检查状态
*
* @param inInfo
* @return
*/
public EiInfo checkStatus(EiInfo inInfo) {
try {
Map queryMap = EiInfoUtils.getFirstRow(inInfo);
String qualityNo = MapUtils.getString(queryMap, HGZL012.FIELD_QUALITY_NO);
HGZL012 dbZl012 = HGZLUtils.HgZl012.lockGetData(qualityNo);
this.checkData(qualityNo, dbZl012);
} catch (Exception e) {
LogUtils.setMsg(inInfo, e, "操作失败");
}
return inInfo;
}
/**
* 数据校验
*
* @param qualityNo
* @param dbZl012
*/
private void checkData(String qualityNo, HGZL012 dbZl012) {
AssertUtils.isNull(dbZl012, String.format("质检单【%s】不存在", qualityNo));
AssertUtils.isNotEquals(dbZl012.getDeleteFlag(), CommonConstant.YesNo.NO_0,
String.format("质检单【%s】不是\"未删除\"状态,不允许操作", qualityNo));
AssertUtils.isNotEquals(dbZl012.getStatus(), HgZlConst.HgZl012.Status.S0,
String.format("质检单【%s】不是\"未处理\"状态,不允许操作", qualityNo));
}
}
package com.baosight.hggp.hg.zl.service;
import com.baosight.hggp.core.constant.CommonConstant;
import com.baosight.hggp.hg.dm.domain.HGDM099;
import com.baosight.hggp.hg.dm.utils.HgDmUtils;
import com.baosight.hggp.hg.xs.constant.HgXsConstant;
import com.baosight.hggp.hg.zl.domain.HGZL011;
import com.baosight.hggp.hg.zl.tools.HGZLTools;
import com.baosight.hggp.hg.zl.utils.HGZLUtils;
import com.baosight.hggp.util.AssertUtils;
import com.baosight.hggp.util.EiInfoUtils;
import com.baosight.hggp.util.LogUtils;
import com.baosight.hggp.util.MapUtils;
import com.baosight.iplat4j.core.ei.EiBlock;
import com.baosight.iplat4j.core.ei.EiConstant;
import com.baosight.iplat4j.core.ei.EiInfo;
import com.baosight.iplat4j.core.service.impl.ServiceEPBase;
import java.util.Map;
/**
* @author:songx
* @date:2024/1/25,15:25
*/
public class ServiceHGZL012A extends ServiceEPBase {
/**
* 画面初始化
*
* @param inInfo
* @return
*/
@Override
public EiInfo initLoad(EiInfo inInfo) {
try {
this.setDetailInfo(inInfo);
inInfo.addBlock(EiConstant.resultBlock).addBlockMeta(new HGDM099().eiMetadata);
} catch (Exception e) {
LogUtils.setMsg(inInfo, e, "初始化失败");
}
return inInfo;
}
/**
* 查询操作
*
* @param inInfo
* @return
*/
@Override
public EiInfo query(EiInfo inInfo) {
try {
inInfo = super.query(inInfo, HGDM099.QUERY, new HGDM099());
} catch (Exception e) {
LogUtils.setMsg(inInfo, e, "查询失败");
}
return inInfo;
}
/**
* 删除
*
* @param inInfo
* @return
*/
public EiInfo remove(EiInfo inInfo) {
try {
Map queryMap = EiInfoUtils.getFirstRow(inInfo);
String bizId = MapUtils.getString(queryMap, HGDM099.FIELD_BIZ_ID);
HGZL011 dbZl011 = HGZLUtils.HgZl011.lockGetData(bizId);
this.checkRemoveData(dbZl011);
// 删除数据
int num = HgDmUtils.HgDm099.delete(inInfo);
inInfo = this.query(inInfo);
inInfo.setStatus(EiConstant.STATUS_DEFAULT);
inInfo.setMsg("操作成功!本次对[" + num + "]条数据删除成功!");
} catch (Throwable e) {
LogUtils.setDetailMsg(inInfo, e, "查询失败");
}
return inInfo;
}
/**
* 数据校验
*
* @param dbXs011
*/
private void checkRemoveData(HGZL011 dbXs011) {
AssertUtils.isNotEquals(dbXs011.getDeleteFlag(), CommonConstant.YesNo.NO_0,
String.format("质检单【%s】不是\"未删除\"状态,不允许操作", dbXs011.getQualityNo()));
AssertUtils.isNotEquals(dbXs011.getStatus(), HgXsConstant.FolStatus.S0,
String.format("质检单【%s】不是\"质检中\"状态,不允许操作", dbXs011.getQualityNo()));
}
/**
* 设置信息
*
* @param inInfo
*/
public void setDetailInfo(EiInfo inInfo) {
Map queryRow = EiInfoUtils.getFirstRow(inInfo);
String bizId = MapUtils.getString(queryRow, HGDM099.FIELD_BIZ_ID);
if (bizId == null) {
return;
}
EiBlock block = new EiBlock(CommonConstant.Field.DETAIL);
block.addRow(HGZLTools.HgZl011.get(bizId));
block.addBlockMeta(new HGZL011().eiMetadata);
inInfo.setBlock(block);
}
}
package com.baosight.hggp.hg.zl.service;
import com.baosight.hggp.common.DdynamicEnum;
import com.baosight.hggp.core.constant.CommonConstant;
import com.baosight.hggp.core.dao.DaoUtils;
import com.baosight.hggp.hg.cg.domain.HGCG003B1;
import com.baosight.hggp.hg.constant.HGConstant;
import com.baosight.hggp.hg.kc.constant.HgKcConst;
import com.baosight.hggp.hg.kc.domain.HGKC008;
import com.baosight.hggp.hg.kc.domain.HGKC008A;
import com.baosight.hggp.hg.kc.tools.HGKCTools;
import com.baosight.hggp.hg.kc.utils.HGKCUtils;
import com.baosight.hggp.hg.zl.constant.HgZlConst;
import com.baosight.hggp.hg.zl.domain.HGZL011;
import com.baosight.hggp.hg.zl.domain.HGZL012;
import com.baosight.hggp.util.AssertUtils;
import com.baosight.hggp.util.BeanUtils;
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.service.impl.ServiceEPBase;
import com.baosight.iplat4j.ed.util.SequenceGenerator;
import java.util.Arrays;
import java.util.List;
import java.util.Map;
/**
* 选择生产领料单
*
* @author:songx
* @date:2022/7/11,11:08
*/
public class ServiceHGZL012B extends ServiceEPBase {
/**
* 初始化
*
* @param inInfo
* @return
*/
@Override
public EiInfo initLoad(EiInfo inInfo) {
try {
CommonMethod.initBlock(inInfo, Arrays.asList(DdynamicEnum.COMPANY_CODE_BLOCK_ID));
CommonMethod.initBlock(inInfo, Arrays.asList(DdynamicEnum.SUP_RECORD_BLOCK_ID));
CommonMethod.initBlock(inInfo, Arrays.asList(DdynamicEnum.INVENT_RECORD_BLOCK_ID));
CommonMethod.initBlock(inInfo, Arrays.asList(DdynamicEnum.SPEC_NAME_BLOCK_ID));
inInfo.addBlock(EiConstant.resultBlock).addBlockMeta(new HGCG003B1().eiMetadata);
} catch (Exception e) {
LogUtils.setDetailMsg(inInfo, e, "初始化失败");
}
return inInfo;
}
/**
* 查询数据列表
*
* @param inInfo
* @return
*/
@Override
public EiInfo query(EiInfo inInfo) {
try {
Map queryMap = EiInfoUtils.getFirstRow(inInfo);
queryMap.put(HGKC008A.FIELD_STATUS, HgKcConst.HgKc008.Status.S1);
queryMap.put("isInvQty", CommonConstant.YesNo.YES_1);
inInfo = super.query(inInfo, HGKC008A.QUERY, new HGKC008A());
} catch (Exception e) {
LogUtils.setDetailMsg(inInfo, e, "查询失败");
}
return inInfo;
}
/**
* 生成质检单
*
* @param inInfo
* @return
*/
public EiInfo confirm(EiInfo inInfo) {
try {
List<HGKC008A> fKc008As = MapUtils.toDaoEPBases(inInfo, HGKC008A.class);
// 锁主信息和明细信息
List<String> applyNos = ObjectUtils.listEpKey(fKc008As, HGKC008A.FIELD_APPLY_CODE);
Map<String, HGKC008> dbKc008Map = HGKCUtils.HgKc008.lockGetData(applyNos);
Map<String, HGKC008A> dbKc008AMap = HGKCUtils.HgKc008A.lockGetDataEp(fKc008As);
// 数据校验
this.checkConfirmData(fKc008As, dbKc008Map, dbKc008AMap);
// 生成巡检单
this.saveConfirmData(fKc008As, dbKc008AMap);
} catch (Exception e) {
LogUtils.setDetailMsg(inInfo, e, "生成质检单失败");
}
return inInfo;
}
/**
* 校验数据
*
* @param fKc008As
* @param dbKc008Map
* @param dbKc008AMap
*/
private void checkConfirmData(List<HGKC008A> fKc008As, Map<String, HGKC008> dbKc008Map,
Map<String, HGKC008A> dbKc008AMap) {
for (HGKC008A fKc008A : fKc008As) {
HGKC008 dbKc008 = dbKc008Map.get(fKc008A.getApplyCode());
AssertUtils.isNull(dbKc008, String.format("领料单【%s】不存在", fKc008A.getApplyLineCode()));
HGKC008A dbKc008A = dbKc008AMap.get(fKc008A.getApplyLineCode());
AssertUtils.isNull(dbKc008A, String.format("领料单行【%s】不存在", fKc008A.getApplyLineCode()));
AssertUtils.isNotEquals(HgKcConst.HgKc008.Status.S1, dbKc008A.getStatus(),
String.format("领料单行[%s]的状态不是\"已提交\",不允许操作", fKc008A.getApplyLineCode()));
}
}
/**
* 保存数据
*
* @param fKc008As
* @param dbKc008AMap
*/
private void saveConfirmData(List<HGKC008A> fKc008As, Map<String, HGKC008A> dbKc008AMap) {
for (HGKC008A fKc008A : fKc008As) {
HGKC008A dbKc008A = dbKc008AMap.get(fKc008A.getApplyLineCode());
HGZL012 newZl012 = BeanUtils.copy(dbKc008A, HGZL012.class);
newZl012.setQualityNo(SequenceGenerator.getNextSequence(HGConstant.SequenceId.WWRK_QUALITY_NO));
newZl012.setQualityDate(DateUtils.shortDate());
newZl012.setStatus(HgZlConst.HgZl011.Status.S0);
newZl012.setDeleteFlag(CommonConstant.YesNo.NO_0);
newZl012.setApplyQty(dbKc008A.getInvQty());
newZl012.setApplyUnitWeight(dbKc008A.getInvUnitWeight());
newZl012.setApplyWeight(dbKc008A.getInvWeight());
newZl012.setSpec(dbKc008A.getInvSpec());
DaoUtils.insert(HGZL012.INSERT, newZl012);
// 更新入库单状态
HGKCTools.HgKc014.updateStatus(fKc008A.getApplyCode(), HgKcConst.HgKc014.Status.S2);
// 更新入库单明细状态
HGKCTools.HgKc014A.updateStatus(fKc008A.getId(), HgKcConst.HgKc014.Status.S2);
}
}
}
...@@ -41,12 +41,7 @@ ...@@ -41,12 +41,7 @@
<sql id="condition"> <sql id="condition">
AND DELETE_FLAG = 0 AND DELETE_FLAG = 0
<include refid="idCondition"/> <include refid="idCondition"/>
<isNotEmpty prepend=" AND " property="accountCode"> <include refid="HGXSDataAuth.authCondition"/>
ACCOUNT_CODE = #accountCode#
</isNotEmpty>
<isNotEmpty prepend=" AND " property="depCode">
DEP_CODE = #depCode#
</isNotEmpty>
<isNotEmpty prepend=" AND " property="createdBy"> <isNotEmpty prepend=" AND " property="createdBy">
CREATED_BY = #createdBy# CREATED_BY = #createdBy#
</isNotEmpty> </isNotEmpty>
...@@ -71,9 +66,6 @@ ...@@ -71,9 +66,6 @@
<isNotEmpty prepend=" AND " property="status"> <isNotEmpty prepend=" AND " property="status">
STATUS = #status# STATUS = #status#
</isNotEmpty> </isNotEmpty>
<isNotEmpty prepend=" AND " property="qualityNo">
QUALITY_NO = #qualityNo#
</isNotEmpty>
<isNotEmpty prepend=" AND " property="qualityDate"> <isNotEmpty prepend=" AND " property="qualityDate">
QUALITY_DATE = #qualityDate# QUALITY_DATE = #qualityDate#
</isNotEmpty> </isNotEmpty>
...@@ -145,7 +137,7 @@ ...@@ -145,7 +137,7 @@
$orderBy$ $orderBy$
</isNotEmpty> </isNotEmpty>
<isEmpty property="orderBy"> <isEmpty property="orderBy">
ID asc STATUS ASC, ID DESC
</isEmpty> </isEmpty>
</dynamic> </dynamic>
</sql> </sql>
......
<?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="HGZL012">
<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-已删除 -->
STATUS as "status", <!-- 状态:0-质检中,1-质检完成 -->
QUALITY_NO as "qualityNo", <!-- 质检单号 -->
QUALITY_DATE as "qualityDate", <!-- 单据日期 -->
COMPANY_CODE as "companyCode", <!-- 公司编码 -->
COMPANY_NAME as "companyName", <!-- 公司名称 -->
INVENT_TYPE as "inventType", <!-- 存货类型 -->
INVENT_CODE as "inventCode", <!-- 存货编码 -->
INVENT_NAME as "inventName", <!-- 存货名称 -->
SPEC_ID as "specId", <!-- 规格ID -->
SPEC as "spec", <!-- 规格 -->
UNIT as "unit", <!-- 单位 -->
APPLY_QTY as "applyQty", <!-- 入库数量 -->
APPLY_UNIT_WEIGHT as "applyUnitWeight", <!-- 入库单重 -->
APPLY_WEIGHT as "applyWeight", <!-- 入库重量 -->
QUALITY_QTY as "qualityQty", <!-- 合格数量 -->
UN_QUALITY_QTY as "unQualityQty", <!-- 不合格数量 -->
DEPOSIT_CODE as "depositCode", <!-- 委外入库单号 -->
DEPOSIT_LINE_CODE as "depositLineCode" <!-- 委外入库行号 -->
</sql>
<sql id="condition">
AND DELETE_FLAG = 0
<include refid="idCondition"/>
<include refid="HGXSDataAuth.authCondition"/>
<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="deleteFlag">
DELETE_FLAG = #deleteFlag#
</isNotEmpty>
<isNotEmpty prepend=" AND " property="status">
STATUS = #status#
</isNotEmpty>
<isNotEmpty prepend=" AND " property="qualityDate">
QUALITY_DATE = #qualityDate#
</isNotEmpty>
<isNotEmpty prepend=" AND " property="companyCode">
COMPANY_CODE = #companyCode#
</isNotEmpty>
<isNotEmpty prepend=" AND " property="companyName">
COMPANY_NAME = #companyName#
</isNotEmpty>
<isNotEmpty prepend=" AND " property="inventType">
INVENT_TYPE = #inventType#
</isNotEmpty>
<isNotEmpty prepend=" AND " property="inventCode">
INVENT_CODE = #inventCode#
</isNotEmpty>
<isNotEmpty prepend=" AND " property="inventName">
INVENT_NAME = #inventName#
</isNotEmpty>
<isNotEmpty prepend=" AND " property="specId">
SPEC_ID = #specId#
</isNotEmpty>
<isNotEmpty prepend=" AND " property="spec">
SPEC = #spec#
</isNotEmpty>
<isNotEmpty prepend=" AND " property="unit">
UNIT = #unit#
</isNotEmpty>
<isNotEmpty prepend=" AND " property="applyQty">
APPLY_QTY = #applyQty#
</isNotEmpty>
<isNotEmpty prepend=" AND " property="applyUnitWeight">
APPLY_UNIT_WEIGHT = #applyUnitWeight#
</isNotEmpty>
<isNotEmpty prepend=" AND " property="applyWeight">
APPLY_WEIGHT = #applyWeight#
</isNotEmpty>
<isNotEmpty prepend=" AND " property="qualityQty">
QUALITY_QTY = #qualityQty#
</isNotEmpty>
<isNotEmpty prepend=" AND " property="unQualityQty">
UN_QUALITY_QTY = #unQualityQty#
</isNotEmpty>
<isNotEmpty prepend=" AND " property="depositCode">
DEPOSIT_CODE = #depositCode#
</isNotEmpty>
<isNotEmpty prepend=" AND " property="depositLineCode">
DEPOSIT_LINE_CODE = #depositLineCode#
</isNotEmpty>
</sql>
<sql id="idCondition">
<isNotEmpty prepend=" AND " property="id">
ID = #id#
</isNotEmpty>
<isNotEmpty prepend=" AND " property="qualityNo">
QUALITY_NO = #qualityNo#
</isNotEmpty>
<isNotEmpty prepend=" AND " property="qualityNos">
QUALITY_NO IN <iterate open="(" close=")" conjunction="," property="qualityNos">#qualityNos[]#</iterate>
</isNotEmpty>
</sql>
<sql id="orderBy">
<dynamic prepend="ORDER BY">
<isNotEmpty property="orderBy">
$orderBy$
</isNotEmpty>
<isEmpty property="orderBy">
STATUS ASC, ID DESC
</isEmpty>
</dynamic>
</sql>
<select id="query" resultClass="com.baosight.hggp.hg.zl.domain.HGZL012">
SELECT
<include refid="column"/>
FROM ${hggpSchema}.HGZL012
WHERE 1=1
<include refid="condition"/>
<include refid="orderBy"/>
</select>
<select id="count" resultClass="int">
SELECT COUNT(*) FROM ${hggpSchema}.HGZL012 WHERE 1=1
<include refid="condition"/>
</select>
<insert id="insert">
INSERT INTO ${hggpSchema}.HGZL012 (
ACCOUNT_CODE, <!-- 企业编码 -->
DEP_CODE, <!-- 部门编码 -->
CREATED_BY, <!-- 记录创建者 -->
CREATED_NAME, <!-- 记录创建名称 -->
CREATED_TIME, <!-- 记录创建时间 -->
UPDATED_BY, <!-- 记录修改者 -->
UPDATED_NAME, <!-- 记录修改名称 -->
UPDATED_TIME, <!-- 记录修改时间 -->
DELETE_FLAG, <!-- 0-未删除,1-已删除 -->
STATUS, <!-- 状态:0-质检中,1-质检完成 -->
QUALITY_NO, <!-- 质检单号 -->
QUALITY_DATE, <!-- 单据日期 -->
COMPANY_CODE, <!-- 公司编码 -->
COMPANY_NAME, <!-- 公司名称 -->
INVENT_TYPE, <!-- 存货类型 -->
INVENT_CODE, <!-- 存货编码 -->
INVENT_NAME, <!-- 存货名称 -->
SPEC_ID, <!-- 规格ID -->
SPEC, <!-- 规格 -->
UNIT, <!-- 单位 -->
APPLY_QTY, <!-- 入库数量 -->
APPLY_UNIT_WEIGHT, <!-- 入库单重 -->
APPLY_WEIGHT, <!-- 入库重量 -->
QUALITY_QTY, <!-- 合格数量 -->
UN_QUALITY_QTY, <!-- 不合格数量 -->
DEPOSIT_CODE, <!-- 委外入库单号 -->
DEPOSIT_LINE_CODE <!-- 委外入库行号 -->
) VALUES (
#accountCode#, #depCode#, #createdBy#, #createdName#, #createdTime#, #updatedBy#, #updatedName#,
#updatedTime#, #deleteFlag#, #status#, #qualityNo#, #qualityDate#, #companyCode#, #companyName#, #inventType#,
#inventCode#, #inventName#, #specId#, #spec#, #unit#, #applyQty#, #applyUnitWeight#, #applyWeight#,
#qualityQty#, #unQualityQty#, #depositCode#, #depositLineCode#)
</insert>
<delete id="delete">
UPDATE ${hggpSchema}.HGZL012 SET DELETE_FLAG = 1 WHERE ID = #id#
</delete>
<update id="update">
UPDATE ${hggpSchema}.HGZL012
SET
QUALITY_DATE = #qualityDate#, <!-- 单据日期 -->
COMPANY_CODE = #companyCode#, <!-- 公司编码 -->
COMPANY_NAME = #companyName#, <!-- 公司名称 -->
INVENT_TYPE = #inventType#, <!-- 存货类型 -->
INVENT_CODE = #inventCode#, <!-- 存货编码 -->
INVENT_NAME = #inventName#, <!-- 存货名称 -->
SPEC_ID = #specId#, <!-- 规格ID -->
SPEC = #spec#, <!-- 规格 -->
UNIT = #unit#, <!-- 单位 -->
APPLY_QTY = #applyQty#, <!-- 入库数量 -->
APPLY_UNIT_WEIGHT = #applyUnitWeight#, <!-- 入库单重 -->
APPLY_WEIGHT = #applyWeight#, <!-- 入库重量 -->
QUALITY_QTY = #qualityQty#, <!-- 合格数量 -->
UN_QUALITY_QTY = #unQualityQty#, <!-- 不合格数量 -->
DEPOSIT_CODE = #depositCode#, <!-- 委外入库单号 -->
DEPOSIT_LINE_CODE = #depositLineCode#, <!-- 委外入库行号 -->
<include refid="SqlBase.updateRevise"/>
WHERE ID = #id#
</update>
</sqlMap>
...@@ -384,4 +384,77 @@ public class HGZLTools { ...@@ -384,4 +384,77 @@ public class HGZLTools {
} }
/**
* HGZL012 定义
*
* @author:songx
* @date:2024/9/29,14:10
*/
public static class HgZl012 {
/**
* 锁
*
* @param qualityNo
* @return
*/
public static void lock(String qualityNo) {
AssertUtils.isEmpty(qualityNo, "质检单号不能为空");
Map paramMap = new HashMap();
paramMap.put(HGZL012.FIELD_QUALITY_NO, qualityNo);
DaoBase.getInstance().update(HgZlSqlConst.HgZl012.LOCK, paramMap);
}
/**
* 锁
*
* @param qualityNos
* @return
*/
public static void lock(List<String> qualityNos) {
AssertUtils.isEmpty(qualityNos, "质检单号不能为空");
Map paramMap = new HashMap();
paramMap.put("qualityNos", qualityNos);
DaoBase.getInstance().update(HgZlSqlConst.HgZl012.LOCK, paramMap);
}
/**
* 查询
*
* @param qualityNo
*/
public static HGZL012 get(String qualityNo) {
AssertUtils.isEmpty(qualityNo, "质检单号不能为空");
Map paramMap = new HashMap();
paramMap.put(HGZL012.FIELD_QUALITY_NO, qualityNo);
List<HGZL012> results = DaoBase.getInstance().query(HGZL012.QUERY, paramMap);
return CollectionUtils.isEmpty(results) ? null : results.get(0);
}
/**
* 查询
*
* @param qualityNos
* @return
*/
public static List<HGZL012> list(List<String> qualityNos) {
AssertUtils.isEmpty(qualityNos, "质检单号不能为空");
Map<String, Object> paramMap = new HashMap();
paramMap.put("qualityNos", qualityNos);
return DaoBase.getInstance().query(HGZL012.QUERY, paramMap);
}
/**
* 查询
*
* @param qualityNos
* @return
*/
public static Map<String, HGZL012> map(List<String> qualityNos) {
List<HGZL012> results = list(qualityNos);
return results.stream().collect(Collectors.toMap(HGZL012::getQualityNo, item -> item));
}
}
} }
...@@ -3,6 +3,7 @@ package com.baosight.hggp.hg.zl.utils; ...@@ -3,6 +3,7 @@ package com.baosight.hggp.hg.zl.utils;
import com.baosight.hggp.hg.utils.HGUtils; import com.baosight.hggp.hg.utils.HGUtils;
import com.baosight.hggp.hg.zl.domain.HGZL001; import com.baosight.hggp.hg.zl.domain.HGZL001;
import com.baosight.hggp.hg.zl.domain.HGZL011; import com.baosight.hggp.hg.zl.domain.HGZL011;
import com.baosight.hggp.hg.zl.domain.HGZL012;
import com.baosight.hggp.hg.zl.tools.HGZLTools; import com.baosight.hggp.hg.zl.tools.HGZLTools;
import com.baosight.hggp.util.DateUtils; import com.baosight.hggp.util.DateUtils;
import com.baosight.hggp.util.MapUtils; import com.baosight.hggp.util.MapUtils;
...@@ -65,7 +66,6 @@ public class HGZLUtils { ...@@ -65,7 +66,6 @@ public class HGZLUtils {
} }
} }
/** /**
* HGZL001 工具类 * HGZL001 工具类
* *
...@@ -127,4 +127,63 @@ public class HGZLUtils { ...@@ -127,4 +127,63 @@ public class HGZLUtils {
} }
/**
* HGZL002 工具类
*
* @author:songx
* @date:2024/5/9,16:58
*/
public static class HgZl012 {
/**
* 设置查询条件
*
* @param queryRow 集合
* @return
*/
public static void setCondition(Map queryRow) {
HGUtils.setCondition(queryRow);
// 单据日期
String qualityDate = MapUtils.getString(queryRow, HGZL012.FIELD_QUALITY_DATE);
if (StringUtils.isNotBlank(qualityDate)) {
queryRow.put(HGZL012.FIELD_QUALITY_DATE, DateUtils.formatShort(qualityDate));
}
}
/**
* 锁并且获取数据
*
* @param qualityNo
* @return
*/
public static HGZL012 lockGetData(String qualityNo) {
// 锁
HGZLTools.HgZl012.lock(qualityNo);
// db数据
return HGZLTools.HgZl012.get(qualityNo);
}
/**
* 锁并且获取数据
*
* @param fZl012s
* @return
*/
public static Map<String, HGZL012> lockGetDataEp(List<? extends HGZL012> fZl012s) {
return lockGetData(ObjectUtils.listEpKey(fZl012s, HGZL012.FIELD_QUALITY_NO));
}
/**
* 锁并且获取数据
*
* @param qualityNos
* @return
*/
public static Map<String, HGZL012> lockGetData(List<String> qualityNos) {
// 锁
HGZLTools.HgZl012.lock(qualityNos);
// db数据
return HGZLTools.HgZl012.map(qualityNos);
}
}
} }
...@@ -63,6 +63,7 @@ ...@@ -63,6 +63,7 @@
<sqlMap resource="com/baosight/hggp/hg/zl/sql/HGZL004.xml"/> <sqlMap resource="com/baosight/hggp/hg/zl/sql/HGZL004.xml"/>
<sqlMap resource="com/baosight/hggp/hg/zl/sql/HGZL004A.xml"/> <sqlMap resource="com/baosight/hggp/hg/zl/sql/HGZL004A.xml"/>
<sqlMap resource="com/baosight/hggp/hg/zl/sql/HGZL011.xml"/> <sqlMap resource="com/baosight/hggp/hg/zl/sql/HGZL011.xml"/>
<sqlMap resource="com/baosight/hggp/hg/zl/sql/HGZL012.xml"/>
<!-- 生产 --> <!-- 生产 -->
<sqlMap resource="com/baosight/hggp/hg/sc/sql/HGSC001.xml"/> <sqlMap resource="com/baosight/hggp/hg/sc/sql/HGSC001.xml"/>
......
...@@ -264,21 +264,22 @@ function updateStatus(id,status) { ...@@ -264,21 +264,22 @@ function updateStatus(id,status) {
}); });
} }
/** /**
* 显示详情 * 显示详情
*/ */
function showDetail(id,whCode,companyCode,status) { function showDetail(id, whCode, companyCode, status) {
let params = {
"inqu_status-0-receiveId": id,
}
JSColorbox.open({ JSColorbox.open({
href: "HGKC008A?methodName=initLoad&inqu_status-0-receiveId=" + id+"&inqu_status-0-whCode="+whCode+"&inqu_status-0-companyCode="+companyCode+"&inqu_status-0-status="+status, href: "HGKC008A",
title: "<div style='text-align: center;'>领料详情</div>", title: "<div style='text-align: center;'>领料详情</div>",
width: "90%", width: "90%",
height: "90%", height: "90%",
params: params
}); });
} }
function loadChange(grid,e,field) { function loadChange(grid,e,field) {
var cell_label = field,that = grid; var cell_label = field,that = grid;
// locked 表示是否为固定列 // locked 表示是否为固定列
......
...@@ -68,7 +68,7 @@ ...@@ -68,7 +68,7 @@
</EF:EFComboColumn> </EF:EFComboColumn>
<EF:EFColumn ename="receiveUserName" cname="领料人姓名" width="120" align="center" enable="false" hidden="true"/> <EF:EFColumn ename="receiveUserName" cname="领料人姓名" width="120" align="center" enable="false" hidden="true"/>
<EF:EFComboColumn cname="状态" ename="status" width="90" align="center" required="false" enable="false"> <EF:EFComboColumn cname="状态" ename="status" width="90" align="center" required="false" enable="false">
<EF:EFCodeOption codeName="hggp.sc.productStatus"/> <EF:EFCodeOption codeName="hggp.hgkc.ScllStatus"/>
</EF:EFComboColumn> </EF:EFComboColumn>
</EF:EFGrid> </EF:EFGrid>
</EF:EFRegion> </EF:EFRegion>
......
...@@ -151,15 +151,22 @@ $(function (){ ...@@ -151,15 +151,22 @@ $(function (){
* 页面加载时执行 * 页面加载时执行
*/ */
$(window).load(function () { $(window).load(function () {
var status = $("#inqu_status-0-status").val(); // 查询
query();
// 按钮显示
let status = $("#main-0-status").val();
//如果提交了,则不能修改 //如果提交了,则不能修改
if(status && status === "1"){ if (isBlank(status) || status != "0") {
$('#add').hide(); $('#add').hide();
$('#save-changes').hide(); $('#save-changes').hide();
$('#cancel-changes').hide(); $('#cancel-changes').hide();
$('#delete').hide(); $('#delete').hide();
} }
}); });
/**
* 查询
*/
let query = function () { let query = function () {
resultGrid.dataSource.page(1); resultGrid.dataSource.page(1);
} }
......
...@@ -8,14 +8,13 @@ ...@@ -8,14 +8,13 @@
<script> <script>
var ctx = "${ctx}"; var ctx = "${ctx}";
</script> </script>
<head>
</head>
<EF:EFPage title="生产领料详情"> <EF:EFPage title="生产领料详情">
<EF:EFInput ename="main-0-applyCode" cname="领料单号" colWidth="3" type="hidden"/>
<EF:EFInput ename="main-0-status" cname="状态" colWidth="3" type="hidden"/>
<EF:EFRegion id="inqu" title="查询条件"> <EF:EFRegion id="inqu" title="查询条件">
<EF:EFInput ename="inqu_status-0-receiveId" cname="领料单id" colWidth="3" type="hidden"/> <EF:EFInput ename="inqu_status-0-receiveId" cname="领料单id" colWidth="3" type="hidden"/>
<EF:EFInput ename="inqu_status-0-whCode" cname="仓库编码" colWidth="3" type="hidden"/> <EF:EFInput ename="inqu_status-0-whCode" cname="仓库编码" colWidth="3" type="hidden"/>
<EF:EFInput ename="inqu_status-0-companyCode" cname="公司编码" colWidth="3" type="hidden"/> <EF:EFInput ename="inqu_status-0-companyCode" cname="公司编码" colWidth="3" type="hidden"/>
<EF:EFInput ename="inqu_status-0-status" cname="状态" colWidth="3" type="hidden"/>
<div class="row"> <div class="row">
<EF:EFSelect cname="存货类型" ename="inqu_status-0-inventType" colWidth="3" filter="contains"> <EF:EFSelect cname="存货类型" ename="inqu_status-0-inventType" colWidth="3" filter="contains">
<EF:EFOption label="全部" value=""/> <EF:EFOption label="全部" value=""/>
...@@ -30,11 +29,11 @@ ...@@ -30,11 +29,11 @@
<EF:EFGrid blockId="result" autoDraw="no" isFloat="true" copyToAdd="false" checkMode="row,single"> <EF:EFGrid blockId="result" autoDraw="no" isFloat="true" copyToAdd="false" checkMode="row,single">
<EF:EFColumn ename="id" cname="主键" hidden="true"/> <EF:EFColumn ename="id" cname="主键" hidden="true"/>
<EF:EFColumn ename="receiveId" cname="领料单id" hidden="true"/> <EF:EFColumn ename="receiveId" cname="领料单id" hidden="true"/>
<EF:EFColumn ename="whCode" cname="仓库编码" hidden="true"/>
<EF:EFColumn ename="companyCode" cname="公司编码" hidden="true"/> <EF:EFColumn ename="companyCode" cname="公司编码" hidden="true"/>
<EF:EFComboColumn ename="status" cname="状态" enable="false" width="80" align="center"> <EF:EFComboColumn ename="status" cname="状态" enable="false" width="80" align="center">
<EF:EFCodeOption codeName="hggp.hgkc.ScllStatus"/> <EF:EFCodeOption codeName="hggp.hgkc.ScllStatus"/>
</EF:EFComboColumn> </EF:EFComboColumn>
<EF:EFColumn ename="whCode" cname="仓库编码" hidden="true"/>
<EF:EFColumn ename="inventCode" cname="存货编码" enable="true" width="120" align="center" required="true"/> <EF:EFColumn ename="inventCode" cname="存货编码" enable="true" width="120" align="center" required="true"/>
<EF:EFColumn ename="inventName" cname="存货名称" width="120" align="center" enable="false" required="true"/> <EF:EFColumn ename="inventName" cname="存货名称" width="120" align="center" enable="false" required="true"/>
<EF:EFComboColumn ename="inventType" cname="存货类型" width="120" align="center" required="true" <EF:EFComboColumn ename="inventType" cname="存货类型" width="120" align="center" required="true"
......
...@@ -124,7 +124,7 @@ function remove() { ...@@ -124,7 +124,7 @@ function remove() {
} }
JSUtils.confirm("确定对勾选中的[" + rows.length + "]条数据做\"删除\"操作?", { JSUtils.confirm("确定对勾选中的[" + rows.length + "]条数据做\"删除\"操作?", {
ok: function () { ok: function () {
JSUtils.submitGridsData("result", "HGXS007A", "remove", true); JSUtils.submitGridsData("result", "HGZL011A", "remove", true);
} }
}); });
} }
......
$(function () {
IPLATUI.EFGrid = {
"result": {
pageable: {
input: true,
numeric: false,
pageSize: 20,
pageSizes: [10, 20, 30, 50, 100, 200]
},
columns: [{
field: "qualityDate",
attributes: {
class: "i-input-readonly"
}
}, {
field: "problemPhoto",
template: function (item) {
if (!isBlank(item.qualityNo)) {
return '<a style="cursor: pointer;display: inline-flex;justify-content: center;margin:auto 5px" '
+ 'onclick="showUploadFile(\'' + item.qualityNo + '\', \'SCLL_QUALITY_PROBLEM\')" >附件清单</a>';
} else {
return "";
}
}
}, {
field: "processPhoto",
template: function (item) {
if (!isBlank(item.qualityNo)) {
return '<a style="cursor: pointer;display: inline-flex;justify-content: center;margin:auto 5px" '
+ 'onclick="showUploadFile(\'' + item.qualityNo + '\', \'SCLL_QUALITY_PROCESS\')" >附件清单</a>';
} else {
return "";
}
}
}, {
field: "createdName",
template: function (options) {
return showUserName(options.createdBy, options.createdName);
}
}],
loadComplete: function (grid) {
grid.dataSource.bind("change", function (e) {
var item = e.items[0];
if (e.field == "qualityQty") {
if (item.qualityQty && item.applyQty) {
let unQualityQty = item.applyQty - item.qualityQty;
resultGrid.setCellValue(item, 'unQualityQty', unQualityQty.toFixed(3))
}
}
if (e.field == "unQualityQty") {
if (item.unQualityQty && item.applyQty) {
let qualityQty = item.applyQty - item.unQualityQty;
resultGrid.setCellValue(item, 'qualityQty', qualityQty.toFixed(3))
}
}
});
},
onSuccess: function (e) {
}
}
}
// 查询
$("#QUERY").on("click", query);
// 选择采购收货
$("#SELECT").on("click", select);
// 质检完成
$("#PROCESS").on("click", process);
// 删除
$("#REMOVE").on("click", remove);
});
/**
* 页面加载时执行
*/
$(window).load(function () {
// 查询
query();
});
/**
* 查询
*/
let query = function () {
resultGrid.dataSource.page(1);
}
/**
* 附件清单
*
* @param id
* @param type
*/
function showUploadFile(id, type) {
let params = {
"inqu_status-0-bizId": id,
"inqu_status-0-bizType": type
}
JSColorbox.open({
href: "HGZL012A",
title: "<div style='text-align: center;'>附件清单</div>",
width: "80%",
height: "80%",
params: params
});
}
/**
* 提交操作
*
* @param id
* @param checkNo
*/
let process = function () {
let rows = resultGrid.getCheckedRows();
if (rows.length < 1) {
message("请选择数据")
return;
}
for (let i = 0; i < rows.length; i++) {
let qualityQty = rows[i]['qualityQty'];
let unQualityQty = rows[i]['unQualityQty'];
let applyQty = rows[i]['applyQty'];
if (!isNumber(qualityQty) || !isNumber(unQualityQty)) {
message("第" + (i + 1) + "行合格数量和不合格数量必须是大于等于0的数字");
return;
}
if ((parseFloat(qualityQty) + parseFloat(unQualityQty)) != parseFloat(applyQty)) {
message("第" + (i + 1) + "行合格数量加不合格数量必须等于领料数量");
return;
}
}
JSUtils.confirm("确定对勾选中的[" + rows.length + "]条数据做\"质检完成\"操作吗? ", {
ok: function () {
JSUtils.submitGridsData("result", "HGZL012", "process", true);
}
});
}
/**
* 选择生产领料
*/
let select = function () {
JSColorbox.open({
href: "HGZL011B?methodName=initLoad",
title: "<div style='text-align: center;'>生产领料查询</div>",
width: "80%",
height: "80%",
callbackName: selectCallback
});
}
/**
* 选择采购收货回调
*/
let selectCallback = function () {
// 刷新页面
query();
// 关闭弹窗
JSColorbox.close();
}
/**
* 删除
*/
function remove() {
let rows = resultGrid.getCheckedRows();
if (rows.length < 1) {
message("请选择数据");
return;
}
JSUtils.confirm("确定对勾选中的[" + rows.length + "]条数据做\"删除\"操作? ", {
ok: function () {
JSUtils.submitGridsData("result", "HGZL011", "remove", 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="单据日期" ename="qualityDate" blockId="inqu_status" row="0" colWidth="3"
format="yyyy-MM-dd" readonly="true"/>
<EF:EFSelect cname="公司名称" blockId="inqu_status" ename="companyCode" row="0" colWidth="3"
filter="contains" optionLabel="全部" defultValue="">
<EF:EFOptions blockId="roleCompany" valueField="companyCode" textField="companyName"/>
</EF:EFSelect>
<EF:EFSelect cname="存货名称" blockId="inqu_status" ename="inventCode" row="0" colWidth="3"
filter="contains" optionLabel="全部" defultValue="">
<EF:EFOptions blockId="invent_record_block_id" textField="textField" valueField="valueField"/>
</EF:EFSelect>
<EF:EFSelect cname="处理状态" ename="status" blockId="inqu_status" row="0" colWidth="3">
<EF:EFOption label="全部" value=""/>
<EF:EFOption label="已处理" value="1"></EF:EFOption>
<EF:EFOption label="未处理" value="0"></EF:EFOption>
</EF:EFSelect>
</div>
<div class="row">
<EF:EFInput cname="入库单号" ename="depositCode" blockId="inqu_status" row="0" colWidth="3"/>
</div>
</EF:EFRegion>
<EF:EFRegion id="result" title="明细信息" fitHeight="true">
<EF:EFGrid blockId="result" autoDraw="override" isFloat="true" checkMode="row" height="68vh">
<EF:EFColumn ename="id" cname="内码" hidden="true"/>
<EF:EFColumn ename="problemPhoto" cname="问题照片" locked="true" enable="false" width="80" align="center"
required="true"/>
<EF:EFColumn ename="processPhoto" cname="处理照片" locked="true" enable="false" width="80" align="center"
required="true"/>
<EF:EFColumn ename="qualityNo" cname="质检单号" enable="false" width="130" align="center"/>
<EF:EFColumn ename="qualityDate" cname="单据日期" enable="false" width="120" align="center" editType="date"
dateFormat="yyyy-MM-dd" parseFormats="['yyyyMMdd']"/>
<EF:EFComboColumn ename="status" cname="状态" enable="false" width="100" align="center">
<EF:EFOption label="已处理" value="1"></EF:EFOption>
<EF:EFOption label="未处理" value="0"></EF:EFOption>
</EF:EFComboColumn>
<EF:EFColumn ename="companyCode" cname="公司编码" enable="false" width="100" align="center" hidden="true"/>
<EF:EFColumn ename="companyName" cname="公司名称" enable="false" width="180" align="center"/>
<EF:EFColumn ename="applyLineCode" cname="领料单行号" enable="false" width="130" align="center"/>
<EF:EFColumn ename="inventCode" cname="存货编码" enable="false" width="100" align="center" hidden="true"/>
<EF:EFColumn ename="inventName" cname="存货名称" enable="false" width="100" align="center"/>
<EF:EFColumn ename="specId" cname="规格ID" enable="false" width="100" align="center" hidden="true"/>
<EF:EFColumn ename="spec" cname="规格" enable="false" width="120" align="center"/>
<EF:EFColumn ename="qualityQty" cname="合格数量" width="120" align="right" format="{0:N3}" required="true"/>
<EF:EFColumn ename="unQualityQty" cname="不合格数量" width="120" align="right" format="{0:N3}" required="true"/>
<EF:EFColumn ename="applyQty" cname="领料数量" enable="false" width="120" align="right" format="{0:N3}"/>
<EF:EFColumn ename="applyWeight" cname="领料重量" enable="false" width="120" align="right" format="{0:N3}"/>
<EF:EFColumn ename="length" cname="长(MM)" enable="false" width="80" align="right" format="{0:N3}"/>
<EF:EFColumn ename="width" cname="宽(MM)" enable="false" width="80" align="right" format="{0:N3}"/>
<EF:EFColumn ename="thick" cname="厚(MM)" enable="false" width="80" align="right" format="{0:N3}"/>
<EF:EFColumn ename="createdName" cname="创建人" enable="false" width="150" align="center"/>
<EF:EFColumn ename="createdTime" cname="创建时间" enable="false" width="150" align="center"
editType="datetime" parseFormats="['yyyyMMddHHmmss']" dateFormat="yyyy-MM-dd HH:mm:ss"/>
</EF:EFGrid>
</EF:EFRegion>
</EF:EFPage>
$(function () {
IPLATUI.EFSelect = {
"inqu_status-0-bizType": {
change: function (e) {
query();
}
}
}
IPLATUI.EFGrid = {
"result": {
columns: [{
field: "operator",
template: function (item) {
let template = '<a style="cursor: pointer;display: inline-flex;justify-content: center;margin:auto 5px" '
+ 'href="' + downloadHref(item.docId) + '" target="_blank">附件下载</a>';
return template;
}
}],
dataBound: function () {
}
}
};
$("#ef_form_head").hide();
// 查询
$("#QUERY").on("click", query);
// 附件上传
$("#UPLOAD_FILE").on("click", uploadFile);
// 删除
$("#REMOVE").on("click", remove);
});
/**
* 页面加载时执行
*/
$(window).load(function () {
// 初始化查询
query();
// 隐藏按钮
showButton();
});
/**
* 查询
*/
let query = function (e) {
resultGrid.dataSource.page(1);
}
/**
* 显示按钮
*/
let showButton = function () {
var status = $("#detail-0-status").val();
//如果提交了,则不能修改
if (!isBlank(status) && status === "0") {
$('#UPLOAD_FILE').show();
$('#REMOVE').show();
} else {
$('#UPLOAD_FILE').hide();
$('#REMOVE').hide();
}
}
/**
* 文件上传
*
* @param id
*/
function uploadFile() {
let bizId = $("#inqu_status-0-bizId").val();
let bizType = $("#inqu_status-0-bizType").val();
let inInfo = new EiInfo();
inInfo.set("inqu_status-0-qualityNo", bizId);
EiCommunicator.send('HGZL012', 'checkStatus', inInfo, {
onSuccess(res) {
if (res.status !== -1) {
let params = {
"inqu_status-0-bizId": bizId,
"inqu_status-0-bizType": bizType
}
JSColorbox.open({
href: "HGDM099A",
title: "<div style='text-align: center;'>附件上传</div>",
width: "60%",
height: "50%",
params: params,
callbackName: uploadFileCallback
});
} else {
message(res.msg);
}
},
onFail(errorMessage, status, e) {
NotificationUtil("执行失败!", "error");
}
}, {
async: false
});
}
/**
* 附件上传回调
*
* @param docId
*/
function uploadFileCallback(e) {
resultGrid.dataSource.page(1);
}
/**
* 删除
*/
function remove() {
var rows = resultGrid.getCheckedRows();
if (rows.length == 0) {
message("请先勾选数据!");
return;
}
JSUtils.confirm("确定对勾选中的[" + rows.length + "]条数据做\"删除\"操作?", {
ok: function () {
JSUtils.submitGridsData("result", "HGZL012A", "remove", 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="查询区域" type="query">
<EF:EFInput cname="ID" ename="id" blockId="detail" row="0" type="hidden"/>
<EF:EFInput cname="状态" ename="status" blockId="detail" row="0" type="hidden"/>
<div class="row">
<EF:EFInput cname="质检单号" ename="bizId" blockId="inqu_status" row="0" readonly="true"/>
<EF:EFSelect cname="业务类型" ename="bizType" blockId="inqu_status" row="0" colWidth="3" readonly="true">
<EF:EFOption label="问题照片" value="WWRK_QUALITY_PROBLEM"/>
<EF:EFOption label="处理照片" value="WWRK_QUALITY_PROCESS"/>
</EF:EFSelect>
<EF:EFInput cname="文件名称" ename="docName" blockId="inqu_status" row="0" colWidth="3"/>
</div>
</EF:EFRegion>
<EF:EFRegion id="result" title="记录集">
<EF:EFGrid blockId="result" autoDraw="override" checkMode="row" isFloat="true"
serviceName="HGDM099" methodName="query">
<EF:EFColumn ename="id" cname="ID" hidden="true"/>
<EF:EFColumn ename="docId" cname="文件ID" enable="false" width="150"/>
<EF:EFColumn ename="docName" cname="文件名称" enable="false" width="150"/>
<EF:EFColumn ename="createdTime" cname="创建时间" enable="false" width="140" align="center"
parseFormats="['yyyyMMddHHmmss']" editType="datetime" dateFormat="yyyy-MM-dd HH:mm:ss"/>
<EF:EFColumn ename="operator" cname="操作" enable="false" width="200" align="center"/>
</EF:EFGrid>
</EF:EFRegion>
</EF:EFPage>
$(function () {
IPLATUI.EFGrid = {
"result": {
columns: [],
dataBound: function () {
}
}
};
$("#ef_form_head").hide();
// 查询
$("#QUERY").on("click", query);
// 确认
$("#CONFIRM").on("click", confirm);
downKeyUp();
});
/**
* 页面加载时执行
*/
$(window).load(function () {
// 初始化查询
query();
initInventCode();
});
/**
* 查询
*/
var query = function (e) {
resultGrid.dataSource.page(1);
};
/**
* 确认
*/
let confirm = function () {
let rows = resultGrid.getCheckedRows();
if (rows.length < 1) {
message("请选择数据")
return;
}
JSUtils.confirm("确定对勾选中的[" + rows.length + "]条数据生成质检单吗? ", {
ok: function () {
JSUtils.submitGridsData("result", "HGZL012B", "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:EFInput ename="depositCode" cname="入库单号" blockId="inqu_status" row="0" colWidth="3"/>
<EF:EFSelect ename="companyCode" cname="公司名称" blockId="inqu_status" row="0" colWidth="3"
filter="contains" optionLabel="全部" defultValue="">
<EF:EFOptions blockId="company_code_block_id" textField="textField" valueField="valueField"/>
</EF:EFSelect>
<EF:EFInput ename="projName" cname="项目名称" blockId="inqu_status" row="0" colWidth="4"/>
</div>
</EF:EFRegion>
<EF:EFRegion id="result" title="记录集">
<EF:EFGrid blockId="result" autoDraw="override" checkMode="row" isFloat="true">
<EF:EFColumn ename="id" cname="领料单行ID" enable="false" width="130" align="center"/>
<EF:EFColumn ename="companyCode" cname="公司编码" enable="false" width="100" align="center" hidden="true"/>
<EF:EFColumn ename="companyName" cname="公司名称" enable="false" width="160" align="center"/>
<EF:EFComboColumn ename="status" cname="状态" enable="false" width="80" align="center">
<EF:EFCodeOption codeName="hggp.hgkc.ScllStatus"/>
</EF:EFComboColumn>
<EF:EFColumn ename="whCode" cname="仓库编码" hidden="true"/>
<EF:EFColumn ename="inventCode" cname="存货编码" enable="true" width="120" align="center"/>
<EF:EFColumn ename="inventName" cname="存货名称" width="120" align="center" enable="false"/>
<EF:EFColumn ename="invSpecId" cname="规格id" hidden="true"/>
<EF:EFColumn ename="invSpec" cname="规格" enable="false" width="120" align="center"/>
<EF:EFColumn ename="invQty" cname="数量" enable="false" width="120" align="right" format="{0:N3}"/>
<EF:EFColumn ename="invWeight" cname="重量" enable="false" width="100" align="right" format="{0:N3}"
sort="true"/>
</EF:EFGrid>
</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