Commit a7052ae5 by 宋祥

1.生产领料质检单

parent fe87e7a9
...@@ -49,6 +49,9 @@ public class HGConstant { ...@@ -49,6 +49,9 @@ public class HGConstant {
public static final String HPKC008_NUMBER = "HPKC008_NUMBER"; public static final String HPKC008_NUMBER = "HPKC008_NUMBER";
// 巡检单号 // 巡检单号
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 HPKC001_NUMBER = "HPKC001_NUMBER"; public static final String HPKC001_NUMBER = "HPKC001_NUMBER";
// 生产领料单号 // 生产领料单号
...@@ -142,7 +145,10 @@ public class HGConstant { ...@@ -142,7 +145,10 @@ public class HGConstant {
public static final String FOL_NO = "FOL_NO"; public static final String FOL_NO = "FOL_NO";
// 维修单号 // 维修单号
public static final String REP_ORDER_NO = "REP_ORDER_NO"; public static final String REP_ORDER_NO = "REP_ORDER_NO";
// 生产领料单号
public static final String SC_APPLY_CODE = "SC_APPLY_CODE";
// 生产领料单行号
public static final String SC_APPLY_LINE_CODE = "SC_APPLY_LINE_CODE";
} }
......
...@@ -320,18 +320,6 @@ public class HGSqlConstant { ...@@ -320,18 +320,6 @@ public class HGSqlConstant {
} }
/** /**
* HGKC008 SQL 定义
*
* @author:songx
* @date:2024/1/20,16:45
*/
public class HGKC008 {
// 查询
public static final String QUERY_SUM = "HGKC008.querySum";
}
/**
* HGKC002 SQL 定义 * HGKC002 SQL 定义
* *
* @author:songx * @author:songx
......
package com.baosight.hggp.hg.dm.utils;
import com.baosight.hggp.core.dao.DaoUtils;
import com.baosight.hggp.core.utils.Iplat4jUtils;
import com.baosight.hggp.hg.dm.domain.HGDM099;
import com.baosight.hggp.util.MapUtils;
import com.baosight.iplat4j.core.ei.EiInfo;
import java.util.List;
/**
* @author:songx
* @date:2024/9/29,14:21
*/
public class HgDmUtils {
/**
* HGDM099 定义
*
* @author:songx
* @date:2024/9/29,14:21
*/
public static class HgDm099 {
/**
* 删除附件
*
* @param inInfo
*/
public static int delete(EiInfo inInfo) {
List<HGDM099> fDm099s = MapUtils.toDaoEPBases(inInfo, HGDM099.class);
for (HGDM099 fDm099 : fDm099s) {
DaoUtils.update(HGDM099.DELETE, fDm099);
if (!fDm099.getDocId().isEmpty()) {
Iplat4jUtils.deleteFileByDocId(fDm099.getDocId());
}
}
return fDm099s.size();
}
}
}
package com.baosight.hggp.hg.kc.constant;
/**
* @author:songx
* @date:2024/9/29,10:01
*/
public class HgKcConst {
/**
* HGKC008 定义
*
* @author:songx
* @date:2024/1/20,16:45
*/
public static class HgKc008 {
/**
* 提交状态
*
* @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;
}
}
}
package com.baosight.hggp.hg.kc.constant;
/**
* @author:songx
* @date:2024/9/29,9:54
*/
public class HgKcSqlConst {
/**
* HGKC008 SQL 定义
*
* @author:songx
* @date:2024/1/20,16:45
*/
public class HgKc008 {
// 锁
public static final String LOCK = "HGKC008.lock";
// 修改状态
public static final String UPDATE_STATUS = "HGKC008.updateStatus";
// 查询
public static final String QUERY_SUM = "HGKC008.querySum";
// 修改
public static final String UPDATE_RECEIVE_TYPE = "HGKC008.updateReceiveType";
}
/**
* HGKC008A SQL 定义
*
* @author:songx
* @date:2024/1/20,16:45
*/
public class HgKc008A {
// 锁
public static final String LOCK = "HGKC008A.lock";
// 修改状态
public static final String UPDATE_STATUS = "HGKC008A.updateStatus";
// 质检查询
public static final String QUERY_QC = "HGKC008A.queryQc";
// 批量删除
public static final String BATCH_DELETE = "HGKC008A.batchDelete";
}
}
...@@ -75,7 +75,6 @@ public class HGKC008 extends DaoEPBase { ...@@ -75,7 +75,6 @@ public class HGKC008 extends DaoEPBase {
public static final String DELETE = "HGKC008.delete"; public static final String DELETE = "HGKC008.delete";
public static final String BATCH_DELETE = "HGKC008.batchDelete";; public static final String BATCH_DELETE = "HGKC008.batchDelete";;
public static final String UPDATE_STATUS = "HGKC008.updateStatus";; public static final String UPDATE_STATUS = "HGKC008.updateStatus";;
public static final String UPDATE_RECEIVE_TYPE = "HGKC008.updateReceiveType";;
private Long id = new Long(0); /* 主键id*/ private Long id = new Long(0); /* 主键id*/
private String accountCode = " "; /* 账套*/ private String accountCode = " "; /* 账套*/
......
...@@ -10,18 +10,18 @@ import com.baosight.iplat4j.core.util.StringUtils; ...@@ -10,18 +10,18 @@ import com.baosight.iplat4j.core.util.StringUtils;
/** /**
* Project: <br> * Project: <br>
* Title:HGKC008A.java <br> * Title:Hgkc008a.java <br>
* Description: <br> * Description: <br>
* *
* Copyrigth:Baosight Software LTD.co Copyright (c) 2019. <br> * Copyrigth:Baosight Software LTD.co Copyright (c) 2019. <br>
* *
* @version 1.0 * @version 1.0
* @history 2024-05-30 9:58:54 create * @history 2024-09-29 13:48:32 create
*/ */
public class HGKC008A extends DaoEPBase { public class HGKC008A extends DaoEPBase {
private static final long serialVersionUID = 1L; private static final long serialVersionUID = 1L;
public static final String FIELD_ID = "id"; /* 主键id*/ public static final String FIELD_ID = "id"; /* 主键id*/
public static final String FIELD_ACCOUNT_CODE = "accountCode"; /* 账套*/ public static final String FIELD_ACCOUNT_CODE = "accountCode"; /* 账套*/
public static final String FIELD_DEP_CODE = "depCode"; /* 部门编码*/ public static final String FIELD_DEP_CODE = "depCode"; /* 部门编码*/
...@@ -32,16 +32,21 @@ public class HGKC008A extends DaoEPBase { ...@@ -32,16 +32,21 @@ public class HGKC008A extends DaoEPBase {
public static final String FIELD_UPDATED_NAME = "updatedName"; /* 修改人名称*/ public static final String FIELD_UPDATED_NAME = "updatedName"; /* 修改人名称*/
public static final String FIELD_UPDATED_TIME = "updatedTime"; /* 修改时间*/ public static final String FIELD_UPDATED_TIME = "updatedTime"; /* 修改时间*/
public static final String FIELD_DELETE_FLAG = "deleteFlag"; /* 是否删除 0-否1-是*/ public static final String FIELD_DELETE_FLAG = "deleteFlag"; /* 是否删除 0-否1-是*/
public static final String FIELD_STATUS = "status"; /* 0.未提交,1-已提交,2.质检中*/
public static final String FIELD_APPLY_LINE_CODE = "applyLineCode"; /* 领料单行号*/
public static final String FIELD_APPLY_CODE = "applyCode"; /* 领料单号*/
public static final String FIELD_RECEIVE_ID = "receiveId"; /* 领料单id*/ public static final String FIELD_RECEIVE_ID = "receiveId"; /* 领料单id*/
public static final String FIELD_COMPANY_CODE = "companyCode"; /* 公司编码*/ public static final String FIELD_COMPANY_CODE = "companyCode"; /* 公司编码*/
public static final String FIELD_COMPANY_NAME = "companyName"; /* 公司名称*/ public static final String FIELD_COMPANY_NAME = "companyName"; /* 公司名称*/
public static final String FIELD_PROJ_CODE = "projCode"; /* 项目编码*/
public static final String FIELD_PROJ_NAME = "projName"; /* 项目名称*/
public static final String FIELD_WH_CODE = "whCode"; /* 仓库编号*/ public static final String FIELD_WH_CODE = "whCode"; /* 仓库编号*/
public static final String FIELD_WH_NAME = "whName"; /* 仓库名称*/ public static final String FIELD_WH_NAME = "whName"; /* 仓库名称*/
public static final String FIELD_INVENT_RECORD_ID = "inventRecordId"; /* 存货档案id*/ public static final String FIELD_INVENT_RECORD_ID = "inventRecordId"; /* 存货档案id*/
public static final String FIELD_INVENT_TYPE = "inventType"; /* 存货类型*/ public static final String FIELD_INVENT_TYPE = "inventType"; /* 存货类型*/
public static final String FIELD_INVENT_CODE = "inventCode"; /* 存货编码*/ public static final String FIELD_INVENT_CODE = "inventCode"; /* 存货编码*/
public static final String FIELD_INVENT_NAME = "inventName"; /* 存货名称*/ public static final String FIELD_INVENT_NAME = "inventName"; /* 存货名称*/
public static final String FIELD_INV_SPEC_ID = "invSpecId"; /* 规格*/ public static final String FIELD_INV_SPEC_ID = "invSpecId"; /* 规格ID*/
public static final String FIELD_INV_SPEC = "invSpec"; /* 规格*/ public static final String FIELD_INV_SPEC = "invSpec"; /* 规格*/
public static final String FIELD_INV_LENGTH = "invLength"; /* 长度(MM)*/ public static final String FIELD_INV_LENGTH = "invLength"; /* 长度(MM)*/
public static final String FIELD_INV_WIDTH = "invWidth"; /* 宽度(MM)*/ public static final String FIELD_INV_WIDTH = "invWidth"; /* 宽度(MM)*/
...@@ -51,10 +56,9 @@ public class HGKC008A extends DaoEPBase { ...@@ -51,10 +56,9 @@ public class HGKC008A extends DaoEPBase {
public static final String FIELD_INV_WEIGHT = "invWeight"; /* 重量*/ public static final String FIELD_INV_WEIGHT = "invWeight"; /* 重量*/
public static final String FIELD_PRICE = "price"; /* 单价*/ public static final String FIELD_PRICE = "price"; /* 单价*/
public static final String FIELD_AMOUNT = "amount"; /* 金额*/ public static final String FIELD_AMOUNT = "amount"; /* 金额*/
public static final String FIELD_PROJ_CODE = "projCode"; /* 项目编码*/ public static final String FIELD_INVENT_TYPE_DETAIL = "inventTypeDetail"; /* 存货类型大类*/
public static final String FIELD_PROJ_NAME = "projName"; /* 项目名称*/ public static final String FIELD_QUALITY_NO = "qualityNo"; /* 质检单号*/
public static final String FIELD_INVENT_TYPE_DETAIL = "inventTypeDetail"; /*存货类型明细*/
public static final String COL_ID = "ID"; /* 主键id*/ public static final String COL_ID = "ID"; /* 主键id*/
public static final String COL_ACCOUNT_CODE = "ACCOUNT_CODE"; /* 账套*/ public static final String COL_ACCOUNT_CODE = "ACCOUNT_CODE"; /* 账套*/
public static final String COL_DEP_CODE = "DEP_CODE"; /* 部门编码*/ public static final String COL_DEP_CODE = "DEP_CODE"; /* 部门编码*/
...@@ -65,16 +69,21 @@ public class HGKC008A extends DaoEPBase { ...@@ -65,16 +69,21 @@ public class HGKC008A extends DaoEPBase {
public static final String COL_UPDATED_NAME = "UPDATED_NAME"; /* 修改人名称*/ public static final String COL_UPDATED_NAME = "UPDATED_NAME"; /* 修改人名称*/
public static final String COL_UPDATED_TIME = "UPDATED_TIME"; /* 修改时间*/ 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_DELETE_FLAG = "DELETE_FLAG"; /* 是否删除 0-否1-是*/
public static final String COL_STATUS = "STATUS"; /* 0.未提交,1-已提交,2.质检中*/
public static final String COL_APPLY_LINE_CODE = "APPLY_LINE_CODE"; /* 领料单行号*/
public static final String COL_APPLY_CODE = "APPLY_CODE"; /* 领料单号*/
public static final String COL_RECEIVE_ID = "RECEIVE_ID"; /* 领料单id*/ public static final String COL_RECEIVE_ID = "RECEIVE_ID"; /* 领料单id*/
public static final String COL_COMPANY_CODE = "COMPANY_CODE"; /* 公司编码*/ public static final String COL_COMPANY_CODE = "COMPANY_CODE"; /* 公司编码*/
public static final String COL_COMPANY_NAME = "COMPANY_NAME"; /* 公司名称*/ public static final String COL_COMPANY_NAME = "COMPANY_NAME"; /* 公司名称*/
public static final String COL_PROJ_CODE = "PROJ_CODE"; /* 项目编码*/
public static final String COL_PROJ_NAME = "PROJ_NAME"; /* 项目名称*/
public static final String COL_WH_CODE = "WH_CODE"; /* 仓库编号*/ public static final String COL_WH_CODE = "WH_CODE"; /* 仓库编号*/
public static final String COL_WH_NAME = "WH_NAME"; /* 仓库名称*/ public static final String COL_WH_NAME = "WH_NAME"; /* 仓库名称*/
public static final String COL_INVENT_RECORD_ID = "INVENT_RECORD_ID"; /* 存货档案id*/ public static final String COL_INVENT_RECORD_ID = "INVENT_RECORD_ID"; /* 存货档案id*/
public static final String COL_INVENT_TYPE = "INVENT_TYPE"; /* 存货类型*/ public static final String COL_INVENT_TYPE = "INVENT_TYPE"; /* 存货类型*/
public static final String COL_INVENT_CODE = "INVENT_CODE"; /* 存货编码*/ public static final String COL_INVENT_CODE = "INVENT_CODE"; /* 存货编码*/
public static final String COL_INVENT_NAME = "INVENT_NAME"; /* 存货名称*/ public static final String COL_INVENT_NAME = "INVENT_NAME"; /* 存货名称*/
public static final String COL_INV_SPEC_ID = "invSpecId"; /* 规格Id*/ public static final String COL_INV_SPEC_ID = "INV_SPEC_ID"; /* 规格ID*/
public static final String COL_INV_SPEC = "INV_SPEC"; /* 规格*/ public static final String COL_INV_SPEC = "INV_SPEC"; /* 规格*/
public static final String COL_INV_LENGTH = "INV_LENGTH"; /* 长度(MM)*/ public static final String COL_INV_LENGTH = "INV_LENGTH"; /* 长度(MM)*/
public static final String COL_INV_WIDTH = "INV_WIDTH"; /* 宽度(MM)*/ public static final String COL_INV_WIDTH = "INV_WIDTH"; /* 宽度(MM)*/
...@@ -84,16 +93,15 @@ public class HGKC008A extends DaoEPBase { ...@@ -84,16 +93,15 @@ public class HGKC008A extends DaoEPBase {
public static final String COL_INV_WEIGHT = "INV_WEIGHT"; /* 重量*/ public static final String COL_INV_WEIGHT = "INV_WEIGHT"; /* 重量*/
public static final String COL_PRICE = "PRICE"; /* 单价*/ public static final String COL_PRICE = "PRICE"; /* 单价*/
public static final String COL_AMOUNT = "AMOUNT"; /* 金额*/ public static final String COL_AMOUNT = "AMOUNT"; /* 金额*/
public static final String COL_PROJ_CODE = "PROJ_CODE"; /* 项目编码*/ public static final String COL_INVENT_TYPE_DETAIL = "INVENT_TYPE_DETAIL"; /* 存货类型大类*/
public static final String COL_PROJ_NAME = "PROJ_NAME"; /* 项目名称*/ public static final String COL_QUALITY_NO = "QUALITY_NO"; /* 质检单号*/
public static final String QUERY = "HGKC008A.query"; public static final String QUERY = "HGKC008A.query";
public static final String COUNT = "HGKC008A.count"; public static final String COUNT = "HGKC008A.count";
public static final String INSERT = "HGKC008A.insert"; public static final String INSERT = "HGKC008A.insert";
public static final String UPDATE = "HGKC008A.update"; public static final String UPDATE = "HGKC008A.update";
public static final String DELETE = "HGKC008A.delete"; public static final String DELETE = "HGKC008A.delete";
public static final String BATCH_DELETE = "HGKC008A.batchDelete";
private Long id = new Long(0); /* 主键id*/ private Long id = new Long(0); /* 主键id*/
private String accountCode = " "; /* 账套*/ private String accountCode = " "; /* 账套*/
private String depCode = " "; /* 部门编码*/ private String depCode = " "; /* 部门编码*/
...@@ -104,16 +112,21 @@ public class HGKC008A extends DaoEPBase { ...@@ -104,16 +112,21 @@ public class HGKC008A extends DaoEPBase {
private String updatedName = " "; /* 修改人名称*/ private String updatedName = " "; /* 修改人名称*/
private String updatedTime = " "; /* 修改时间*/ private String updatedTime = " "; /* 修改时间*/
private Integer deleteFlag = new Integer(0); /* 是否删除 0-否1-是*/ private Integer deleteFlag = new Integer(0); /* 是否删除 0-否1-是*/
private Integer status = new Integer(0); /* 0.未提交,1-已提交,2.质检中*/
private String applyLineCode = " "; /* 领料单行号*/
private String applyCode = " "; /* 领料单号*/
private Long receiveId = new Long(0); /* 领料单id*/ private Long receiveId = new Long(0); /* 领料单id*/
private String companyCode = " "; /* 公司编码*/ private String companyCode = " "; /* 公司编码*/
private String companyName = " "; /* 公司名称*/ private String companyName = " "; /* 公司名称*/
private String projCode = " "; /* 项目编码*/
private String projName = " "; /* 项目名称*/
private String whCode = " "; /* 仓库编号*/ private String whCode = " "; /* 仓库编号*/
private String whName = " "; /* 仓库名称*/ private String whName = " "; /* 仓库名称*/
private Long inventRecordId = new Long(0); /* 存货档案id*/ private Long inventRecordId = new Long(0); /* 存货档案id*/
private String inventType = " "; /* 存货类型*/ private String inventType = " "; /* 存货类型*/
private String inventCode = " "; /* 存货编码*/ private String inventCode = " "; /* 存货编码*/
private String inventName = " "; /* 存货名称*/ private String inventName = " "; /* 存货名称*/
private Long invSpecId = new Long(0); /* 规格id*/ private Long invSpecId = new Long(0); /* 规格ID*/
private String invSpec = " "; /* 规格*/ private String invSpec = " "; /* 规格*/
private BigDecimal invLength = new BigDecimal(0.000); /* 长度(MM)*/ private BigDecimal invLength = new BigDecimal(0.000); /* 长度(MM)*/
private BigDecimal invWidth = new BigDecimal(0.000); /* 宽度(MM)*/ private BigDecimal invWidth = new BigDecimal(0.000); /* 宽度(MM)*/
...@@ -123,176 +136,193 @@ public class HGKC008A extends DaoEPBase { ...@@ -123,176 +136,193 @@ public class HGKC008A extends DaoEPBase {
private BigDecimal invWeight = new BigDecimal(0.000); /* 重量*/ private BigDecimal invWeight = new BigDecimal(0.000); /* 重量*/
private BigDecimal price = new BigDecimal("0"); /* 单价*/ private BigDecimal price = new BigDecimal("0"); /* 单价*/
private BigDecimal amount = new BigDecimal("0"); /* 金额*/ private BigDecimal amount = new BigDecimal("0"); /* 金额*/
private String projCode = " "; /* 项目编码*/ private Integer inventTypeDetail; /* 存货类型大类*/
private String projName = " "; /* 项目名称*/ private String qualityNo = " "; /* 质检单号*/
private Integer inventTypeDetail; /*存货类型明细 1:构建 2:零件*/
/** /**
* initialize the metadata. * initialize the metadata.
*/ */
public void initMetaData() { public void initMetaData() {
EiColumn eiColumn; EiColumn eiColumn;
eiColumn = new EiColumn(FIELD_ID); eiColumn = new EiColumn(FIELD_ID);
eiColumn.setPrimaryKey(true);
eiColumn.setDescName("主键id"); eiColumn.setDescName("主键id");
eiMetadata.addMeta(eiColumn); eiMetadata.addMeta(eiColumn);
eiColumn = new EiColumn(FIELD_ACCOUNT_CODE); eiColumn = new EiColumn(FIELD_ACCOUNT_CODE);
eiColumn.setDescName("账套"); eiColumn.setDescName("账套");
eiMetadata.addMeta(eiColumn); eiMetadata.addMeta(eiColumn);
eiColumn = new EiColumn(FIELD_DEP_CODE); eiColumn = new EiColumn(FIELD_DEP_CODE);
eiColumn.setDescName("部门编码"); eiColumn.setDescName("部门编码");
eiMetadata.addMeta(eiColumn); eiMetadata.addMeta(eiColumn);
eiColumn = new EiColumn(FIELD_CREATED_BY); eiColumn = new EiColumn(FIELD_CREATED_BY);
eiColumn.setDescName("创建人"); eiColumn.setDescName("创建人");
eiMetadata.addMeta(eiColumn); eiMetadata.addMeta(eiColumn);
eiColumn = new EiColumn(FIELD_CREATED_NAME); eiColumn = new EiColumn(FIELD_CREATED_NAME);
eiColumn.setDescName("创建人名称"); eiColumn.setDescName("创建人名称");
eiMetadata.addMeta(eiColumn); eiMetadata.addMeta(eiColumn);
eiColumn = new EiColumn(FIELD_CREATED_TIME); eiColumn = new EiColumn(FIELD_CREATED_TIME);
eiColumn.setDescName("创建时间"); eiColumn.setDescName("创建时间");
eiMetadata.addMeta(eiColumn); eiMetadata.addMeta(eiColumn);
eiColumn = new EiColumn(FIELD_UPDATED_BY); eiColumn = new EiColumn(FIELD_UPDATED_BY);
eiColumn.setDescName("修改人"); eiColumn.setDescName("修改人");
eiMetadata.addMeta(eiColumn); eiMetadata.addMeta(eiColumn);
eiColumn = new EiColumn(FIELD_UPDATED_NAME); eiColumn = new EiColumn(FIELD_UPDATED_NAME);
eiColumn.setDescName("修改人名称"); eiColumn.setDescName("修改人名称");
eiMetadata.addMeta(eiColumn); eiMetadata.addMeta(eiColumn);
eiColumn = new EiColumn(FIELD_UPDATED_TIME); eiColumn = new EiColumn(FIELD_UPDATED_TIME);
eiColumn.setDescName("修改时间"); eiColumn.setDescName("修改时间");
eiMetadata.addMeta(eiColumn); eiMetadata.addMeta(eiColumn);
eiColumn = new EiColumn(FIELD_DELETE_FLAG); eiColumn = new EiColumn(FIELD_DELETE_FLAG);
eiColumn.setDescName("是否删除 0-否1-是"); eiColumn.setDescName("是否删除 0-否1-是");
eiMetadata.addMeta(eiColumn); eiMetadata.addMeta(eiColumn);
eiColumn = new EiColumn(FIELD_STATUS);
eiColumn.setDescName("0.未提交,1-已提交,2.质检中");
eiMetadata.addMeta(eiColumn);
eiColumn = new EiColumn(FIELD_APPLY_LINE_CODE);
eiColumn.setDescName("领料单行号");
eiMetadata.addMeta(eiColumn);
eiColumn = new EiColumn(FIELD_APPLY_CODE);
eiColumn.setDescName("领料单号");
eiMetadata.addMeta(eiColumn);
eiColumn = new EiColumn(FIELD_RECEIVE_ID); eiColumn = new EiColumn(FIELD_RECEIVE_ID);
eiColumn.setDescName("领料单id"); eiColumn.setDescName("领料单id");
eiMetadata.addMeta(eiColumn); eiMetadata.addMeta(eiColumn);
eiColumn = new EiColumn(FIELD_COMPANY_CODE); eiColumn = new EiColumn(FIELD_COMPANY_CODE);
eiColumn.setDescName("公司编码"); eiColumn.setDescName("公司编码");
eiMetadata.addMeta(eiColumn); eiMetadata.addMeta(eiColumn);
eiColumn = new EiColumn(FIELD_COMPANY_NAME); eiColumn = new EiColumn(FIELD_COMPANY_NAME);
eiColumn.setDescName("公司名称"); eiColumn.setDescName("公司名称");
eiMetadata.addMeta(eiColumn); eiMetadata.addMeta(eiColumn);
eiColumn = new EiColumn(FIELD_PROJ_CODE);
eiColumn.setDescName("项目编码");
eiMetadata.addMeta(eiColumn);
eiColumn = new EiColumn(FIELD_PROJ_NAME);
eiColumn.setDescName("项目名称");
eiMetadata.addMeta(eiColumn);
eiColumn = new EiColumn(FIELD_WH_CODE); eiColumn = new EiColumn(FIELD_WH_CODE);
eiColumn.setDescName("仓库编号"); eiColumn.setDescName("仓库编号");
eiMetadata.addMeta(eiColumn); eiMetadata.addMeta(eiColumn);
eiColumn = new EiColumn(FIELD_WH_NAME); eiColumn = new EiColumn(FIELD_WH_NAME);
eiColumn.setDescName("仓库名称"); eiColumn.setDescName("仓库名称");
eiMetadata.addMeta(eiColumn); eiMetadata.addMeta(eiColumn);
eiColumn = new EiColumn(FIELD_INVENT_RECORD_ID); eiColumn = new EiColumn(FIELD_INVENT_RECORD_ID);
eiColumn.setDescName("存货档案id"); eiColumn.setDescName("存货档案id");
eiMetadata.addMeta(eiColumn); eiMetadata.addMeta(eiColumn);
eiColumn = new EiColumn(FIELD_INVENT_TYPE); eiColumn = new EiColumn(FIELD_INVENT_TYPE);
eiColumn.setDescName("存货类型"); eiColumn.setDescName("存货类型");
eiMetadata.addMeta(eiColumn); eiMetadata.addMeta(eiColumn);
eiColumn = new EiColumn(FIELD_INVENT_CODE); eiColumn = new EiColumn(FIELD_INVENT_CODE);
eiColumn.setDescName("存货编码"); eiColumn.setDescName("存货编码");
eiMetadata.addMeta(eiColumn); eiMetadata.addMeta(eiColumn);
eiColumn = new EiColumn(FIELD_INVENT_NAME); eiColumn = new EiColumn(FIELD_INVENT_NAME);
eiColumn.setDescName("存货名称"); eiColumn.setDescName("存货名称");
eiMetadata.addMeta(eiColumn); eiMetadata.addMeta(eiColumn);
eiColumn = new EiColumn(FIELD_INV_SPEC_ID); eiColumn = new EiColumn(FIELD_INV_SPEC_ID);
eiColumn.setDescName("规格id"); eiColumn.setDescName("规格ID");
eiMetadata.addMeta(eiColumn); eiMetadata.addMeta(eiColumn);
eiColumn = new EiColumn(FIELD_INV_SPEC); eiColumn = new EiColumn(FIELD_INV_SPEC);
eiColumn.setDescName("规格"); eiColumn.setDescName("规格");
eiMetadata.addMeta(eiColumn); eiMetadata.addMeta(eiColumn);
eiColumn = new EiColumn(FIELD_INV_LENGTH); eiColumn = new EiColumn(FIELD_INV_LENGTH);
eiColumn.setType("N"); eiColumn.setType("N");
eiColumn.setScaleLength(3); eiColumn.setScaleLength(3);
eiColumn.setFieldLength(12); eiColumn.setFieldLength(12);
eiColumn.setDescName("长度(MM)"); eiColumn.setDescName("长度(MM)");
eiMetadata.addMeta(eiColumn); eiMetadata.addMeta(eiColumn);
eiColumn = new EiColumn(FIELD_INV_WIDTH); eiColumn = new EiColumn(FIELD_INV_WIDTH);
eiColumn.setType("N"); eiColumn.setType("N");
eiColumn.setScaleLength(3); eiColumn.setScaleLength(3);
eiColumn.setFieldLength(12); eiColumn.setFieldLength(12);
eiColumn.setDescName("宽度(MM)"); eiColumn.setDescName("宽度(MM)");
eiMetadata.addMeta(eiColumn); eiMetadata.addMeta(eiColumn);
eiColumn = new EiColumn(FIELD_INV_THICK); eiColumn = new EiColumn(FIELD_INV_THICK);
eiColumn.setType("N"); eiColumn.setType("N");
eiColumn.setScaleLength(3); eiColumn.setScaleLength(3);
eiColumn.setFieldLength(12); eiColumn.setFieldLength(12);
eiColumn.setDescName("厚度(MM)"); eiColumn.setDescName("厚度(MM)");
eiMetadata.addMeta(eiColumn); eiMetadata.addMeta(eiColumn);
eiColumn = new EiColumn(FIELD_INV_QTY); eiColumn = new EiColumn(FIELD_INV_QTY);
eiColumn.setType("N"); eiColumn.setType("N");
eiColumn.setScaleLength(3); eiColumn.setScaleLength(3);
eiColumn.setFieldLength(20); eiColumn.setFieldLength(20);
eiColumn.setDescName("数量"); eiColumn.setDescName("数量");
eiMetadata.addMeta(eiColumn); eiMetadata.addMeta(eiColumn);
eiColumn = new EiColumn(FIELD_INV_UNIT_WEIGHT); eiColumn = new EiColumn(FIELD_INV_UNIT_WEIGHT);
eiColumn.setType("N"); eiColumn.setType("N");
eiColumn.setScaleLength(3); eiColumn.setScaleLength(3);
eiColumn.setFieldLength(20); eiColumn.setFieldLength(20);
eiColumn.setDescName("单重"); eiColumn.setDescName("单重");
eiMetadata.addMeta(eiColumn); eiMetadata.addMeta(eiColumn);
eiColumn = new EiColumn(FIELD_INV_WEIGHT); eiColumn = new EiColumn(FIELD_INV_WEIGHT);
eiColumn.setType("N"); eiColumn.setType("N");
eiColumn.setScaleLength(3); eiColumn.setScaleLength(3);
eiColumn.setFieldLength(20); eiColumn.setFieldLength(20);
eiColumn.setDescName("重量"); eiColumn.setDescName("重量");
eiMetadata.addMeta(eiColumn); eiMetadata.addMeta(eiColumn);
eiColumn = new EiColumn(FIELD_PRICE); eiColumn = new EiColumn(FIELD_PRICE);
eiColumn.setType("N"); eiColumn.setType("N");
eiColumn.setScaleLength(3); eiColumn.setScaleLength(3);
eiColumn.setFieldLength(12); eiColumn.setFieldLength(12);
eiColumn.setDescName("单价"); eiColumn.setDescName("单价");
eiMetadata.addMeta(eiColumn); eiMetadata.addMeta(eiColumn);
eiColumn = new EiColumn(FIELD_AMOUNT); eiColumn = new EiColumn(FIELD_AMOUNT);
eiColumn.setType("N"); eiColumn.setType("N");
eiColumn.setScaleLength(3); eiColumn.setScaleLength(3);
eiColumn.setFieldLength(12); eiColumn.setFieldLength(12);
eiColumn.setDescName("金额"); eiColumn.setDescName("金额");
eiMetadata.addMeta(eiColumn); eiMetadata.addMeta(eiColumn);
eiColumn = new EiColumn(FIELD_PROJ_CODE);
eiColumn.setDescName("项目编码");
eiMetadata.addMeta(eiColumn);
eiColumn = new EiColumn(FIELD_PROJ_NAME);
eiColumn.setDescName("项目名称");
eiMetadata.addMeta(eiColumn);
eiColumn = new EiColumn(FIELD_INVENT_TYPE_DETAIL); eiColumn = new EiColumn(FIELD_INVENT_TYPE_DETAIL);
eiColumn.setDescName("存货类型明细"); eiColumn.setDescName("存货类型大类");
eiMetadata.addMeta(eiColumn);
eiColumn = new EiColumn(FIELD_QUALITY_NO);
eiColumn.setDescName("质检单号");
eiMetadata.addMeta(eiColumn); eiMetadata.addMeta(eiColumn);
} }
/** /**
* the constructor. * the constructor.
*/ */
public HGKC008A() { public HGKC008A() {
initMetaData(); initMetaData();
} }
/** /**
* get the id - 主键id. * get the id - 主键id.
* @return the id * @return the id
...@@ -300,7 +330,7 @@ public class HGKC008A extends DaoEPBase { ...@@ -300,7 +330,7 @@ public class HGKC008A extends DaoEPBase {
public Long getId() { public Long getId() {
return this.id; return this.id;
} }
/** /**
* set the id - 主键id. * set the id - 主键id.
* *
...@@ -316,7 +346,7 @@ public class HGKC008A extends DaoEPBase { ...@@ -316,7 +346,7 @@ public class HGKC008A extends DaoEPBase {
public String getAccountCode() { public String getAccountCode() {
return this.accountCode; return this.accountCode;
} }
/** /**
* set the accountCode - 账套. * set the accountCode - 账套.
* *
...@@ -332,7 +362,7 @@ public class HGKC008A extends DaoEPBase { ...@@ -332,7 +362,7 @@ public class HGKC008A extends DaoEPBase {
public String getDepCode() { public String getDepCode() {
return this.depCode; return this.depCode;
} }
/** /**
* set the depCode - 部门编码. * set the depCode - 部门编码.
* *
...@@ -348,7 +378,7 @@ public class HGKC008A extends DaoEPBase { ...@@ -348,7 +378,7 @@ public class HGKC008A extends DaoEPBase {
public String getCreatedBy() { public String getCreatedBy() {
return this.createdBy; return this.createdBy;
} }
/** /**
* set the createdBy - 创建人. * set the createdBy - 创建人.
* *
...@@ -364,7 +394,7 @@ public class HGKC008A extends DaoEPBase { ...@@ -364,7 +394,7 @@ public class HGKC008A extends DaoEPBase {
public String getCreatedName() { public String getCreatedName() {
return this.createdName; return this.createdName;
} }
/** /**
* set the createdName - 创建人名称. * set the createdName - 创建人名称.
* *
...@@ -380,7 +410,7 @@ public class HGKC008A extends DaoEPBase { ...@@ -380,7 +410,7 @@ public class HGKC008A extends DaoEPBase {
public String getCreatedTime() { public String getCreatedTime() {
return this.createdTime; return this.createdTime;
} }
/** /**
* set the createdTime - 创建时间. * set the createdTime - 创建时间.
* *
...@@ -396,7 +426,7 @@ public class HGKC008A extends DaoEPBase { ...@@ -396,7 +426,7 @@ public class HGKC008A extends DaoEPBase {
public String getUpdatedBy() { public String getUpdatedBy() {
return this.updatedBy; return this.updatedBy;
} }
/** /**
* set the updatedBy - 修改人. * set the updatedBy - 修改人.
* *
...@@ -412,7 +442,7 @@ public class HGKC008A extends DaoEPBase { ...@@ -412,7 +442,7 @@ public class HGKC008A extends DaoEPBase {
public String getUpdatedName() { public String getUpdatedName() {
return this.updatedName; return this.updatedName;
} }
/** /**
* set the updatedName - 修改人名称. * set the updatedName - 修改人名称.
* *
...@@ -428,7 +458,7 @@ public class HGKC008A extends DaoEPBase { ...@@ -428,7 +458,7 @@ public class HGKC008A extends DaoEPBase {
public String getUpdatedTime() { public String getUpdatedTime() {
return this.updatedTime; return this.updatedTime;
} }
/** /**
* set the updatedTime - 修改时间. * set the updatedTime - 修改时间.
* *
...@@ -444,7 +474,7 @@ public class HGKC008A extends DaoEPBase { ...@@ -444,7 +474,7 @@ public class HGKC008A extends DaoEPBase {
public Integer getDeleteFlag() { public Integer getDeleteFlag() {
return this.deleteFlag; return this.deleteFlag;
} }
/** /**
* set the deleteFlag - 是否删除 0-否1-是. * set the deleteFlag - 是否删除 0-否1-是.
* *
...@@ -454,13 +484,61 @@ public class HGKC008A extends DaoEPBase { ...@@ -454,13 +484,61 @@ public class HGKC008A extends DaoEPBase {
this.deleteFlag = deleteFlag; this.deleteFlag = deleteFlag;
} }
/** /**
* get the status - 0.未提交,1-已提交,2.质检中.
* @return the status
*/
public Integer getStatus() {
return this.status;
}
/**
* set the status - 0.未提交,1-已提交,2.质检中.
*
* @param status - 0.未提交,1-已提交,2.质检中
*/
public void setStatus(Integer status) {
this.status = status;
}
/**
* get the applyLineCode - 领料单行号.
* @return the applyLineCode
*/
public String getApplyLineCode() {
return this.applyLineCode;
}
/**
* set the applyLineCode - 领料单行号.
*
* @param applyLineCode - 领料单行号
*/
public void setApplyLineCode(String applyLineCode) {
this.applyLineCode = applyLineCode;
}
/**
* get the applyCode - 领料单号.
* @return the applyCode
*/
public String getApplyCode() {
return this.applyCode;
}
/**
* set the applyCode - 领料单号.
*
* @param applyCode - 领料单号
*/
public void setApplyCode(String applyCode) {
this.applyCode = applyCode;
}
/**
* get the receiveId - 领料单id. * get the receiveId - 领料单id.
* @return the receiveId * @return the receiveId
*/ */
public Long getReceiveId() { public Long getReceiveId() {
return this.receiveId; return this.receiveId;
} }
/** /**
* set the receiveId - 领料单id. * set the receiveId - 领料单id.
* *
...@@ -476,7 +554,7 @@ public class HGKC008A extends DaoEPBase { ...@@ -476,7 +554,7 @@ public class HGKC008A extends DaoEPBase {
public String getCompanyCode() { public String getCompanyCode() {
return this.companyCode; return this.companyCode;
} }
/** /**
* set the companyCode - 公司编码. * set the companyCode - 公司编码.
* *
...@@ -492,7 +570,7 @@ public class HGKC008A extends DaoEPBase { ...@@ -492,7 +570,7 @@ public class HGKC008A extends DaoEPBase {
public String getCompanyName() { public String getCompanyName() {
return this.companyName; return this.companyName;
} }
/** /**
* set the companyName - 公司名称. * set the companyName - 公司名称.
* *
...@@ -502,13 +580,45 @@ public class HGKC008A extends DaoEPBase { ...@@ -502,13 +580,45 @@ public class HGKC008A extends DaoEPBase {
this.companyName = companyName; this.companyName = companyName;
} }
/** /**
* get the projCode - 项目编码.
* @return the projCode
*/
public String getProjCode() {
return this.projCode;
}
/**
* set the projCode - 项目编码.
*
* @param projCode - 项目编码
*/
public void setProjCode(String projCode) {
this.projCode = projCode;
}
/**
* get the projName - 项目名称.
* @return the projName
*/
public String getProjName() {
return this.projName;
}
/**
* set the projName - 项目名称.
*
* @param projName - 项目名称
*/
public void setProjName(String projName) {
this.projName = projName;
}
/**
* get the whCode - 仓库编号. * get the whCode - 仓库编号.
* @return the whCode * @return the whCode
*/ */
public String getWhCode() { public String getWhCode() {
return this.whCode; return this.whCode;
} }
/** /**
* set the whCode - 仓库编号. * set the whCode - 仓库编号.
* *
...@@ -524,7 +634,7 @@ public class HGKC008A extends DaoEPBase { ...@@ -524,7 +634,7 @@ public class HGKC008A extends DaoEPBase {
public String getWhName() { public String getWhName() {
return this.whName; return this.whName;
} }
/** /**
* set the whName - 仓库名称. * set the whName - 仓库名称.
* *
...@@ -540,7 +650,7 @@ public class HGKC008A extends DaoEPBase { ...@@ -540,7 +650,7 @@ public class HGKC008A extends DaoEPBase {
public Long getInventRecordId() { public Long getInventRecordId() {
return this.inventRecordId; return this.inventRecordId;
} }
/** /**
* set the inventRecordId - 存货档案id. * set the inventRecordId - 存货档案id.
* *
...@@ -556,7 +666,7 @@ public class HGKC008A extends DaoEPBase { ...@@ -556,7 +666,7 @@ public class HGKC008A extends DaoEPBase {
public String getInventType() { public String getInventType() {
return this.inventType; return this.inventType;
} }
/** /**
* set the inventType - 存货类型. * set the inventType - 存货类型.
* *
...@@ -572,7 +682,7 @@ public class HGKC008A extends DaoEPBase { ...@@ -572,7 +682,7 @@ public class HGKC008A extends DaoEPBase {
public String getInventCode() { public String getInventCode() {
return this.inventCode; return this.inventCode;
} }
/** /**
* set the inventCode - 存货编码. * set the inventCode - 存货编码.
* *
...@@ -588,7 +698,7 @@ public class HGKC008A extends DaoEPBase { ...@@ -588,7 +698,7 @@ public class HGKC008A extends DaoEPBase {
public String getInventName() { public String getInventName() {
return this.inventName; return this.inventName;
} }
/** /**
* set the inventName - 存货名称. * set the inventName - 存货名称.
* *
...@@ -598,13 +708,29 @@ public class HGKC008A extends DaoEPBase { ...@@ -598,13 +708,29 @@ public class HGKC008A extends DaoEPBase {
this.inventName = inventName; this.inventName = inventName;
} }
/** /**
* get the invSpecId - 规格ID.
* @return the invSpecId
*/
public Long getInvSpecId() {
return this.invSpecId;
}
/**
* set the invSpecId - 规格ID.
*
* @param invSpecId - 规格ID
*/
public void setInvSpecId(Long invSpecId) {
this.invSpecId = invSpecId;
}
/**
* get the invSpec - 规格. * get the invSpec - 规格.
* @return the invSpec * @return the invSpec
*/ */
public String getInvSpec() { public String getInvSpec() {
return this.invSpec; return this.invSpec;
} }
/** /**
* set the invSpec - 规格. * set the invSpec - 规格.
* *
...@@ -620,7 +746,7 @@ public class HGKC008A extends DaoEPBase { ...@@ -620,7 +746,7 @@ public class HGKC008A extends DaoEPBase {
public BigDecimal getInvLength() { public BigDecimal getInvLength() {
return this.invLength; return this.invLength;
} }
/** /**
* set the invLength - 长度(MM). * set the invLength - 长度(MM).
* *
...@@ -636,7 +762,7 @@ public class HGKC008A extends DaoEPBase { ...@@ -636,7 +762,7 @@ public class HGKC008A extends DaoEPBase {
public BigDecimal getInvWidth() { public BigDecimal getInvWidth() {
return this.invWidth; return this.invWidth;
} }
/** /**
* set the invWidth - 宽度(MM). * set the invWidth - 宽度(MM).
* *
...@@ -652,7 +778,7 @@ public class HGKC008A extends DaoEPBase { ...@@ -652,7 +778,7 @@ public class HGKC008A extends DaoEPBase {
public BigDecimal getInvThick() { public BigDecimal getInvThick() {
return this.invThick; return this.invThick;
} }
/** /**
* set the invThick - 厚度(MM). * set the invThick - 厚度(MM).
* *
...@@ -668,7 +794,7 @@ public class HGKC008A extends DaoEPBase { ...@@ -668,7 +794,7 @@ public class HGKC008A extends DaoEPBase {
public BigDecimal getInvQty() { public BigDecimal getInvQty() {
return this.invQty; return this.invQty;
} }
/** /**
* set the invQty - 数量. * set the invQty - 数量.
* *
...@@ -684,7 +810,7 @@ public class HGKC008A extends DaoEPBase { ...@@ -684,7 +810,7 @@ public class HGKC008A extends DaoEPBase {
public BigDecimal getInvUnitWeight() { public BigDecimal getInvUnitWeight() {
return this.invUnitWeight; return this.invUnitWeight;
} }
/** /**
* set the invUnitWeight - 单重. * set the invUnitWeight - 单重.
* *
...@@ -700,7 +826,7 @@ public class HGKC008A extends DaoEPBase { ...@@ -700,7 +826,7 @@ public class HGKC008A extends DaoEPBase {
public BigDecimal getInvWeight() { public BigDecimal getInvWeight() {
return this.invWeight; return this.invWeight;
} }
/** /**
* set the invWeight - 重量. * set the invWeight - 重量.
* *
...@@ -716,7 +842,7 @@ public class HGKC008A extends DaoEPBase { ...@@ -716,7 +842,7 @@ public class HGKC008A extends DaoEPBase {
public BigDecimal getPrice() { public BigDecimal getPrice() {
return this.price; return this.price;
} }
/** /**
* set the price - 单价. * set the price - 单价.
* *
...@@ -732,7 +858,7 @@ public class HGKC008A extends DaoEPBase { ...@@ -732,7 +858,7 @@ public class HGKC008A extends DaoEPBase {
public BigDecimal getAmount() { public BigDecimal getAmount() {
return this.amount; return this.amount;
} }
/** /**
* set the amount - 金额. * set the amount - 金额.
* *
...@@ -741,39 +867,31 @@ public class HGKC008A extends DaoEPBase { ...@@ -741,39 +867,31 @@ public class HGKC008A extends DaoEPBase {
public void setAmount(BigDecimal amount) { public void setAmount(BigDecimal amount) {
this.amount = amount; this.amount = amount;
} }
/**
public String getProjCode() { * get the inventTypeDetail - 存货类型大类.
return projCode; * @return the inventTypeDetail
} */
public void setProjCode(String projCode) {
this.projCode = projCode;
}
public String getProjName() {
return projName;
}
public void setProjName(String projName) {
this.projName = projName;
}
public Long getInvSpecId() {
return invSpecId;
}
public void setInvSpecId(Long invSpecId) {
this.invSpecId = invSpecId;
}
public Integer getInventTypeDetail() { public Integer getInventTypeDetail() {
return inventTypeDetail; return this.inventTypeDetail;
} }
/**
* set the inventTypeDetail - 存货类型大类.
*
* @param inventTypeDetail - 存货类型大类
*/
public void setInventTypeDetail(Integer inventTypeDetail) { public void setInventTypeDetail(Integer inventTypeDetail) {
this.inventTypeDetail = inventTypeDetail; this.inventTypeDetail = inventTypeDetail;
} }
public String getQualityNo() {
return qualityNo;
}
public void setQualityNo(String qualityNo) {
this.qualityNo = qualityNo;
}
/** /**
* get the value from Map. * get the value from Map.
* *
...@@ -781,7 +899,7 @@ public class HGKC008A extends DaoEPBase { ...@@ -781,7 +899,7 @@ public class HGKC008A extends DaoEPBase {
*/ */
@Override @Override
public void fromMap(Map map) { public void fromMap(Map map) {
setId(NumberUtils.toLong(StringUtils.toString(map.get(FIELD_ID)), id)); setId(NumberUtils.toLong(StringUtils.toString(map.get(FIELD_ID)), id));
setAccountCode(StringUtils.defaultIfEmpty(StringUtils.toString(map.get(FIELD_ACCOUNT_CODE)), accountCode)); setAccountCode(StringUtils.defaultIfEmpty(StringUtils.toString(map.get(FIELD_ACCOUNT_CODE)), accountCode));
setDepCode(StringUtils.defaultIfEmpty(StringUtils.toString(map.get(FIELD_DEP_CODE)), depCode)); setDepCode(StringUtils.defaultIfEmpty(StringUtils.toString(map.get(FIELD_DEP_CODE)), depCode));
...@@ -792,9 +910,14 @@ public class HGKC008A extends DaoEPBase { ...@@ -792,9 +910,14 @@ public class HGKC008A extends DaoEPBase {
setUpdatedName(StringUtils.defaultIfEmpty(StringUtils.toString(map.get(FIELD_UPDATED_NAME)), updatedName)); setUpdatedName(StringUtils.defaultIfEmpty(StringUtils.toString(map.get(FIELD_UPDATED_NAME)), updatedName));
setUpdatedTime(StringUtils.defaultIfEmpty(StringUtils.toString(map.get(FIELD_UPDATED_TIME)), updatedTime)); setUpdatedTime(StringUtils.defaultIfEmpty(StringUtils.toString(map.get(FIELD_UPDATED_TIME)), updatedTime));
setDeleteFlag(NumberUtils.toInteger(StringUtils.toString(map.get(FIELD_DELETE_FLAG)), deleteFlag)); setDeleteFlag(NumberUtils.toInteger(StringUtils.toString(map.get(FIELD_DELETE_FLAG)), deleteFlag));
setStatus(NumberUtils.toInteger(StringUtils.toString(map.get(FIELD_STATUS)), status));
setApplyLineCode(StringUtils.defaultIfEmpty(StringUtils.toString(map.get(FIELD_APPLY_LINE_CODE)), applyLineCode));
setApplyCode(StringUtils.defaultIfEmpty(StringUtils.toString(map.get(FIELD_APPLY_CODE)), applyCode));
setReceiveId(NumberUtils.toLong(StringUtils.toString(map.get(FIELD_RECEIVE_ID)), receiveId)); setReceiveId(NumberUtils.toLong(StringUtils.toString(map.get(FIELD_RECEIVE_ID)), receiveId));
setCompanyCode(StringUtils.defaultIfEmpty(StringUtils.toString(map.get(FIELD_COMPANY_CODE)), companyCode)); setCompanyCode(StringUtils.defaultIfEmpty(StringUtils.toString(map.get(FIELD_COMPANY_CODE)), companyCode));
setCompanyName(StringUtils.defaultIfEmpty(StringUtils.toString(map.get(FIELD_COMPANY_NAME)), companyName)); setCompanyName(StringUtils.defaultIfEmpty(StringUtils.toString(map.get(FIELD_COMPANY_NAME)), companyName));
setProjCode(StringUtils.defaultIfEmpty(StringUtils.toString(map.get(FIELD_PROJ_CODE)), projCode));
setProjName(StringUtils.defaultIfEmpty(StringUtils.toString(map.get(FIELD_PROJ_NAME)), projName));
setWhCode(StringUtils.defaultIfEmpty(StringUtils.toString(map.get(FIELD_WH_CODE)), whCode)); setWhCode(StringUtils.defaultIfEmpty(StringUtils.toString(map.get(FIELD_WH_CODE)), whCode));
setWhName(StringUtils.defaultIfEmpty(StringUtils.toString(map.get(FIELD_WH_NAME)), whName)); setWhName(StringUtils.defaultIfEmpty(StringUtils.toString(map.get(FIELD_WH_NAME)), whName));
setInventRecordId(NumberUtils.toLong(StringUtils.toString(map.get(FIELD_INVENT_RECORD_ID)), inventRecordId)); setInventRecordId(NumberUtils.toLong(StringUtils.toString(map.get(FIELD_INVENT_RECORD_ID)), inventRecordId));
...@@ -811,17 +934,16 @@ public class HGKC008A extends DaoEPBase { ...@@ -811,17 +934,16 @@ public class HGKC008A extends DaoEPBase {
setInvWeight(NumberUtils.toBigDecimal(StringUtils.toString(map.get(FIELD_INV_WEIGHT)), invWeight)); setInvWeight(NumberUtils.toBigDecimal(StringUtils.toString(map.get(FIELD_INV_WEIGHT)), invWeight));
setPrice(NumberUtils.toBigDecimal(StringUtils.toString(map.get(FIELD_PRICE)), price)); setPrice(NumberUtils.toBigDecimal(StringUtils.toString(map.get(FIELD_PRICE)), price));
setAmount(NumberUtils.toBigDecimal(StringUtils.toString(map.get(FIELD_AMOUNT)), amount)); setAmount(NumberUtils.toBigDecimal(StringUtils.toString(map.get(FIELD_AMOUNT)), amount));
setProjCode(StringUtils.defaultIfEmpty(StringUtils.toString(map.get(FIELD_PROJ_CODE)), projCode));
setProjName(StringUtils.defaultIfEmpty(StringUtils.toString(map.get(FIELD_PROJ_NAME)), projName));
setInventTypeDetail(NumberUtils.toInteger(StringUtils.toString(map.get(FIELD_INVENT_TYPE_DETAIL)), inventTypeDetail)); setInventTypeDetail(NumberUtils.toInteger(StringUtils.toString(map.get(FIELD_INVENT_TYPE_DETAIL)), inventTypeDetail));
setQualityNo(StringUtils.defaultIfEmpty(StringUtils.toString(map.get(FIELD_QUALITY_NO)), qualityNo));
} }
/** /**
* set the value to Map. * set the value to Map.
*/ */
@Override @Override
public Map toMap() { public Map toMap() {
Map map = new HashMap(); Map map = new HashMap();
map.put(FIELD_ID, StringUtils.toString(id, eiMetadata.getMeta(FIELD_ID))); 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_ACCOUNT_CODE, StringUtils.toString(accountCode, eiMetadata.getMeta(FIELD_ACCOUNT_CODE)));
...@@ -833,9 +955,14 @@ public class HGKC008A extends DaoEPBase { ...@@ -833,9 +955,14 @@ public class HGKC008A extends DaoEPBase {
map.put(FIELD_UPDATED_NAME, StringUtils.toString(updatedName, eiMetadata.getMeta(FIELD_UPDATED_NAME))); 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_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_DELETE_FLAG, StringUtils.toString(deleteFlag, eiMetadata.getMeta(FIELD_DELETE_FLAG)));
map.put(FIELD_STATUS, StringUtils.toString(status, eiMetadata.getMeta(FIELD_STATUS)));
map.put(FIELD_APPLY_LINE_CODE, StringUtils.toString(applyLineCode, eiMetadata.getMeta(FIELD_APPLY_LINE_CODE)));
map.put(FIELD_APPLY_CODE, StringUtils.toString(applyCode, eiMetadata.getMeta(FIELD_APPLY_CODE)));
map.put(FIELD_RECEIVE_ID, StringUtils.toString(receiveId, eiMetadata.getMeta(FIELD_RECEIVE_ID))); map.put(FIELD_RECEIVE_ID, StringUtils.toString(receiveId, eiMetadata.getMeta(FIELD_RECEIVE_ID)));
map.put(FIELD_COMPANY_CODE, StringUtils.toString(companyCode, eiMetadata.getMeta(FIELD_COMPANY_CODE))); 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_COMPANY_NAME, StringUtils.toString(companyName, eiMetadata.getMeta(FIELD_COMPANY_NAME)));
map.put(FIELD_PROJ_CODE, StringUtils.toString(projCode, eiMetadata.getMeta(FIELD_PROJ_CODE)));
map.put(FIELD_PROJ_NAME, StringUtils.toString(projName, eiMetadata.getMeta(FIELD_PROJ_NAME)));
map.put(FIELD_WH_CODE, StringUtils.toString(whCode, eiMetadata.getMeta(FIELD_WH_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_WH_NAME, StringUtils.toString(whName, eiMetadata.getMeta(FIELD_WH_NAME)));
map.put(FIELD_INVENT_RECORD_ID, StringUtils.toString(inventRecordId, eiMetadata.getMeta(FIELD_INVENT_RECORD_ID))); map.put(FIELD_INVENT_RECORD_ID, StringUtils.toString(inventRecordId, eiMetadata.getMeta(FIELD_INVENT_RECORD_ID)));
...@@ -852,10 +979,9 @@ public class HGKC008A extends DaoEPBase { ...@@ -852,10 +979,9 @@ public class HGKC008A extends DaoEPBase {
map.put(FIELD_INV_WEIGHT, StringUtils.toString(invWeight, eiMetadata.getMeta(FIELD_INV_WEIGHT))); map.put(FIELD_INV_WEIGHT, StringUtils.toString(invWeight, eiMetadata.getMeta(FIELD_INV_WEIGHT)));
map.put(FIELD_PRICE, StringUtils.toString(price, eiMetadata.getMeta(FIELD_PRICE))); map.put(FIELD_PRICE, StringUtils.toString(price, eiMetadata.getMeta(FIELD_PRICE)));
map.put(FIELD_AMOUNT, StringUtils.toString(amount, eiMetadata.getMeta(FIELD_AMOUNT))); map.put(FIELD_AMOUNT, StringUtils.toString(amount, eiMetadata.getMeta(FIELD_AMOUNT)));
map.put(FIELD_PROJ_CODE, StringUtils.toString(projCode, eiMetadata.getMeta(FIELD_PROJ_CODE))); map.put(FIELD_INVENT_TYPE_DETAIL, StringUtils.toString(inventTypeDetail, eiMetadata.getMeta(FIELD_INVENT_TYPE_DETAIL)));
map.put(FIELD_PROJ_NAME, StringUtils.toString(projName, eiMetadata.getMeta(FIELD_PROJ_NAME))); map.put(FIELD_QUALITY_NO, StringUtils.toString(qualityNo, eiMetadata.getMeta(FIELD_QUALITY_NO)));
map.put(FIELD_INVENT_TYPE_DETAIL,StringUtils.toString(inventTypeDetail, eiMetadata.getMeta(FIELD_INVENT_TYPE_DETAIL)));
return map; return map;
} }
} }
...@@ -6,6 +6,7 @@ import com.baosight.hggp.core.dao.DaoUtils; ...@@ -6,6 +6,7 @@ import com.baosight.hggp.core.dao.DaoUtils;
import com.baosight.hggp.core.security.UserSessionUtils; import com.baosight.hggp.core.security.UserSessionUtils;
import com.baosight.hggp.hg.constant.HGConstant; import com.baosight.hggp.hg.constant.HGConstant;
import com.baosight.hggp.hg.cw.tools.HGCWTools; import com.baosight.hggp.hg.cw.tools.HGCWTools;
import com.baosight.hggp.hg.kc.constant.HgKcConst;
import com.baosight.hggp.hg.kc.domain.HGKC008; import com.baosight.hggp.hg.kc.domain.HGKC008;
import com.baosight.hggp.hg.kc.domain.HGKC008A; import com.baosight.hggp.hg.kc.domain.HGKC008A;
import com.baosight.hggp.hg.kc.tools.HGKCTools; import com.baosight.hggp.hg.kc.tools.HGKCTools;
...@@ -117,7 +118,7 @@ public class ServiceHGKC008 extends ServiceBase { ...@@ -117,7 +118,7 @@ public class ServiceHGKC008 extends ServiceBase {
HGKCTools.HgKc008A.updateWhCodeByReceiveId(fKc008); HGKCTools.HgKc008A.updateWhCodeByReceiveId(fKc008);
} else { } else {
//生成生产领料编号 //生成生产领料编号
fKc008.setApplyCode(SequenceGenerator.getNextSequence(HGConstant.SequenceId.RECEIVE_CODE)); fKc008.setApplyCode(SequenceGenerator.getNextSequence(HGConstant.SequenceId.SC_APPLY_CODE));
fKc008.setStatus(HGConstant.ProductStatus.WTJ); fKc008.setStatus(HGConstant.ProductStatus.WTJ);
DaoUtils.insert(HGKC008.INSERT, fKc008); DaoUtils.insert(HGKC008.INSERT, fKc008);
} }
...@@ -196,16 +197,17 @@ public class ServiceHGKC008 extends ServiceBase { ...@@ -196,16 +197,17 @@ public class ServiceHGKC008 extends ServiceBase {
} }
List<HGKC008A> hgkc008AList = HGKCTools.HgKc008A.getHgkc008aList(hgkc008.getId()); List<HGKC008A> hgkc008AList = HGKCTools.HgKc008A.getHgkc008aList(hgkc008.getId());
if(!CollectionUtils.isEmpty(hgkc008AList)){ if(!CollectionUtils.isEmpty(hgkc008AList)){
for(HGKC008A hgkc008A : hgkc008AList){ for (HGKC008A hgkc008A : hgkc008AList) {
//领料如果是正数则为出库,需要减少库存,如果是退回则要加库存 // 更新明细状态
BigDecimal qty = hgkc008A.getInvQty().multiply(new BigDecimal(-1)); HGKCTools.HgKc008A.updateStatus(hgkc008A.getApplyLineCode(), HgKcConst.HgKc008.Status.S1);
BigDecimal invUnitWeight = hgkc008A.getInvUnitWeight().multiply(new BigDecimal(-1)); //领料如果是正数则为出库,需要减少库存,如果是退回则要加库存
BigDecimal invWeight = hgkc008A.getInvWeight().multiply(new BigDecimal(-1)); BigDecimal qty = hgkc008A.getInvQty().multiply(new BigDecimal(-1));
//增加库存 BigDecimal invUnitWeight = hgkc008A.getInvUnitWeight().multiply(new BigDecimal(-1));
HGKCUtils.HgKc010.updateInv(hgkc008A.getCompanyCode(),hgkc008A.getWhCode(), BigDecimal invWeight = hgkc008A.getInvWeight().multiply(new BigDecimal(-1));
hgkc008A.getInventCode(),qty, //增加库存
invUnitWeight,invWeight); HGKCUtils.HgKc010.updateInv(hgkc008A.getCompanyCode(), hgkc008A.getWhCode(),
} hgkc008A.getInventCode(), qty, invUnitWeight, invWeight);
}
} }
inInfo.setStatus(EiConstant.STATUS_SUCCESS); inInfo.setStatus(EiConstant.STATUS_SUCCESS);
inInfo.setMsgByKey("ep.1000", new String[]{String.valueOf(i), I18nMessages.getText("label.update", "修改")}); inInfo.setMsgByKey("ep.1000", new String[]{String.valueOf(i), I18nMessages.getText("label.update", "修改")});
......
package com.baosight.hggp.hg.kc.service; package com.baosight.hggp.hg.kc.service;
import com.baosight.hggp.common.DdynamicEnum; import com.baosight.hggp.common.DdynamicEnum;
import com.baosight.hggp.common.InventTypeDetailEnum; import com.baosight.hggp.core.constant.CommonConstant;
import com.baosight.hggp.core.dao.DaoUtils; import com.baosight.hggp.core.dao.DaoUtils;
import com.baosight.hggp.core.security.UserSessionUtils; import com.baosight.hggp.core.security.UserSessionUtils;
import com.baosight.hggp.hg.constant.HGConstant; import com.baosight.hggp.hg.constant.HGConstant;
import com.baosight.hggp.hg.kc.constant.HgKcConst;
import com.baosight.hggp.hg.kc.constant.HgKcSqlConst;
import com.baosight.hggp.hg.kc.domain.HGKC008; import com.baosight.hggp.hg.kc.domain.HGKC008;
import com.baosight.hggp.hg.kc.domain.HGKC008A; import com.baosight.hggp.hg.kc.domain.HGKC008A;
import com.baosight.hggp.hg.kc.tools.HGKCTools; import com.baosight.hggp.hg.kc.tools.HGKCTools;
import com.baosight.hggp.hg.pz.domain.HGPZ004; import com.baosight.hggp.hg.kc.utils.HGKCUtils;
import com.baosight.hggp.util.*; import com.baosight.hggp.util.AssertUtils;
import com.baosight.hggp.util.CommonMethod;
import com.baosight.hggp.util.EiInfoUtils;
import com.baosight.hggp.util.LogUtils;
import com.baosight.hggp.util.MapUtils;
import com.baosight.hggp.util.contants.ACConstants; import com.baosight.hggp.util.contants.ACConstants;
import com.baosight.iplat4j.core.ei.EiConstant; import com.baosight.iplat4j.core.ei.EiConstant;
import com.baosight.iplat4j.core.ei.EiInfo; import com.baosight.iplat4j.core.ei.EiInfo;
...@@ -17,8 +23,12 @@ import com.baosight.iplat4j.core.exception.PlatException; ...@@ -17,8 +23,12 @@ import com.baosight.iplat4j.core.exception.PlatException;
import com.baosight.iplat4j.core.service.impl.ServiceBase; import com.baosight.iplat4j.core.service.impl.ServiceBase;
import java.math.BigDecimal; import java.math.BigDecimal;
import java.util.*; import java.util.Arrays;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
import java.util.Objects;
import java.util.stream.Collectors;
/** /**
* @Author jhs * @Author jhs
...@@ -28,68 +38,95 @@ public class ServiceHGKC008A extends ServiceBase { ...@@ -28,68 +38,95 @@ public class ServiceHGKC008A extends ServiceBase {
public EiInfo initLoad(EiInfo inInfo) { public EiInfo initLoad(EiInfo inInfo) {
try { try {
inInfo = super.query(inInfo, HGKC008A.QUERY, new HGKC008A()); inInfo = super.query(inInfo, HGKC008A.QUERY, new HGKC008A());
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()); // 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,false Arrays.asList(DdynamicEnum.INVENT_TYPE_BOX_BLOCK_ID, DdynamicEnum.INVENT_CODE_BOX_BLOCK_ID), map,
); false
);
} catch (PlatException e) { } catch (PlatException e) {
LogUtils.setDetailMsg(inInfo, e, "初始化失败"); LogUtils.setDetailMsg(inInfo, e, "初始化失败");
}
return inInfo;
}
public EiInfo query(EiInfo inInfo) {
try {
inInfo = super.query(inInfo, HGKC008A.QUERY, new HGKC008A());
inInfo.setStatus(EiConstant.STATUS_DEFAULT);
} catch (PlatException e) {
LogUtils.setDetailMsg(inInfo, e, "查询失败");
}
return inInfo;
}
@Override
public EiInfo delete(EiInfo inInfo) {
try {
List<Map> resultRows = inInfo.getBlock(EiConstant.resultBlock).getRows();
// 明细ids
List<Long> ids = ObjectUtils.listKey(resultRows, HGKC008A.FIELD_ID);
DaoUtils.update(HGKC008A.BATCH_DELETE, new HashMap<String,Object>(){{put("ids",ids);}});
String receiveId = inInfo.getCellStr(EiConstant.queryBlock, ACConstants.ROW_CODE_0, HGKC008A.FIELD_RECEIVE_ID);
//查看明细是否都删除了,都删除了得修改主表信息
HGKCTools.HgKc008A.checkMainData(ids, Long.valueOf(receiveId));
inInfo = this.query(inInfo);
inInfo.setStatus(EiConstant.STATUS_DEFAULT);
inInfo.setMsg("操作成功!本次对[" + resultRows.size() + "]条数据删除成功!");
} catch (Exception e) {
LogUtils.setDetailMsg(inInfo, e, "删除失败");
} }
return inInfo; return inInfo;
} }
public EiInfo query(EiInfo inInfo) {
try {
inInfo = super.query(inInfo, HGKC008A.QUERY, new HGKC008A());
inInfo.setStatus(EiConstant.STATUS_DEFAULT);
} catch (PlatException e) {
LogUtils.setDetailMsg(inInfo, e, "查询失败");
}
return inInfo;
}
/**
* 删除
*
* @param inInfo
* @return
*/
@Override
public EiInfo delete(EiInfo inInfo) {
try {
Map queryMap = EiInfoUtils.getFirstRow(inInfo);
String applyCode = MapUtils.getString(queryMap, HGKC008A.FIELD_RECEIVE_ID);
List<HGKC008A> fKc008As = MapUtils.toDaoEPBases(inInfo, HGKC008A.class);
Map<String, HGKC008A> dbKc008AMap = HGKCUtils.HgKc008A.lockGetDataEp(fKc008As);
// 数据校验
this.checkDeleteData(fKc008As, dbKc008AMap);
// 批量删除
Map paramMap = new HashMap();
paramMap.put("applyLineCodes", dbKc008AMap.keySet().stream().collect(Collectors.toList()));
DaoUtils.update(HgKcSqlConst.HgKc008A.BATCH_DELETE, paramMap);
//查看明细是否都删除了,都删除了得修改主表信息
HGKCTools.HgKc008.checkMainData(applyCode);
inInfo = this.query(inInfo);
inInfo.setStatus(EiConstant.STATUS_DEFAULT);
inInfo.setMsg("操作成功!本次对[" + fKc008As.size() + "]条数据删除成功!");
} catch (Exception e) {
LogUtils.setDetailMsg(inInfo, e, "删除失败");
}
return inInfo;
}
/**
* 删除数据校验
*
* @param fKc008As
* @param dbKc008AMap
*/
private void checkDeleteData(List<HGKC008A> fKc008As, Map<String, HGKC008A> dbKc008AMap) {
for (HGKC008A fKc008A : fKc008As) {
String applyLineCode = fKc008A.getApplyLineCode();
HGKC008A dbKc008A = dbKc008AMap.get(applyLineCode);
this.checkData(applyLineCode, dbKc008A);
}
}
/** /**
* @param inInfo * @param inInfo
* @return * @return
*/ */
public EiInfo save(EiInfo inInfo) { public EiInfo save(EiInfo inInfo) {
try { try {
HGKC008A fKc008a = MapUtils.toDaoEPBase(inInfo, HGKC008A.class); // 查询领料单
//查询领料单 Map queryMap = EiInfoUtils.getFirstRow(inInfo);
HGKC008 dbKc008 = HGKCTools.HgKc008.getById(fKc008a.getReceiveId()); String applyCode = MapUtils.getString(queryMap, HGKC008A.FIELD_RECEIVE_ID);
this.checkSaveData(fKc008a, dbKc008); HGKC008 dbKc008 = HGKCTools.HgKc008.getByApplyCode(applyCode);
this.setData(fKc008a, dbKc008); AssertUtils.isNull(dbKc008, String.format("领料单【%s】不存在", applyCode));
if (Objects.nonNull(fKc008a.getId()) && fKc008a.getId() != 0) { AssertUtils.isNotEquals(HgKcConst.HgKc008.Status.S0, dbKc008.getStatus(),
DaoUtils.update(HGKC008A.UPDATE, fKc008a); String.format("领料单【%s】不是\"未提交\"状态,不允许操作", applyCode));
} else { // 明细数据
DaoUtils.insert(HGKC008A.INSERT, fKc008a); List<HGKC008A> fKc008As = MapUtils.toDaoEPBases(inInfo, HGKC008A.class);
} Map<String, HGKC008A> dbKc008AMap = HGKCUtils.HgKc008A.lockGetDataEp(fKc008As);
// 数据校验
this.checkSaveData(dbKc008, fKc008As, dbKc008AMap);
this.setData(dbKc008, fKc008As);
inInfo.setStatus(EiConstant.STATUS_DEFAULT); inInfo.setStatus(EiConstant.STATUS_DEFAULT);
inInfo.setMsg("保存成功!"); inInfo.setMsg("保存成功!");
} catch (Exception e) { } catch (Exception e) {
...@@ -101,25 +138,30 @@ public class ServiceHGKC008A extends ServiceBase { ...@@ -101,25 +138,30 @@ public class ServiceHGKC008A extends ServiceBase {
/** /**
* 给明细赋值 * 给明细赋值
* *
* @param hgkc008a * @param dbKc008
* @param hgkc008 * @param fKc008As
*/ */
private void setData(HGKC008A hgkc008a, HGKC008 hgkc008) { private void setData(HGKC008 dbKc008, List<HGKC008A> fKc008As) {
if (Objects.nonNull(hgkc008)) { for (HGKC008A fKc008A : fKc008As) {
hgkc008a.setProjCode(hgkc008.getProjCode()); fKc008A.setProjCode(dbKc008.getProjCode());
hgkc008a.setProjName(hgkc008.getProjName()); fKc008A.setProjName(dbKc008.getProjName());
hgkc008a.setWhCode(hgkc008.getWhCode()); fKc008A.setWhCode(dbKc008.getWhCode());
hgkc008a.setWhName(hgkc008.getWhName()); fKc008A.setWhName(dbKc008.getWhName());
hgkc008a.setCompanyCode(hgkc008.getCompanyCode()); fKc008A.setCompanyCode(dbKc008.getCompanyCode());
hgkc008a.setCompanyName(hgkc008.getCompanyName()); fKc008A.setCompanyName(dbKc008.getCompanyName());
if (hgkc008.getReceiveType().compareTo(HGConstant.ReceiveType.DEFAULT) == 0) { if (Objects.nonNull(fKc008A.getId()) && fKc008A.getId() != 0) {
DaoUtils.update(HGKC008A.UPDATE, fKc008A);
} else {
DaoUtils.insert(HGKC008A.INSERT, fKc008A);
}
if (dbKc008.getReceiveType().compareTo(HGConstant.ReceiveType.DEFAULT) == 0) {
//如果明细里面有负数的,主表就是退库 //如果明细里面有负数的,主表就是退库
if (hgkc008a.getInvQty().compareTo(BigDecimal.ZERO) < 0) { if (fKc008A.getInvQty().compareTo(BigDecimal.ZERO) < 0) {
hgkc008.setReceiveType(HGConstant.ReceiveType.TK); dbKc008.setReceiveType(HGConstant.ReceiveType.TK);
} else { } else {
hgkc008.setReceiveType(HGConstant.ReceiveType.ZC); dbKc008.setReceiveType(HGConstant.ReceiveType.ZC);
} }
DaoUtils.update(HGKC008.UPDATE_RECEIVE_TYPE, hgkc008); DaoUtils.update(HgKcSqlConst.HgKc008.UPDATE_RECEIVE_TYPE, dbKc008.toMap());
} }
} }
} }
...@@ -127,23 +169,40 @@ public class ServiceHGKC008A extends ServiceBase { ...@@ -127,23 +169,40 @@ public class ServiceHGKC008A extends ServiceBase {
/** /**
* 校验保存的数据 * 校验保存的数据
* *
* @param fKc008a
* @param dbKc008 * @param dbKc008
* @param fKc008As
* @param dbKc008AMap
*/ */
private void checkSaveData(HGKC008A fKc008a, HGKC008 dbKc008) { private void checkSaveData(HGKC008 dbKc008, List<HGKC008A> fKc008As, Map<String, HGKC008A> dbKc008AMap) {
AssertUtils.isEmpty(UserSessionUtils.getAccountCode(), "当前用户未绑定公司,无法操作数据,请联系管理员!"); for (HGKC008A fKc008A : fKc008As) {
AssertUtils.isEmpty(UserSessionUtils.getOrgId(), "当前用户未绑定部门,无法操作数据,请联系管理员!"); String applyLineCode = fKc008A.getApplyLineCode();
AssertUtils.isNull(fKc008a.getReceiveId(), "未获取到生产领料单ID信息"); HGKC008A dbKc008A = dbKc008AMap.get(applyLineCode);
AssertUtils.isTrue(fKc008a.getInvWeight().compareTo(BigDecimal.ZERO) == 0, "重量不能为0"); this.checkData(applyLineCode, dbKc008A);
if (Objects.nonNull(fKc008a.getId()) && fKc008a.getId() != 0) { AssertUtils.isGe(BigDecimal.ZERO, fKc008A.getInvWeight(), "重量必须大于0");
if (dbKc008.getReceiveType().compareTo(HGConstant.ReceiveType.ZC) == 0) { if (Objects.nonNull(fKc008A.getId()) && fKc008A.getId() != 0) {
AssertUtils.isTrue(fKc008a.getInvQty().compareTo(BigDecimal.ZERO) < 0, "此生产领料单为正常类型,数量不能小于0"); if (dbKc008.getReceiveType().compareTo(HGConstant.ReceiveType.ZC) == 0) {
} AssertUtils.isTrue(fKc008A.getInvQty().compareTo(BigDecimal.ZERO) < 0, "此生产领料单为正常类型,数量不能小于0");
if (dbKc008.getReceiveType().compareTo(HGConstant.ReceiveType.TK) == 0) { }
AssertUtils.isTrue(fKc008a.getInvQty().compareTo(BigDecimal.ZERO) > 0, "此生产领料单为退库类型,数量不能大于0"); if (dbKc008.getReceiveType().compareTo(HGConstant.ReceiveType.TK) == 0) {
AssertUtils.isTrue(fKc008A.getInvQty().compareTo(BigDecimal.ZERO) > 0, "此生产领料单为退库类型,数量不能大于0");
}
} }
} }
}
/**
* 数据校验
*
* @param applyLineCode
* @param dbKc008A
*/
private void checkData(String applyLineCode, HGKC008A dbKc008A) {
AssertUtils.isNull(dbKc008A, String.format("领料单行【%s】不存在", applyLineCode));
AssertUtils.isNotEquals(CommonConstant.YesNo.NO_0, dbKc008A.getDeleteFlag(),
String.format("领料单行【%s】不是\"未删除\"状态,不允许操作", applyLineCode));
AssertUtils.isNotEquals(HgKcConst.HgKc008.Status.S0, dbKc008A.getStatus(),
String.format("领料单行【%s】不是\"未提交\"状态,不允许操作", applyLineCode));
} }
} }
...@@ -24,6 +24,7 @@ import com.baosight.hggp.util.contants.ACConstants; ...@@ -24,6 +24,7 @@ import com.baosight.hggp.util.contants.ACConstants;
import com.baosight.iplat4j.core.ei.EiConstant; import com.baosight.iplat4j.core.ei.EiConstant;
import com.baosight.iplat4j.core.ei.EiInfo; import com.baosight.iplat4j.core.ei.EiInfo;
import com.baosight.iplat4j.core.service.impl.ServiceBase; import com.baosight.iplat4j.core.service.impl.ServiceBase;
import com.baosight.iplat4j.ed.util.SequenceGenerator;
import java.math.BigDecimal; import java.math.BigDecimal;
import java.util.Arrays; import java.util.Arrays;
...@@ -123,6 +124,9 @@ public class ServiceHGKC008B extends ServiceBase { ...@@ -123,6 +124,9 @@ public class ServiceHGKC008B extends ServiceBase {
Long id = fKc010B.getId(); Long id = fKc010B.getId();
HGKC010 dbKc010 = dbKc010Map.get(id); HGKC010 dbKc010 = dbKc010Map.get(id);
HGKC008A newKc008A = BeanUtils.copy(dbKc010, HGKC008A.class); HGKC008A newKc008A = BeanUtils.copy(dbKc010, HGKC008A.class);
newKc008A.setApplyCode(dbKc008.getApplyCode());
newKc008A.setApplyLineCode(SequenceGenerator.getNextSequence(HGConstant.SequenceId.SC_APPLY_LINE_CODE,
new String[]{dbKc008.getApplyCode()}));
newKc008A.setProjCode(dbKc008.getProjCode()); newKc008A.setProjCode(dbKc008.getProjCode());
newKc008A.setProjName(dbKc008.getProjName()); newKc008A.setProjName(dbKc008.getProjName());
newKc008A.setCompanyCode(dbKc008.getCompanyCode()); newKc008A.setCompanyCode(dbKc008.getCompanyCode());
......
...@@ -28,10 +28,8 @@ ...@@ -28,10 +28,8 @@
</sql> </sql>
<sql id="condition"> <sql id="condition">
<include refid="idCondition"/>
<include refid="HGXSDataAuth.authCondition"/> <include refid="HGXSDataAuth.authCondition"/>
<isNotEmpty prepend=" AND " property="id">
ID = #id#
</isNotEmpty>
<isNotEmpty prepend=" AND " property="accountCode"> <isNotEmpty prepend=" AND " property="accountCode">
ACCOUNT_CODE = #accountCode# ACCOUNT_CODE = #accountCode#
</isNotEmpty> </isNotEmpty>
...@@ -68,9 +66,6 @@ ...@@ -68,9 +66,6 @@
<isNotEmpty prepend=" AND " property="receiptDate"> <isNotEmpty prepend=" AND " property="receiptDate">
date_format(RECEIPT_DATE,'%Y-%m-%d') = #receiptDate# date_format(RECEIPT_DATE,'%Y-%m-%d') = #receiptDate#
</isNotEmpty> </isNotEmpty>
<isNotEmpty prepend=" AND " property="applyCode">
APPLY_CODE like CONCAT('%',#applyCode#,'%')
</isNotEmpty>
<isNotEmpty prepend=" AND " property="whCode"> <isNotEmpty prepend=" AND " property="whCode">
WH_CODE = #whCode# WH_CODE = #whCode#
</isNotEmpty> </isNotEmpty>
...@@ -101,6 +96,21 @@ ...@@ -101,6 +96,21 @@
</isNotEmpty> </isNotEmpty>
</sql> </sql>
<sql id="idCondition">
<isNotEmpty prepend=" AND " property="id">
ID = #id#
</isNotEmpty>
<isNotEmpty prepend=" AND " property="ids">
ID IN <iterate close=")" open="(" conjunction="," property="ids">#ids[]#</iterate>
</isNotEmpty>
<isNotEmpty prepend=" AND " property="applyCode">
APPLY_CODE = #applyCode#
</isNotEmpty>
<isNotEmpty prepend=" AND " property="applyCodes">
APPLY_CODE IN <iterate close=")" open="(" conjunction="," property="applyCodes">#applyCodes[]#</iterate>
</isNotEmpty>
</sql>
<sql id="orderBy"> <sql id="orderBy">
<dynamic prepend="ORDER BY"> <dynamic prepend="ORDER BY">
<isNotEmpty property="orderBy"> <isNotEmpty property="orderBy">
...@@ -180,21 +190,9 @@ ...@@ -180,21 +190,9 @@
<delete id="batchDelete"> <delete id="batchDelete">
DELETE FROM ${hggpSchema}.HGKC008 WHERE DELETE FROM ${hggpSchema}.HGKC008 WHERE
id IN id IN <iterate close=")" open="(" conjunction="," property="ids">#ids[]#</iterate>
<iterate close=")" open="(" conjunction="," property="ids">#ids[]#</iterate>
</delete> </delete>
<update id="updateStatus">
UPDATE ${hggpSchema}.HGKC008
SET
UPDATED_BY = #updatedBy#, <!-- 更新人 -->
UPDATED_NAME = #updatedName#, <!-- 更新人名称 -->
UPDATED_TIME = #updatedTime#, <!-- 更新时间 -->
STATUS = #status# <!-- 状态 0未提交,1已提交 -->
WHERE
ID = #id#
</update>
<update id="updateReceiveType"> <update id="updateReceiveType">
UPDATE ${hggpSchema}.HGKC008 UPDATE ${hggpSchema}.HGKC008
SET SET
...@@ -257,4 +255,22 @@ ...@@ -257,4 +255,22 @@
</dynamic> </dynamic>
</select> </select>
<!-- 行锁 -->
<update id="lock">
UPDATE ${hggpSchema}.HGKC008
SET CREATED_TIME = CREATED_TIME
WHERE 1=1
<include refid="idCondition"/>
</update>
<!-- 修改状态 -->
<update id="updateStatus">
UPDATE ${hggpSchema}.HGKC008
SET
STATUS = #status#,
<include refid="SqlBase.updateRevise"/>
WHERE 1=1
<include refid="idCondition"/>
</update>
</sqlMap> </sqlMap>
...@@ -2,10 +2,50 @@ ...@@ -2,10 +2,50 @@
<!DOCTYPE sqlMap PUBLIC "-//iBATIS.com//DTD SQL Map 2.0//EN" "http://www.ibatis.com/dtd/sql-map-2.dtd"> <!DOCTYPE sqlMap PUBLIC "-//iBATIS.com//DTD SQL Map 2.0//EN" "http://www.ibatis.com/dtd/sql-map-2.dtd">
<sqlMap namespace="HGKC008A"> <sqlMap namespace="HGKC008A">
<sql id="column">
ID as "id", <!-- 主键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-已提交,2.质检中 -->
APPLY_LINE_CODE as "applyLineCode", <!-- 领料单行号 -->
APPLY_CODE as "applyCode", <!-- 领料单号 -->
RECEIVE_ID as "receiveId", <!-- 领料单id -->
COMPANY_CODE as "companyCode", <!-- 公司编码 -->
COMPANY_NAME as "companyName", <!-- 公司名称 -->
PROJ_CODE as "projCode", <!-- 项目编码 -->
PROJ_NAME as "projName", <!-- 项目名称 -->
WH_CODE as "whCode", <!-- 仓库编号 -->
WH_NAME as "whName", <!-- 仓库名称 -->
INVENT_RECORD_ID as "inventRecordId", <!-- 存货档案id -->
INVENT_TYPE as "inventType", <!-- 存货类型 -->
INVENT_CODE as "inventCode", <!-- 存货编码 -->
INVENT_NAME as "inventName", <!-- 存货名称 -->
INV_SPEC_ID as "invSpecId", <!-- 规格ID -->
INV_SPEC as "invSpec", <!-- 规格 -->
INV_LENGTH as "invLength", <!-- 长度(MM) -->
INV_WIDTH as "invWidth", <!-- 宽度(MM) -->
INV_THICK as "invThick", <!-- 厚度(MM) -->
INV_QTY as "invQty", <!-- 数量 -->
INV_UNIT_WEIGHT as "invUnitWeight", <!-- 单重 -->
INV_WEIGHT as "invWeight", <!-- 重量 -->
PRICE as "price", <!-- 单价 -->
AMOUNT as "amount", <!-- 金额 -->
INVENT_TYPE_DETAIL as "inventTypeDetail", <!-- 存货类型大类 -->
QUALITY_NO as "qualityNo" <!-- 质检单号 -->
</sql>
<sql id="condition"> <sql id="condition">
<isNotEmpty prepend=" AND " property="id"> AND DELETE_FLAG = 0
ID = #id# <include refid="idCondition"/>
</isNotEmpty> <include refid="customCondition"/>
<include refid="HGXSDataAuth.authCondition"/>
<isNotEmpty prepend=" AND " property="accountCode"> <isNotEmpty prepend=" AND " property="accountCode">
ACCOUNT_CODE = #accountCode# ACCOUNT_CODE = #accountCode#
</isNotEmpty> </isNotEmpty>
...@@ -30,9 +70,6 @@ ...@@ -30,9 +70,6 @@
<isNotEmpty prepend=" AND " property="updatedTime"> <isNotEmpty prepend=" AND " property="updatedTime">
UPDATED_TIME = #updatedTime# UPDATED_TIME = #updatedTime#
</isNotEmpty> </isNotEmpty>
<isNotEmpty prepend=" AND " property="deleteFlag">
DELETE_FLAG = #deleteFlag#
</isNotEmpty>
<isNotEmpty prepend=" AND " property="receiveId"> <isNotEmpty prepend=" AND " property="receiveId">
RECEIVE_ID = #receiveId# RECEIVE_ID = #receiveId#
</isNotEmpty> </isNotEmpty>
...@@ -94,7 +131,7 @@ ...@@ -94,7 +131,7 @@
PROJ_CODE = #projCode# PROJ_CODE = #projCode#
</isNotEmpty> </isNotEmpty>
<isNotEmpty prepend=" AND " property="projName"> <isNotEmpty prepend=" AND " property="projName">
PROJ_NAME like ('%$projName$%') PROJ_NAME LIKE CONCAT('%', #projName#, '%')
</isNotEmpty> </isNotEmpty>
<isNotEmpty prepend=" AND " property="notIds"> <isNotEmpty prepend=" AND " property="notIds">
id NOT IN <iterate close=")" open="(" conjunction="," property="notIds">#notIds[]#</iterate> id NOT IN <iterate close=")" open="(" conjunction="," property="notIds">#notIds[]#</iterate>
...@@ -105,57 +142,52 @@ ...@@ -105,57 +142,52 @@
<isNotEmpty prepend=" AND " property="inventTypeDetails"> <isNotEmpty prepend=" AND " property="inventTypeDetails">
INVENT_TYPE_DETAIL IN <iterate close=")" open="(" conjunction="," property="inventTypeDetails">#inventTypeDetails[]#</iterate> INVENT_TYPE_DETAIL IN <iterate close=")" open="(" conjunction="," property="inventTypeDetails">#inventTypeDetails[]#</iterate>
</isNotEmpty> </isNotEmpty>
<isNotEmpty prepend=" AND " property="status">
STATUS = #status#
</isNotEmpty>
<isNotEmpty prepend=" AND " property="applyCode">
APPLY_CODE = #applyCode#
</isNotEmpty>
</sql> </sql>
<select id="query" parameterClass="java.util.HashMap" <sql id="idCondition">
resultClass="com.baosight.hggp.hg.kc.domain.HGKC008A"> <isNotEmpty prepend=" AND " property="id">
SELECT ID = #id#
ID as "id", <!-- 主键id --> </isNotEmpty>
ACCOUNT_CODE as "accountCode", <!-- 账套 --> <isNotEmpty prepend=" AND " property="ids">
DEP_CODE as "depCode", <!-- 部门编码 --> ID IN <iterate close=")" open="(" conjunction="," property="ids">#ids[]#</iterate>
CREATED_BY as "createdBy", <!-- 创建人 --> </isNotEmpty>
CREATED_NAME as "createdName", <!-- 创建人名称 --> <isNotEmpty prepend=" AND " property="applyLineCode">
CREATED_TIME as "createdTime", <!-- 创建时间 --> APPLY_LINE_CODE = #applyLineCode#
UPDATED_BY as "updatedBy", <!-- 修改人 --> </isNotEmpty>
UPDATED_NAME as "updatedName", <!-- 修改人名称 --> <isNotEmpty prepend=" AND " property="applyLineCodes">
UPDATED_TIME as "updatedTime", <!-- 修改时间 --> APPLY_LINE_CODE IN <iterate close=")" open="(" conjunction="," property="applyLineCodes">#applyLineCodes[]#</iterate>
DELETE_FLAG as "deleteFlag", <!-- 是否删除 0-否1-是 --> </isNotEmpty>
RECEIVE_ID as "receiveId", <!-- 领料单id --> </sql>
COMPANY_CODE as "companyCode", <!-- 公司编码 -->
COMPANY_NAME as "companyName", <!-- 公司名称 -->
PROJ_CODE as "projCode", <!-- 项目编码 -->
PROJ_NAME as "projName", <!-- 项目名称 -->
WH_CODE as "whCode", <!-- 仓库编号 -->
WH_NAME as "whName", <!-- 仓库名称 -->
INVENT_RECORD_ID as "inventRecordId", <!-- 存货档案id -->
INVENT_TYPE as "inventType", <!-- 存货类型 -->
INVENT_CODE as "inventCode", <!-- 存货编码 -->
INVENT_NAME as "inventName", <!-- 存货名称 -->
INV_SPEC_ID as "invSpecId", <!-- 规格Id -->
INV_SPEC as "invSpec", <!-- 规格 -->
INV_LENGTH as "invLength", <!-- 长度(MM) -->
INV_WIDTH as "invWidth", <!-- 宽度(MM) -->
INV_THICK as "invThick", <!-- 厚度(MM) -->
INV_QTY as "invQty", <!-- 数量 -->
INV_UNIT_WEIGHT as "invUnitWeight", <!-- 单重 -->
INV_WEIGHT as "invWeight", <!-- 重量 -->
PRICE as "price", <!-- 单价 -->
AMOUNT as "amount", <!-- 金额 -->
INVENT_TYPE_DETAIL as "inventTypeDetail"
FROM ${hggpSchema}.HGKC008A WHERE 1=1
<include refid="condition" />
<dynamic prepend="ORDER BY">
<isNotEmpty property="orderBy">
$orderBy$
</isNotEmpty>
</dynamic>
</select> <sql id="customCondition">
<isEqual prepend=" AND " property="isInvQty" compareValue="1">
INV_QTY > 0
</isEqual>
</sql>
<select id="count" resultClass="int"> <!-- 查询 -->
SELECT COUNT(*) FROM ${hggpSchema}.HGKC008A WHERE 1=1 <select id="query" resultClass="com.baosight.hggp.hg.kc.domain.HGKC008A">
<include refid="condition" /> SELECT
</select> <include refid="column"/>
FROM ${hggpSchema}.HGKC008A WHERE 1=1
<include refid="condition"/>
<dynamic prepend="ORDER BY">
<isNotEmpty property="orderBy">
$orderBy$
</isNotEmpty>
</dynamic>
</select>
<select id="count" resultClass="int">
SELECT COUNT(*) FROM ${hggpSchema}.HGKC008A WHERE 1=1
<include refid="condition"/>
</select>
<insert id="insert"> <insert id="insert">
INSERT INTO ${hggpSchema}.HGKC008A ( INSERT INTO ${hggpSchema}.HGKC008A (
...@@ -167,6 +199,9 @@ ...@@ -167,6 +199,9 @@
CREATED_NAME, <!-- 创建人名称 --> CREATED_NAME, <!-- 创建人名称 -->
CREATED_TIME, <!-- 创建时间 --> CREATED_TIME, <!-- 创建时间 -->
DELETE_FLAG, <!-- 是否删除 0-否1-是 --> DELETE_FLAG, <!-- 是否删除 0-否1-是 -->
STATUS, <!-- 状态 -->
APPLY_LINE_CODE, <!-- 领料单行号 -->
APPLY_CODE, <!-- 领料单编码 -->
RECEIVE_ID, <!-- 领料单id --> RECEIVE_ID, <!-- 领料单id -->
COMPANY_CODE, <!-- 公司编码 --> COMPANY_CODE, <!-- 公司编码 -->
COMPANY_NAME, <!-- 公司名称 --> COMPANY_NAME, <!-- 公司名称 -->
...@@ -186,32 +221,36 @@ ...@@ -186,32 +221,36 @@
INV_WEIGHT, <!-- 重量 --> INV_WEIGHT, <!-- 重量 -->
PRICE, <!-- 单价 --> PRICE, <!-- 单价 -->
AMOUNT, <!-- 金额 --> AMOUNT, <!-- 金额 -->
INVENT_TYPE_DETAIL INVENT_TYPE_DETAIL,
QUALITY_NO
) VALUES (#accountCode#,#projCode#, #projName#, #depCode#, #createdBy#, #createdName#, #createdTime#, ) VALUES (#accountCode#,#projCode#, #projName#, #depCode#, #createdBy#, #createdName#, #createdTime#,
#deleteFlag#, #receiveId#, #companyCode#, #companyName#, #whCode#, #deleteFlag#, #status#, #applyLineCode#, #applyCode#, #receiveId#, #companyCode#, #companyName#, #whCode#,
#whName#, #inventRecordId#, #inventType#, #inventCode#, #inventName#, #invSpecId#,#invSpec#, #invLength#, #whName#, #inventRecordId#, #inventType#, #inventCode#, #inventName#, #invSpecId#,#invSpec#, #invLength#,
#invWidth#, #invThick#, #invQty#, #invUnitWeight#, #invWeight#, #price#, #amount#, #inventTypeDetail#) #invWidth#, #invThick#, #invQty#, #invUnitWeight#, #invWeight#, #price#, #amount#, #inventTypeDetail#,
#qualityNo#)
</insert> </insert>
<delete id="delete"> <delete id="delete">
DELETE FROM ${hggpSchema}.HGKC008A WHERE ID = #id# UPDATE ${hggpSchema}.HGKC008A
</delete> SET DELETE_FLAG = 1
WHERE ID = #id#
</delete>
<delete id="batchDelete">
UPDATE ${hggpSchema}.HGKC008A
SET DELETE_FLAG = 1
WHERE 1=1
<include refid="idCondition"/>
</delete>
<update id="update"> <update id="update">
UPDATE ${hggpSchema}.HGKC008A UPDATE ${hggpSchema}.HGKC008A
SET SET
ACCOUNT_CODE = #accountCode#, <!-- 账套 -->
PROJ_CODE = #projCode#, <!-- 项目编码 --> PROJ_CODE = #projCode#, <!-- 项目编码 -->
PROJ_NAME = #projName#, <!-- 项目名称 --> PROJ_NAME = #projName#, <!-- 项目名称 -->
DEP_CODE = #depCode#, <!-- 部门编码 -->
CREATED_BY = #createdBy#, <!-- 创建人 -->
CREATED_NAME = #createdName#, <!-- 创建人名称 -->
CREATED_TIME = #createdTime#, <!-- 创建时间 -->
UPDATED_BY = #updatedBy#, <!-- 修改人 --> UPDATED_BY = #updatedBy#, <!-- 修改人 -->
UPDATED_NAME = #updatedName#, <!-- 修改人名称 --> UPDATED_NAME = #updatedName#, <!-- 修改人名称 -->
UPDATED_TIME = #updatedTime#, <!-- 修改时间 --> UPDATED_TIME = #updatedTime#, <!-- 修改时间 -->
DELETE_FLAG = #deleteFlag#, <!-- 是否删除 0-否1-是 -->
RECEIVE_ID = #receiveId#, <!-- 领料单id -->
COMPANY_CODE = #companyCode#, <!-- 公司编码 --> COMPANY_CODE = #companyCode#, <!-- 公司编码 -->
COMPANY_NAME = #companyName#, <!-- 公司名称 --> COMPANY_NAME = #companyName#, <!-- 公司名称 -->
WH_CODE = #whCode#, <!-- 仓库编号 --> WH_CODE = #whCode#, <!-- 仓库编号 -->
...@@ -234,11 +273,6 @@ ...@@ -234,11 +273,6 @@
WHERE ID = #id# WHERE ID = #id#
</update> </update>
<delete id="batchDelete">
DELETE FROM ${hggpSchema}.HGKC008A WHERE
id IN <iterate close=")" open="(" conjunction="," property="ids">#ids[]#</iterate>
</delete>
<!-- 统计库存 --> <!-- 统计库存 -->
<select id="statDate" resultClass="com.baosight.hggp.hg.kc.domain.HGKC008A"> <select id="statDate" resultClass="com.baosight.hggp.hg.kc.domain.HGKC008A">
SELECT SELECT
...@@ -259,57 +293,77 @@ ...@@ -259,57 +293,77 @@
</select> </select>
<select id="queryList" resultClass="com.baosight.hggp.hg.kc.domain.HGKC008B"> <select id="queryList" resultClass="com.baosight.hggp.hg.kc.domain.HGKC008B">
SELECT SELECT
A.ACCOUNT_CODE as "accountCode", <!-- 账套 --> A.ACCOUNT_CODE as "accountCode", <!-- 账套 -->
A.DEP_CODE as "depCode", <!-- 部门编码 --> A.DEP_CODE as "depCode", <!-- 部门编码 -->
A.RECEIVE_ID as "receiveId", <!-- 领料单id --> A.RECEIVE_ID as "receiveId", <!-- 领料单id -->
A.COMPANY_CODE as "companyCode", <!-- 公司编码 --> A.COMPANY_CODE as "companyCode", <!-- 公司编码 -->
A.COMPANY_NAME as "companyName", <!-- 公司名称 --> A.COMPANY_NAME as "companyName", <!-- 公司名称 -->
B.RECEIPT_DATE as "receiptDate", <!-- 单据日期 --> B.RECEIPT_DATE as "receiptDate", <!-- 单据日期 -->
B.APPLY_CODE as "applyCode", <!-- 申请单号 --> B.APPLY_CODE as "applyCode", <!-- 申请单号 -->
A.PROJ_CODE as "projCode", <!-- 项目编码 --> A.PROJ_CODE as "projCode", <!-- 项目编码 -->
A.PROJ_NAME as "projName", <!-- 项目名称 --> A.PROJ_NAME as "projName", <!-- 项目名称 -->
A.WH_CODE as "whCode", <!-- 仓库编号 --> A.WH_CODE as "whCode", <!-- 仓库编号 -->
A.WH_NAME as "whName", <!-- 仓库名称 --> A.WH_NAME as "whName", <!-- 仓库名称 -->
A.INVENT_RECORD_ID as "inventRecordId", <!-- 存货档案id --> A.INVENT_RECORD_ID as "inventRecordId", <!-- 存货档案id -->
A.INVENT_TYPE as "inventType", <!-- 存货类型 --> A.INVENT_TYPE as "inventType", <!-- 存货类型 -->
A.INVENT_CODE as "inventCode", <!-- 存货编码 --> A.INVENT_CODE as "inventCode", <!-- 存货编码 -->
A.INVENT_NAME as "inventName", <!-- 存货名称 --> A.INVENT_NAME as "inventName", <!-- 存货名称 -->
A.INV_SPEC_ID as "invSpecId", <!-- 规格Id --> A.INV_SPEC_ID as "invSpecId", <!-- 规格Id -->
A.INV_SPEC as "invSpec", <!-- 规格 --> A.INV_SPEC as "invSpec", <!-- 规格 -->
A.INV_LENGTH as "invLength", <!-- 长度(MM) --> A.INV_LENGTH as "invLength", <!-- 长度(MM) -->
A.INV_WIDTH as "invWidth", <!-- 宽度(MM) --> A.INV_WIDTH as "invWidth", <!-- 宽度(MM) -->
A.INV_THICK as "invThick", <!-- 厚度(MM) --> A.INV_THICK as "invThick", <!-- 厚度(MM) -->
SUM(A.INV_QTY) as "invQty", <!-- 数量 --> SUM(A.INV_QTY) as "invQty", <!-- 数量 -->
SUM(A.INV_WEIGHT) as "invWeight", <!-- 重量 --> SUM(A.INV_WEIGHT) as "invWeight", <!-- 重量 -->
CASE WHEN IFNULL(SUM(A.INV_QTY),0)=0 THEN 0 ELSE SUM(A.AMOUNT) / SUM(A.INV_QTY) END as "price", <!-- 单价 --> CASE WHEN IFNULL(SUM(A.INV_QTY),0)=0 THEN 0 ELSE SUM(A.AMOUNT) / SUM(A.INV_QTY) END as "price", <!-- 单价 -->
SUM(A.AMOUNT) as "amount", <!-- 金额 --> SUM(A.AMOUNT) as "amount", <!-- 金额 -->
A.INVENT_TYPE_DETAIL as "inventTypeDetail" A.INVENT_TYPE_DETAIL as "inventTypeDetail"
FROM ${hggpSchema}.HGKC008A A FROM ${hggpSchema}.HGKC008A A
INNER JOIN ${hggpSchema}.HGKC008 B ON A.RECEIVE_ID = B.ID INNER JOIN ${hggpSchema}.HGKC008 B ON A.RECEIVE_ID = B.ID
WHERE 1=1 AND A.DELETE_FLAG = 0 AND B.STATUS = 1 WHERE 1=1 AND A.DELETE_FLAG = 0 AND B.STATUS = 1
<isNotEmpty prepend=" AND " property="accountCode"> <isNotEmpty prepend=" AND " property="accountCode">
A.ACCOUNT_CODE = #accountCode# A.ACCOUNT_CODE = #accountCode#
</isNotEmpty> </isNotEmpty>
<isNotEmpty prepend=" AND " property="receiveId"> <isNotEmpty prepend=" AND " property="receiveId">
A.RECEIVE_ID = #receiveId# A.RECEIVE_ID = #receiveId#
</isNotEmpty> </isNotEmpty>
<isNotEmpty prepend=" AND " property="companyCode"> <isNotEmpty prepend=" AND " property="companyCode">
A.COMPANY_CODE = #companyCode# A.COMPANY_CODE = #companyCode#
</isNotEmpty> </isNotEmpty>
<isNotEmpty prepend=" AND " property="whCode"> <isNotEmpty prepend=" AND " property="whCode">
A.WH_CODE = #whCode# A.WH_CODE = #whCode#
</isNotEmpty> </isNotEmpty>
<isNotEmpty prepend=" AND " property="createdTimeFrom"> <isNotEmpty prepend=" AND " property="createdTimeFrom">
B.RECEIPT_DATE BETWEEN #createdTimeFrom# AND #createdTimeTo# B.RECEIPT_DATE BETWEEN #createdTimeFrom# AND #createdTimeTo#
</isNotEmpty> </isNotEmpty>
<isNotEmpty prepend=" AND " property="applyCode"> <isNotEmpty prepend=" AND " property="applyCode">
B.APPLY_CODE = #applyCode# B.APPLY_CODE = #applyCode#
</isNotEmpty> </isNotEmpty>
<isNotEmpty prepend=" AND " property="inventTypeDetail"> <isNotEmpty prepend=" AND " property="inventTypeDetail">
A.INVENT_TYPE_DETAIL = #inventTypeDetail# A.INVENT_TYPE_DETAIL = #inventTypeDetail#
</isNotEmpty> </isNotEmpty>
GROUP BY A.ACCOUNT_CODE, A.DEP_CODE, A.RECEIVE_ID, A.COMPANY_CODE, A.COMPANY_NAME, B.RECEIPT_DATE, B.APPLY_CODE, A.PROJ_CODE, A.PROJ_NAME, A.WH_CODE, A.WH_NAME, A.INVENT_RECORD_ID, A.INVENT_TYPE, A.INVENT_CODE, A.INVENT_NAME, A.INV_SPEC_ID, A.INV_SPEC, A.INV_LENGTH, A.INV_WIDTH, A.INV_THICK, A.INVENT_TYPE_DETAIL GROUP BY A.ACCOUNT_CODE, A.DEP_CODE, A.RECEIVE_ID, A.COMPANY_CODE, A.COMPANY_NAME, B.RECEIPT_DATE, B.APPLY_CODE,
</select> A.PROJ_CODE, A.PROJ_NAME, A.WH_CODE, A.WH_NAME, A.INVENT_RECORD_ID, A.INVENT_TYPE, A.INVENT_CODE, A.INVENT_NAME,
A.INV_SPEC_ID, A.INV_SPEC, A.INV_LENGTH, A.INV_WIDTH, A.INV_THICK, A.INVENT_TYPE_DETAIL
</select>
<!-- 行锁 -->
<update id="lock">
UPDATE ${hggpSchema}.HGKC008A
SET CREATED_TIME = CREATED_TIME
WHERE 1=1
<include refid="idCondition"/>
</update>
<!-- 修改状态 -->
<update id="updateStatus">
UPDATE ${hggpSchema}.HGKC008A
SET
STATUS = #status#,
<include refid="SqlBase.updateRevise"/>
WHERE 1=1
<include refid="idCondition"/>
</update>
</sqlMap> </sqlMap>
package com.baosight.hggp.hg.kc.tools; package com.baosight.hggp.hg.kc.tools;
import cn.hutool.core.bean.BeanUtil;
import cn.hutool.core.collection.CollectionUtil;
import com.baosight.hggp.common.CheckTypeEnum; import com.baosight.hggp.common.CheckTypeEnum;
import com.baosight.hggp.core.constant.CommonConstant; import com.baosight.hggp.core.constant.CommonConstant;
import com.baosight.hggp.core.dao.DaoBase; import com.baosight.hggp.core.dao.DaoBase;
import com.baosight.hggp.core.dao.DaoUtils; import com.baosight.hggp.core.dao.DaoUtils;
import com.baosight.hggp.core.enums.DeleteFlagEnum; import com.baosight.hggp.core.enums.DeleteFlagEnum;
import com.baosight.hggp.hg.cg.domain.HGCG003B; import com.baosight.hggp.hg.cg.domain.HGCG003B;
import com.baosight.hggp.hg.cg.tools.HGCGTools;
import com.baosight.hggp.hg.cg.utils.HGCGUtils; import com.baosight.hggp.hg.cg.utils.HGCGUtils;
import com.baosight.hggp.hg.constant.HGConstant; import com.baosight.hggp.hg.constant.HGConstant;
import com.baosight.hggp.hg.constant.HGSqlConstant; import com.baosight.hggp.hg.constant.HGSqlConstant;
import com.baosight.hggp.hg.cw.tools.HGCWTools; import com.baosight.hggp.hg.kc.constant.HgKcSqlConst;
import com.baosight.hggp.hg.kc.domain.*; import com.baosight.hggp.hg.kc.domain.HGKC001;
import com.baosight.hggp.hg.kc.domain.HGKC002;
import com.baosight.hggp.hg.kc.domain.HGKC003;
import com.baosight.hggp.hg.kc.domain.HGKC004;
import com.baosight.hggp.hg.kc.domain.HGKC004A;
import com.baosight.hggp.hg.kc.domain.HGKC005;
import com.baosight.hggp.hg.kc.domain.HGKC006;
import com.baosight.hggp.hg.kc.domain.HGKC006A;
import com.baosight.hggp.hg.kc.domain.HGKC007;
import com.baosight.hggp.hg.kc.domain.HGKC007A;
import com.baosight.hggp.hg.kc.domain.HGKC008;
import com.baosight.hggp.hg.kc.domain.HGKC008A;
import com.baosight.hggp.hg.kc.domain.HGKC010;
import com.baosight.hggp.hg.kc.domain.HGKC010A;
import com.baosight.hggp.hg.kc.domain.HGKC011;
import com.baosight.hggp.hg.kc.domain.HGKC013;
import com.baosight.hggp.hg.kc.domain.HGKC013A;
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;
...@@ -36,9 +49,17 @@ import com.baosight.iplat4j.ed.util.SequenceGenerator; ...@@ -36,9 +49,17 @@ import com.baosight.iplat4j.ed.util.SequenceGenerator;
import org.apache.commons.collections.CollectionUtils; import org.apache.commons.collections.CollectionUtils;
import java.math.BigDecimal; import java.math.BigDecimal;
import java.util.*; import java.util.Collections;
import java.util.HashMap;
import java.util.LinkedList;
import java.util.List;
import java.util.Map;
import java.util.Objects;
import java.util.stream.Collectors; import java.util.stream.Collectors;
import cn.hutool.core.bean.BeanUtil;
import cn.hutool.core.collection.CollectionUtil;
/** /**
* @author:songx * @author:songx
* @date:2024/5/13,14:56 * @date:2024/5/13,14:56
...@@ -869,31 +890,87 @@ public class HGKCTools { ...@@ -869,31 +890,87 @@ public class HGKCTools {
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())).findAny().orElse(null); HGKC010 kc010 = kc010List.stream().filter(k -> k.getInventCode().equals(o.getInventCode()))
AssertUtils.isTrue(Objects.isNull(kc010), "仓库("+kc007.getWhCode()+"|"+kc007.getWhName()+"),不存在存货信息:("+o.getInventCode()+"|"+o.getInventName()+")"); .findAny().orElse(null);
AssertUtils.isTrue(Objects.isNull(kc010),
"仓库(" + kc007.getWhCode() + "|" + kc007.getWhName() + "),不存在存货信息:(" + o.getInventCode()
+ "|" + o.getInventName() + ")");
}); });
DaoUtils.updateBatch(HGKC007A.UPDATE, results); DaoUtils.updateBatch(HGKC007A.UPDATE, results);
} }
return results; return results;
} }
} }
/**
* @author:songx
* @date:2024/9/29,10:15
*/
public static class HgKc008 { public static class HgKc008 {
/**
* 锁
*
* @param applyCodes
* @return
*/
public static void lock(List<String> applyCodes) {
if (CollectionUtils.isEmpty(applyCodes)) {
return;
}
Map paramMap = new HashMap();
paramMap.put("applyCodes", applyCodes);
DaoBase.getInstance().update(HgKcSqlConst.HgKc008.LOCK, paramMap);
}
/**
* 锁
*
* @param ids
* @return
*/
public static void lockEx(List<Long> ids) {
if (CollectionUtils.isEmpty(ids)) {
return;
}
Map paramMap = new HashMap();
paramMap.put("ids", ids);
DaoBase.getInstance().update(HgKcSqlConst.HgKc008.LOCK, paramMap);
}
/**
* 修改状态
*
* @param applyCode
* @param status
* @return
*/
public static void updateStatus(String applyCode, Integer status) {
AssertUtils.isEmpty(applyCode, "领用单号不能为空");
AssertUtils.isNull(status, "状态不能为空");
Map paramMap = new HashMap();
paramMap.put(HGKC008.FIELD_APPLY_CODE, applyCode);
paramMap.put(HGKC008.FIELD_STATUS, status);
DaoBase.getInstance().update(HgKcSqlConst.HgKc008.UPDATE_STATUS, paramMap);
}
public static HGKC008 getById(Long id) { public static HGKC008 getById(Long id) {
AssertUtils.isEmpty(Collections.singleton(id), "ID为空!"); AssertUtils.isEmpty(Collections.singleton(id), "ID为空!");
HGKC008 result = (HGKC008) DaoBase.getInstance().get(HGKC008.QUERY, HGKC008.FIELD_ID, id); HGKC008 result = (HGKC008) DaoBase.getInstance().get(HGKC008.QUERY, HGKC008.FIELD_ID, id);
return result; return result;
} }
public static HGKC008 getByApplyCode(String applyCode) { public static HGKC008 getByApplyCode(String applyCode) {
AssertUtils.isEmpty(applyCode, "申请编号为空!"); AssertUtils.isEmpty(applyCode, "申请编号为空!");
HGKC008 result = (HGKC008) DaoBase.getInstance().get(HGKC008.QUERY, HGKC008.FIELD_APPLY_CODE, applyCode); HGKC008 result = (HGKC008) DaoBase.getInstance().get(HGKC008.QUERY, HGKC008.FIELD_APPLY_CODE, applyCode);
return result; return result;
} }
/** /**
* 查询 * 查询
* 成本核算数据检查 * 成本核算数据检查
*
* @param paramMap * @param paramMap
* @return * @return
*/ */
...@@ -901,25 +978,194 @@ public class HGKCTools { ...@@ -901,25 +978,194 @@ public class HGKCTools {
AssertUtils.isEmpty(paramMap, "时间不能为空"); AssertUtils.isEmpty(paramMap, "时间不能为空");
return DaoBase.getInstance().query("HGKC008.queryCheckList", paramMap); return DaoBase.getInstance().query("HGKC008.queryCheckList", paramMap);
} }
} /**
* 查询
public static class HgKc008A { *
public static void checkMainData(List<Long> ids,Long receiveId) { * @param applyCodes
* @return
*/
public static List<HGKC008> list(List<String> applyCodes) {
AssertUtils.isEmpty(applyCodes, "领用单号不能为空");
Map<String, Object> paramMap = new HashMap();
paramMap.put("applyCodes", applyCodes);
return DaoBase.getInstance().query(HGKC008.QUERY, paramMap);
}
/**
* 查询
*
* @param applyCodes
* @return
*/
public static Map<String, HGKC008> map(List<String> applyCodes) {
List<HGKC008> results = list(applyCodes);
return results.stream().collect(Collectors.toMap(HGKC008::getApplyCode, item -> item));
}
/**
* 查询
*
* @param ids
* @return
*/
public static List<HGKC008> listEx(List<Long> ids) {
AssertUtils.isEmpty(ids, "领用单号不能为空");
Map<String, Object> paramMap = new HashMap();
paramMap.put("ids", ids);
return DaoBase.getInstance().query(HGKC008.QUERY, paramMap);
}
/**
* 查询
*
* @param ids
* @return
*/
public static Map<Long, HGKC008> mapEx(List<Long> ids) {
List<HGKC008> results = listEx(ids);
return results.stream().collect(Collectors.toMap(HGKC008::getId, item -> item));
}
/**
* 更新主信息状态
*
* @param applyCode
*/
public static void checkMainData(String applyCode) {
Map paramMap = new HashMap(); Map paramMap = new HashMap();
paramMap.put("notIds", ids); paramMap.put("applyCode", applyCode);
paramMap.put("receiveId", receiveId);
List<HGKC008A> results = DaoBase.getInstance().query(HGKC008A.QUERY, paramMap); List<HGKC008A> results = DaoBase.getInstance().query(HGKC008A.QUERY, paramMap);
//明细都删除了,修改主表类型 //明细都删除了,修改主表类型
if (CollectionUtil.isEmpty(results)){ if (CollectionUtil.isEmpty(results)) {
HGKC008 hgkc008 = new HGKC008(); Map updateMap = new HashMap();
hgkc008.setId(receiveId); updateMap.put(HGKC008.FIELD_APPLY_CODE, applyCode);
hgkc008.setReceiveType(HGConstant.ReceiveType.DEFAULT); updateMap.put(HGKC008.FIELD_RECEIVE_TYPE, HGConstant.ReceiveType.DEFAULT);
DaoUtils.update(HGKC008.UPDATE_RECEIVE_TYPE, hgkc008); DaoUtils.update(HgKcSqlConst.HgKc008.UPDATE_RECEIVE_TYPE, updateMap);
} }
} }
}
/**
* HGKC008A 定义
*
* @author:songx
* @date:2024/9/29,10:47
*/
public static class HgKc008A {
/**
* 锁
*
* @param ids
* @return
*/
public static void lockEx(List<Long> ids) {
if (CollectionUtils.isEmpty(ids)) {
return;
}
Map paramMap = new HashMap();
paramMap.put("ids", ids);
DaoBase.getInstance().update(HgKcSqlConst.HgKc008A.LOCK, paramMap);
}
/**
* 锁
*
* @param applyLineCodes
* @return
*/
public static void lock(List<String> applyLineCodes) {
if (CollectionUtils.isEmpty(applyLineCodes)) {
return;
}
Map paramMap = new HashMap();
paramMap.put("applyLineCodes", applyLineCodes);
DaoBase.getInstance().update(HgKcSqlConst.HgKc008A.LOCK, paramMap);
}
/**
* 修改状态
*
* @param applyLineCode
* @param status
* @return
*/
public static void updateStatus(String applyLineCode, Integer status) {
AssertUtils.isEmpty(applyLineCode, "领用单行号不能为空");
AssertUtils.isNull(status, "状态不能为空");
Map paramMap = new HashMap();
paramMap.put(HGKC008A.FIELD_APPLY_LINE_CODE, applyLineCode);
paramMap.put(HGKC008A.FIELD_STATUS, status);
DaoBase.getInstance().update(HgKcSqlConst.HgKc008A.UPDATE_STATUS, paramMap);
}
/**
* 修改数量
*
* @param applyLineCode
* @param status
* @return
*/
public static void updateQty(String applyLineCode, Integer status) {
AssertUtils.isEmpty(applyLineCode, "领用单行号不能为空");
AssertUtils.isNull(status, "状态不能为空");
Map paramMap = new HashMap();
paramMap.put(HGKC008A.FIELD_APPLY_LINE_CODE, applyLineCode);
paramMap.put(HGKC008A.FIELD_STATUS, status);
DaoBase.getInstance().update(HgKcSqlConst.HgKc008A.UPDATE_STATUS, paramMap);
}
/**
* 查询
*
* @param ids
* @return
*/
public static List<HGKC008A> listEx(List<Long> ids) {
AssertUtils.isEmpty(ids, "ID不能为空");
Map<String, Object> paramMap = new HashMap();
paramMap.put("ids", ids);
return DaoBase.getInstance().query(HGKC008A.QUERY, paramMap);
}
/**
* 查询
*
* @param ids
* @return
*/
public static Map<Long, HGKC008A> mapEx(List<Long> ids) {
List<HGKC008A> results = listEx(ids);
return results.stream().collect(Collectors.toMap(HGKC008A::getId, item -> item));
}
/**
* 查询
*
* @param applyLineCodes
* @return
*/
public static List<HGKC008A> list(List<String> applyLineCodes) {
AssertUtils.isEmpty(applyLineCodes, "领用单行号不能为空");
Map<String, Object> paramMap = new HashMap();
paramMap.put("applyLineCodes", applyLineCodes);
return DaoBase.getInstance().query(HGKC008A.QUERY, paramMap);
}
/**
* 查询
*
* @param applyLineCodes
* @return
*/
public static Map<String, HGKC008A> map(List<String> applyLineCodes) {
List<HGKC008A> results = list(applyLineCodes);
return results.stream().collect(Collectors.toMap(HGKC008A::getApplyLineCode, item -> item));
}
public static List<HGKC008A> getHgkc008aList(Long receiveId) { public static List<HGKC008A> getHgkc008aList(Long receiveId) {
Map paramMap = new HashMap(); Map paramMap = new HashMap();
paramMap.put("receiveId", receiveId); paramMap.put("receiveId", receiveId);
......
...@@ -5,7 +5,16 @@ import com.baosight.hggp.core.dao.DaoUtils; ...@@ -5,7 +5,16 @@ import com.baosight.hggp.core.dao.DaoUtils;
import com.baosight.hggp.core.enums.DeleteFlagEnum; import com.baosight.hggp.core.enums.DeleteFlagEnum;
import com.baosight.hggp.hg.cg.domain.HGCG003B; import com.baosight.hggp.hg.cg.domain.HGCG003B;
import com.baosight.hggp.hg.constant.HGSqlConstant; import com.baosight.hggp.hg.constant.HGSqlConstant;
import com.baosight.hggp.hg.kc.domain.*; import com.baosight.hggp.hg.kc.domain.HGKC001;
import com.baosight.hggp.hg.kc.domain.HGKC002;
import com.baosight.hggp.hg.kc.domain.HGKC003;
import com.baosight.hggp.hg.kc.domain.HGKC006;
import com.baosight.hggp.hg.kc.domain.HGKC007;
import com.baosight.hggp.hg.kc.domain.HGKC008;
import com.baosight.hggp.hg.kc.domain.HGKC008A;
import com.baosight.hggp.hg.kc.domain.HGKC010;
import com.baosight.hggp.hg.kc.domain.HGKC010A;
import com.baosight.hggp.hg.kc.domain.HGKC011;
import com.baosight.hggp.hg.kc.tools.HGKCTools; import com.baosight.hggp.hg.kc.tools.HGKCTools;
import com.baosight.hggp.hg.pz.domain.HGPZ005; import com.baosight.hggp.hg.pz.domain.HGPZ005;
import com.baosight.hggp.hg.pz.tools.HGPZTools; import com.baosight.hggp.hg.pz.tools.HGPZTools;
...@@ -16,6 +25,7 @@ import com.baosight.hggp.util.DateUtils; ...@@ -16,6 +25,7 @@ import com.baosight.hggp.util.DateUtils;
import com.baosight.hggp.util.MapUtils; import com.baosight.hggp.util.MapUtils;
import com.baosight.hggp.util.ObjectUtils; import com.baosight.hggp.util.ObjectUtils;
import com.baosight.hggp.util.StringUtils; import com.baosight.hggp.util.StringUtils;
import org.apache.commons.collections.CollectionUtils;
import java.math.BigDecimal; import java.math.BigDecimal;
import java.math.RoundingMode; import java.math.RoundingMode;
...@@ -217,9 +227,51 @@ public class HGKCUtils { ...@@ -217,9 +227,51 @@ public class HGKCUtils {
return DaoBase.getInstance().query(HGCG003B.QUERY, paramMap); return DaoBase.getInstance().query(HGCG003B.QUERY, paramMap);
} }
} }
/**
* HGKC008 定义
*
* @author:songx
* @date:2024/9/29,10:02
*/
public static class HgKc008 { public static class HgKc008 {
/**
* 锁并且获取数据
*
* @param kc008s
* @return
*/
public static Map<String, HGKC008> lockGetDataEp(List<? extends HGKC008> kc008s) {
return lockGetData(ObjectUtils.listEpKey(kc008s, HGKC008.FIELD_APPLY_CODE));
}
/**
* 锁并且获取数据
*
* @param applyCodes
* @return
*/
public static Map<String, HGKC008> lockGetData(List<String> applyCodes) {
// 锁
HGKCTools.HgKc008.lock(applyCodes);
// db数据
return HGKCTools.HgKc008.map(applyCodes);
}
/**
* 锁并且获取数据
*
* @param ids
* @return
*/
public static Map<Long, HGKC008> lockGetDataEx(List<Long> ids) {
// 锁
HGKCTools.HgKc008.lockEx(ids);
// db数据
return HGKCTools.HgKc008.mapEx(ids);
}
/** /**
* 查询 * 查询
* *
...@@ -233,10 +285,43 @@ public class HGKCUtils { ...@@ -233,10 +285,43 @@ public class HGKCUtils {
List<HGKC008> hgkc008List = DaoBase.getInstance().query(HGKC008.QUERY, paramMap); List<HGKC008> hgkc008List = DaoBase.getInstance().query(HGKC008.QUERY, paramMap);
return hgkc008List.get(0); return hgkc008List.get(0);
} }
} }
/**
*
* @author:songx
* @date:2024/9/29,10:30
*/
public static class HgKc008A { public static class HgKc008A {
/**
* 锁并且获取数据
*
* @param kc008As
* @return
*/
public static Map<String, HGKC008A> lockGetDataEp(List<? extends HGKC008A> kc008As) {
return lockGetData(ObjectUtils.listEpKey(kc008As, HGKC008A.FIELD_APPLY_LINE_CODE));
}
/**
* 锁并且获取数据
*
* @param applyLineCodes
* @return
*/
public static Map<String, HGKC008A> lockGetData(List<String> applyLineCodes) {
if (CollectionUtils.isEmpty(applyLineCodes)) {
return null;
}
// 锁
HGKCTools.HgKc008A.lock(applyLineCodes);
// db数据
return HGKCTools.HgKc008A.map(applyLineCodes);
}
/** /**
* 查询 * 查询
* *
...@@ -250,6 +335,7 @@ public class HGKCUtils { ...@@ -250,6 +335,7 @@ public class HGKCUtils {
return DaoBase.getInstance().query(HGKC008A.QUERY, paramMap); return DaoBase.getInstance().query(HGKC008A.QUERY, paramMap);
} }
} }
/** /**
* HGKC010 工具类 * HGKC010 工具类
* *
......
package com.baosight.hggp.hg.zl.constant;
/**
* @author:songx
* @date:2024/9/29,11:29
*/
public class HgZlConst {
/**
* @author:songx
* @date:2024/9/29,13:38
*/
public static class HgZl011 {
/**
* 状态
*
* @author:songx
* @date:2024/5/15,15:18
*/
public static class Status {
// 未处理
public static final Integer S0 = 0;
// 已处理
public static final Integer S1 = 1;
}
}
}
package com.baosight.hggp.hg.zl.constant;
/**
* @author:songx
* @date:2024/9/29,11:29
*/
public class HgZlSqlConst {
/**
* HGZL011
*
* @author:songx
* @date:2024/5/7,16:36
*/
public static class HgZl011 {
// 锁
public static final String LOCK = "HGZL011.lock";
// 处理
public static final String PROCESS = "HGZL011.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:Hgzl011.java <br>
* Description: <br>
*
* Copyrigth:Baosight Software LTD.co Copyright (c) 2019. <br>
*
* @version 1.0
* @history 2024-09-29 11:24:26 create
*/
public class HGZL011 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_MATERIAL = "material"; /* 材质*/
public static final String FIELD_UNIT = "unit"; /* 单位*/
public static final String FIELD_LENGTH = "length"; /* 长度*/
public static final String FIELD_WIDTH = "width"; /* 宽度*/
public static final String FIELD_THICK = "thick"; /* 厚度*/
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_INVENT_TYPE_DETAIL = "inventTypeDetail"; /* 存货类型大类*/
public static final String FIELD_APPLY_CODE = "applyCode"; /* 领料单号*/
public static final String FIELD_APPLY_LINE_CODE = "applyLineCode"; /* 领料单行号*/
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_MATERIAL = "MATERIAL"; /* 材质*/
public static final String COL_UNIT = "UNIT"; /* 单位*/
public static final String COL_LENGTH = "LENGTH"; /* 长度*/
public static final String COL_WIDTH = "WIDTH"; /* 宽度*/
public static final String COL_THICK = "THICK"; /* 厚度*/
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_INVENT_TYPE_DETAIL = "INVENT_TYPE_DETAIL"; /* 存货类型大类*/
public static final String COL_APPLY_CODE = "APPLY_CODE"; /* 领料单号*/
public static final String COL_APPLY_LINE_CODE = "APPLY_LINE_CODE"; /* 领料单行号*/
public static final String QUERY = "HGZL011.query";
public static final String COUNT = "HGZL011.count";
public static final String INSERT = "HGZL011.insert";
public static final String UPDATE = "HGZL011.update";
public static final String DELETE = "HGZL011.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 material = " "; /* 材质*/
private String unit = " "; /* 单位*/
private BigDecimal length = new BigDecimal(0.000); /* 长度*/
private BigDecimal width = new BigDecimal(0.000); /* 宽度*/
private BigDecimal thick = new BigDecimal(0.000); /* 厚度*/
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 Integer inventTypeDetail = new Integer(0); /* 存货类型大类*/
private String applyCode = " "; /* 领料单号*/
private String applyLineCode = " "; /* 领料单行号*/
/**
* 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_MATERIAL);
eiColumn.setDescName("材质");
eiMetadata.addMeta(eiColumn);
eiColumn = new EiColumn(FIELD_UNIT);
eiColumn.setDescName("单位");
eiMetadata.addMeta(eiColumn);
eiColumn = new EiColumn(FIELD_LENGTH);
eiColumn.setType("N");
eiColumn.setScaleLength(3);
eiColumn.setFieldLength(20);
eiColumn.setDescName("长度");
eiMetadata.addMeta(eiColumn);
eiColumn = new EiColumn(FIELD_WIDTH);
eiColumn.setType("N");
eiColumn.setScaleLength(3);
eiColumn.setFieldLength(20);
eiColumn.setDescName("宽度");
eiMetadata.addMeta(eiColumn);
eiColumn = new EiColumn(FIELD_THICK);
eiColumn.setType("N");
eiColumn.setScaleLength(3);
eiColumn.setFieldLength(20);
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_INVENT_TYPE_DETAIL);
eiColumn.setDescName("存货类型大类");
eiMetadata.addMeta(eiColumn);
eiColumn = new EiColumn(FIELD_APPLY_CODE);
eiColumn.setDescName("领料单号");
eiMetadata.addMeta(eiColumn);
eiColumn = new EiColumn(FIELD_APPLY_LINE_CODE);
eiColumn.setDescName("领料单行号");
eiMetadata.addMeta(eiColumn);
}
/**
* the constructor.
*/
public HGZL011() {
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 material - 材质.
* @return the material
*/
public String getMaterial() {
return this.material;
}
/**
* set the material - 材质.
*
* @param material - 材质
*/
public void setMaterial(String material) {
this.material = material;
}
/**
* get the 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 length - 长度.
* @return the length
*/
public BigDecimal getLength() {
return this.length;
}
/**
* set the length - 长度.
*
* @param length - 长度
*/
public void setLength(BigDecimal length) {
this.length = length;
}
/**
* get the width - 宽度.
* @return the width
*/
public BigDecimal getWidth() {
return this.width;
}
/**
* set the width - 宽度.
*
* @param width - 宽度
*/
public void setWidth(BigDecimal width) {
this.width = width;
}
/**
* get the thick - 厚度.
* @return the thick
*/
public BigDecimal getThick() {
return this.thick;
}
/**
* set the thick - 厚度.
*
* @param thick - 厚度
*/
public void setThick(BigDecimal thick) {
this.thick = thick;
}
/**
* 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 inventTypeDetail - 存货类型大类.
* @return the inventTypeDetail
*/
public Integer getInventTypeDetail() {
return this.inventTypeDetail;
}
/**
* set the inventTypeDetail - 存货类型大类.
*
* @param inventTypeDetail - 存货类型大类
*/
public void setInventTypeDetail(Integer inventTypeDetail) {
this.inventTypeDetail = inventTypeDetail;
}
/**
* get the applyCode - 领料单号.
* @return the applyCode
*/
public String getApplyCode() {
return this.applyCode;
}
/**
* set the applyCode - 领料单号.
*
* @param applyCode - 领料单号
*/
public void setApplyCode(String applyCode) {
this.applyCode = applyCode;
}
/**
* get the applyLineCode - 领料单行号.
* @return the applyLineCode
*/
public String getApplyLineCode() {
return this.applyLineCode;
}
/**
* set the applyLineCode - 领料单行号.
*
* @param applyLineCode - 领料单行号
*/
public void setApplyLineCode(String applyLineCode) {
this.applyLineCode = applyLineCode;
}
/**
* 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));
setMaterial(StringUtils.defaultIfEmpty(StringUtils.toString(map.get(FIELD_MATERIAL)), material));
setUnit(StringUtils.defaultIfEmpty(StringUtils.toString(map.get(FIELD_UNIT)), unit));
setLength(NumberUtils.toBigDecimal(StringUtils.toString(map.get(FIELD_LENGTH)), length));
setWidth(NumberUtils.toBigDecimal(StringUtils.toString(map.get(FIELD_WIDTH)), width));
setThick(NumberUtils.toBigDecimal(StringUtils.toString(map.get(FIELD_THICK)), thick));
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));
setInventTypeDetail(NumberUtils.toInteger(StringUtils.toString(map.get(FIELD_INVENT_TYPE_DETAIL)), inventTypeDetail));
setApplyCode(StringUtils.defaultIfEmpty(StringUtils.toString(map.get(FIELD_APPLY_CODE)), applyCode));
setApplyLineCode(StringUtils.defaultIfEmpty(StringUtils.toString(map.get(FIELD_APPLY_LINE_CODE)), applyLineCode));
}
/**
* 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_MATERIAL, StringUtils.toString(material, eiMetadata.getMeta(FIELD_MATERIAL)));
map.put(FIELD_UNIT, StringUtils.toString(unit, eiMetadata.getMeta(FIELD_UNIT)));
map.put(FIELD_LENGTH, StringUtils.toString(length, eiMetadata.getMeta(FIELD_LENGTH)));
map.put(FIELD_WIDTH, StringUtils.toString(width, eiMetadata.getMeta(FIELD_WIDTH)));
map.put(FIELD_THICK, StringUtils.toString(thick, eiMetadata.getMeta(FIELD_THICK)));
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_INVENT_TYPE_DETAIL, StringUtils.toString(inventTypeDetail, eiMetadata.getMeta(FIELD_INVENT_TYPE_DETAIL)));
map.put(FIELD_APPLY_CODE, StringUtils.toString(applyCode, eiMetadata.getMeta(FIELD_APPLY_CODE)));
map.put(FIELD_APPLY_LINE_CODE, StringUtils.toString(applyLineCode, eiMetadata.getMeta(FIELD_APPLY_LINE_CODE)));
return map;
}
}
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.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.HGZL011;
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 ServiceHGZL011 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 HGZL001().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.HgZl011.setCondition(queryMap);
inInfo = super.query(inInfo, HGZL011.QUERY, new HGZL011());
} catch (Exception e) {
LogUtils.setMsg(inInfo, e, "查询失败");
}
return inInfo;
}
/**
* 保存
*
* @param inInfo
* @return
*/
public EiInfo save(EiInfo inInfo) {
try {
List<HGZL011> fZl011s = MapUtils.toDaoEPBases(inInfo, HGZL011.class);
for (HGZL011 fZl011 : fZl011s) {
AssertUtils.isNotEquals(HgZlConst.HgZl011.Status.S0, fZl011.getStatus(),
String.format("质检单【%s】状态不是\"未处理\",不允许操作", fZl011.getQualityNo()));
// 去除日期字符串中的-
fZl011.setQualityDate(DateUtils.formatShort(fZl011.getQualityDate()));
DaoUtils.update(HGZL011.UPDATE, fZl011.toMap());
}
inInfo = this.query(inInfo);
inInfo.setMsg("操作成功!本次对[" + fZl011s.size() + "]条数据修改成功!");
} catch (Exception e) {
LogUtils.setMsg(inInfo, e, "修改失败");
}
return inInfo;
}
/**
* 删除操作
*
* @param inInfo
* @return
*/
@OperationLogAnnotation(operModul = "入库质检单", operType = "删除", operDesc = "删除")
public EiInfo remove(EiInfo inInfo) {
try {
List<HGZL011> fZl011s = MapUtils.toDaoEPBases(inInfo, HGZL011.class);
Map<String, HGZL011> dbZl011Map = HGZLUtils.HgZl011.lockGetDataEp(fZl011s);
// 数据校验
this.checkRemoveData(fZl011s, dbZl011Map);
// 删除数据
this.removeData(fZl011s, dbZl011Map);
inInfo = this.query(inInfo);
inInfo.setMsg("操作成功!本次对[" + fZl011s.size() + "]条数据删除成功!");
} catch (Exception e) {
LogUtils.setMsg(inInfo, e, "删除失败");
}
return inInfo;
}
/**
* 数据校验
*
* @param fZl011s
* @param dbZl011Map
*/
private void checkRemoveData(List<HGZL011> fZl011s, Map<String, HGZL011> dbZl011Map) {
for (HGZL011 fZl011 : fZl011s) {
String qualityNo = fZl011.getQualityNo();
HGZL011 dbZl011 = dbZl011Map.get(qualityNo);
this.checkData(qualityNo, dbZl011);
}
}
/**
* 删除数据
*
* @param fZl011s
* @param dbZl011Map
*/
private void removeData(List<HGZL011> fZl011s, Map<String, HGZL011> dbZl011Map) {
for (HGZL011 fZl011 : fZl011s) {
String qualityNo = fZl011.getQualityNo();
HGZL011 dbZl011 = dbZl011Map.get(qualityNo);
fZl011.setDeleteFlag(DeleteFlagEnum.REMOVE.getCode());
DaoUtils.update(HGZL011.DELETE, fZl011.toMap());
// 更新领料单主状态
HGKCTools.HgKc008.updateStatus(dbZl011.getApplyCode(), HgKcConst.HgKc008.Status.S1);
// 更新领料单明细状态
HGKCTools.HgKc008A.updateStatus(dbZl011.getApplyLineCode(), HgKcConst.HgKc008.Status.S1);
}
}
/**
* 已处理
*
* @param inInfo
* @return
*/
public EiInfo process(EiInfo inInfo) {
try {
List<HGZL011> fZl011s = MapUtils.toDaoEPBases(inInfo, HGZL011.class);
Map<String, HGZL011> dbZl011Map = HGZLUtils.HgZl011.lockGetDataEp(fZl011s);
// 获取收货明细数据
List<String> applyLineCodes = ObjectUtils.listEpKey(fZl011s, HGZL011.FIELD_APPLY_LINE_CODE);
Map<String, HGKC008A> dbKc008AMap = HGKCTools.HgKc008A.map(applyLineCodes);
// 数据校验
this.checkProcessData(fZl011s, dbZl011Map, dbKc008AMap);
// 保存数据
this.processData(fZl011s, dbZl011Map, dbKc008AMap);
inInfo = this.query(inInfo);
inInfo.setStatus(EiConstant.STATUS_DEFAULT);
inInfo.setMsg("操作成功!本次对[" + fZl011s.size() + "]条数据处理成功!");
} catch (Exception e) {
LogUtils.setMsg(inInfo, e, "处理失败");
}
return inInfo;
}
/**
* 校验数据
*
* @param fZl011s
* @param dbZl011Map
* @param dbKc008AMap
*/
private void checkProcessData(List<HGZL011> fZl011s, Map<String, HGZL011> dbZl011Map,
Map<String, HGKC008A> dbKc008AMap) {
for (HGZL011 fZl011 : fZl011s) {
String qualityNo = fZl011.getQualityNo();
HGZL011 dbZl011 = dbZl011Map.get(qualityNo);
// 质检校验
this.checkData(qualityNo, dbZl011);
// 领料信息
HGKC008A dbKc008A = dbKc008AMap.get(dbZl011.getApplyLineCode());
AssertUtils.isNull(dbKc008A, String.format("质检单【%s】关联的领料单【%s】不存在", qualityNo,
dbZl011.getApplyLineCode()));
AssertUtils.isGt(BigDecimal.ZERO, fZl011.getQualityQty(),
String.format("质检单[%s]的合格数量【%s】不能为负数", qualityNo, fZl011.getQualityQty()));
AssertUtils.isGt(BigDecimal.ZERO, fZl011.getUnQualityQty(),
String.format("质检单[%s]的不合格数量【%s】不能为负数", qualityNo, fZl011.getUnQualityQty()));
AssertUtils.isNotEquals(fZl011.getQualityQty().add(fZl011.getUnQualityQty()), dbKc008A.getInvQty(),
String.format("质检单[%s]的合格数量加不合格数量必须等于领料数量", qualityNo));
}
}
/**
* 保存数据
*
* @param fZl011s
* @param dbZl011Map
* @param dbKc008AMap
*/
private void processData(List<HGZL011> fZl011s, Map<String, HGZL011> dbZl011Map,
Map<String, HGKC008A> dbKc008AMap) {
for (HGZL011 fZl011 : fZl011s) {
String qualityNo = fZl011.getQualityNo();
// 更新质检单状态
HGZL011 dbZl011 = dbZl011Map.get(qualityNo);
dbZl011.setQualityQty(fZl011.getQualityQty());
dbZl011.setUnQualityQty(fZl011.getUnQualityQty());
dbZl011.setStatus(HgZlConst.HgZl011.Status.S1);
DaoUtils.update(HgZlSqlConst.HgZl011.PROCESS, dbZl011.toMap());
// 更新领料单明细状态
this.updateApplyDetail(fZl011, dbKc008AMap);
}
}
/**
* 更新领料单明细状态
*
* @param fZl011
* @param dbKc008AMap
*/
private void updateApplyDetail(HGZL011 fZl011, Map<String, HGKC008A> dbKc008AMap) {
String applyLineCode = fZl011.getApplyLineCode();
HGKCTools.HgKc008A.updateStatus(applyLineCode, HgKcConst.HgKc008.Status.S3);
String applyCode = fZl011.getApplyCode();
HGKCTools.HgKc008.updateStatus(applyCode, HgKcConst.HgKc008.Status.S3);
// 如果存在不合格数量生产一笔负数领料单
if (fZl011.getUnQualityQty().compareTo(BigDecimal.ZERO) > 0) {
return;
}
HGKC008A dbKc008A = dbKc008AMap.get(applyLineCode);
HGKC008A newKc008A = BeanUtils.copy(dbKc008A, HGKC008A.class);
newKc008A.setApplyLineCode(SequenceGenerator.getNextSequence(HGConstant.SequenceId.SC_APPLY_LINE_CODE,
new String[]{dbKc008A.getApplyCode()}));
newKc008A.setStatus(HgKcConst.HgKc008.Status.S3);
newKc008A.setInvQty(fZl011.getUnQualityQty().negate());
newKc008A.setInvWeight(newKc008A.getInvQty().multiply(newKc008A.getInvUnitWeight()));
newKc008A.setQualityNo(fZl011.getQualityNo());
newKc008A.setDepCode("");
newKc008A.setAccountCode("");
DaoUtils.insert(HGKC008A.INSERT, newKc008A);
// 修改库存
HGKCUtils.HgKc010.updateInv(dbKc008A.getCompanyCode(), dbKc008A.getWhCode(),
dbKc008A.getInventCode(), newKc008A.getInvQty(), newKc008A.getInvUnitWeight(),
newKc008A.getInvWeight());
}
/**
* 检查状态
*
* @param inInfo
* @return
*/
public EiInfo checkStatus(EiInfo inInfo) {
try {
Map queryMap = EiInfoUtils.getFirstRow(inInfo);
String qualityNo = MapUtils.getString(queryMap, HGZL011.FIELD_QUALITY_NO);
HGZL011 dbZl011 = HGZLUtils.HgZl011.lockGetData(qualityNo);
this.checkData(qualityNo, dbZl011);
} catch (Exception e) {
LogUtils.setMsg(inInfo, e, "操作失败");
}
return inInfo;
}
/**
* 数据校验
*
* @param qualityNo
* @param dbZl011
*/
private void checkData(String qualityNo, HGZL011 dbZl011) {
AssertUtils.isNull(dbZl011, String.format("质检单【%s】不存在", qualityNo));
AssertUtils.isNotEquals(dbZl011.getDeleteFlag(), CommonConstant.YesNo.NO_0,
String.format("质检单【%s】不是\"未删除\"状态,不允许操作", qualityNo));
AssertUtils.isNotEquals(dbZl011.getStatus(), HgZlConst.HgZl011.Status.S0,
String.format("质检单【%s】不是\"未处理\"状态,不允许操作", qualityNo));
}
}
package com.baosight.hggp.hg.zl.service;
import com.baosight.hggp.aspect.annotation.OperationLogAnnotation;
import com.baosight.hggp.core.constant.CommonConstant;
import com.baosight.hggp.core.dao.DaoUtils;
import com.baosight.hggp.core.utils.Iplat4jUtils;
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.xs.domain.HGXS007;
import com.baosight.hggp.hg.xs.tools.HGXSTools;
import com.baosight.hggp.hg.xs.utils.HGXSUtils;
import com.baosight.hggp.hg.zl.domain.HGZL001;
import com.baosight.hggp.hg.zl.domain.HGZL001A;
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.ProjectInfo;
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.exception.PlatException;
import com.baosight.iplat4j.core.service.impl.ServiceEPBase;
import java.util.List;
import java.util.Map;
/**
* @author:songx
* @date:2024/1/25,15:25
*/
public class ServiceHGZL011A 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.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 ServiceHGZL011B 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());
HGZL011 newZl011 = BeanUtils.copy(dbKc008A, HGZL011.class);
newZl011.setQualityNo(SequenceGenerator.getNextSequence(HGConstant.SequenceId.SCLL_QUALITY_NO));
newZl011.setQualityDate(DateUtils.shortDate());
newZl011.setStatus(HgZlConst.HgZl011.Status.S0);
newZl011.setDeleteFlag(CommonConstant.YesNo.NO_0);
newZl011.setApplyQty(dbKc008A.getInvQty());
newZl011.setApplyUnitWeight(dbKc008A.getInvUnitWeight());
newZl011.setApplyWeight(dbKc008A.getInvWeight());
newZl011.setLength(dbKc008A.getInvLength());
newZl011.setWidth(dbKc008A.getInvWidth());
newZl011.setThick(dbKc008A.getInvThick());
newZl011.setSpecId(dbKc008A.getInvSpecId());
newZl011.setSpec(dbKc008A.getInvSpec());
DaoUtils.insert(HGZL011.INSERT, newZl011);
// 更新领用单状态
HGKCTools.HgKc008.updateStatus(fKc008A.getApplyCode(), HgKcConst.HgKc008.Status.S2);
// 更新领用单明细状态
HGKCTools.HgKc008A.updateStatus(fKc008A.getApplyLineCode(), HgKcConst.HgKc008.Status.S2);
}
}
}
...@@ -102,7 +102,6 @@ ...@@ -102,7 +102,6 @@
</isNotEmpty> </isNotEmpty>
</sql> </sql>
<sql id="idCondition"> <sql id="idCondition">
<isNotEmpty prepend=" AND " property="id"> <isNotEmpty prepend=" AND " property="id">
ID = #id# ID = #id#
......
<?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="HGZL011">
<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", <!-- 规格 -->
MATERIAL as "material", <!-- 材质 -->
UNIT as "unit", <!-- 单位 -->
LENGTH as "length", <!-- 长度 -->
WIDTH as "width", <!-- 宽度 -->
THICK as "thick", <!-- 厚度 -->
APPLY_QTY as "applyQty", <!-- 领料数量 -->
APPLY_UNIT_WEIGHT as "applyUnitWeight", <!-- 领料单重 -->
APPLY_WEIGHT as "applyWeight", <!-- 领料重量 -->
QUALITY_QTY as "qualityQty", <!-- 合格数量 -->
UN_QUALITY_QTY as "unQualityQty", <!-- 不合格数量 -->
INVENT_TYPE_DETAIL as "inventTypeDetail", <!-- 存货类型大类 -->
APPLY_CODE as "applyCode", <!-- 领料单号 -->
APPLY_LINE_CODE as "applyLineCode" <!-- 领料单行号 -->
</sql>
<sql id="condition">
AND DELETE_FLAG = 0
<include refid="idCondition"/>
<isNotEmpty prepend=" AND " property="accountCode">
ACCOUNT_CODE = #accountCode#
</isNotEmpty>
<isNotEmpty prepend=" AND " property="depCode">
DEP_CODE = #depCode#
</isNotEmpty>
<isNotEmpty prepend=" AND " property="createdBy">
CREATED_BY = #createdBy#
</isNotEmpty>
<isNotEmpty prepend=" AND " property="createdName">
CREATED_NAME = #createdName#
</isNotEmpty>
<isNotEmpty prepend=" AND " property="createdTime">
CREATED_TIME = #createdTime#
</isNotEmpty>
<isNotEmpty prepend=" AND " property="updatedBy">
UPDATED_BY = #updatedBy#
</isNotEmpty>
<isNotEmpty prepend=" AND " property="updatedName">
UPDATED_NAME = #updatedName#
</isNotEmpty>
<isNotEmpty prepend=" AND " property="updatedTime">
UPDATED_TIME = #updatedTime#
</isNotEmpty>
<isNotEmpty prepend=" AND " property="deleteFlag">
DELETE_FLAG = #deleteFlag#
</isNotEmpty>
<isNotEmpty prepend=" AND " property="status">
STATUS = #status#
</isNotEmpty>
<isNotEmpty prepend=" AND " property="qualityNo">
QUALITY_NO = #qualityNo#
</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="material">
MATERIAL = #material#
</isNotEmpty>
<isNotEmpty prepend=" AND " property="unit">
UNIT = #unit#
</isNotEmpty>
<isNotEmpty prepend=" AND " property="length">
LENGTH = #length#
</isNotEmpty>
<isNotEmpty prepend=" AND " property="width">
WIDTH = #width#
</isNotEmpty>
<isNotEmpty prepend=" AND " property="thick">
THICK = #thick#
</isNotEmpty>
<isNotEmpty prepend=" AND " property="qualityQty">
QUALITY_QTY = #qualityQty#
</isNotEmpty>
<isNotEmpty prepend=" AND " property="unQualityQty">
UN_QUALITY_QTY = #unQualityQty#
</isNotEmpty>
<isNotEmpty prepend=" AND " property="inventTypeDetail">
INVENT_TYPE_DETAIL = #inventTypeDetail#
</isNotEmpty>
<isNotEmpty prepend=" AND " property="applyLineCode">
APPLY_LINE_CODE = #applyLineCode#
</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">
ID asc
</isEmpty>
</dynamic>
</sql>
<select id="query" resultClass="com.baosight.hggp.hg.zl.domain.HGZL011">
SELECT
<include refid="column"/>
FROM ${hggpSchema}.HGZL011 WHERE 1=1
<include refid="condition"/>
<include refid="orderBy"/>
</select>
<select id="count" resultClass="int">
SELECT COUNT(*) FROM ${hggpSchema}.HGZL011 WHERE 1=1
<include refid="condition"/>
</select>
<insert id="insert">
INSERT INTO ${hggpSchema}.HGZL011 (
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, <!-- 规格 -->
MATERIAL, <!-- 材质 -->
UNIT, <!-- 单位 -->
LENGTH, <!-- 长度 -->
WIDTH, <!-- 宽度 -->
THICK, <!-- 厚度 -->
APPLY_QTY, <!-- 领料数量 -->
APPLY_UNIT_WEIGHT, <!-- 领料单重 -->
APPLY_WEIGHT, <!-- 领料重量 -->
QUALITY_QTY, <!-- 合格数量 -->
UN_QUALITY_QTY, <!-- 不合格数量 -->
INVENT_TYPE_DETAIL, <!-- 存货类型大类 -->
APPLY_CODE, <!-- 领料单号 -->
APPLY_LINE_CODE <!-- 领料单行号 -->
) VALUES (
#accountCode#, #depCode#, #createdBy#, #createdName#, #createdTime#, #updatedBy#,
#updatedName#, #updatedTime#, #deleteFlag#, #status#, #qualityNo#, #qualityDate#,
#companyCode#, #companyName#, #inventType#, #inventCode#, #inventName#, #specId#,
#spec#, #material#, #unit#, #length#, #width#, #thick#, #applyQty#, #applyUnitWeight#,
#applyWeight#, #qualityQty#, #unQualityQty#, #inventTypeDetail#, #applyCode#, #applyLineCode#
)
</insert>
<delete id="delete">
UPDATE ${hggpSchema}.HGZL011 SET DELETE_FLAG = 1 WHERE ID = #id#
</delete>
<update id="update">
UPDATE ${hggpSchema}.HGZL011
SET
QUALITY_DATE = #qualityDate#, <!-- 单据日期 -->
QUALITY_QTY = #qualityQty#, <!-- 合格数量 -->
UN_QUALITY_QTY = #unQualityQty#, <!-- 不合格数量 -->
<include refid="SqlBase.updateRevise"/>
WHERE ID = #id#
</update>
<!-- 行锁 -->
<update id="lock">
UPDATE ${hggpSchema}.HGZL011
SET CREATED_TIME = CREATED_TIME
WHERE 1=1
<include refid="idCondition"/>
</update>
<!-- 已处理 -->
<update id="process">
UPDATE ${hggpSchema}.HGZL011
SET
STATUS = #status#,
QUALITY_QTY = #qualityQty#, <!-- 合格数量 -->
UN_QUALITY_QTY = #unQualityQty#, <!-- 不合格数量 -->
<include refid="SqlBase.updateRevise"/>
WHERE QUALITY_NO = #qualityNo#
</update>
</sqlMap>
...@@ -10,6 +10,7 @@ import com.baosight.hggp.hg.constant.HGSqlConstant; ...@@ -10,6 +10,7 @@ import com.baosight.hggp.hg.constant.HGSqlConstant;
import com.baosight.hggp.hg.sc.domain.HGSC007; import com.baosight.hggp.hg.sc.domain.HGSC007;
import com.baosight.hggp.hg.sc.domain.HGSC008; import com.baosight.hggp.hg.sc.domain.HGSC008;
import com.baosight.hggp.hg.sc.tools.HGSCTools; import com.baosight.hggp.hg.sc.tools.HGSCTools;
import com.baosight.hggp.hg.zl.constant.HgZlSqlConst;
import com.baosight.hggp.hg.zl.domain.*; import com.baosight.hggp.hg.zl.domain.*;
import com.baosight.hggp.util.AssertUtils; import com.baosight.hggp.util.AssertUtils;
import com.baosight.iplat4j.ed.util.SequenceGenerator; import com.baosight.iplat4j.ed.util.SequenceGenerator;
...@@ -295,16 +296,92 @@ public class HGZLTools { ...@@ -295,16 +296,92 @@ public class HGZLTools {
List<HGZL004> results = DaoBase.getInstance().query(HGZL004.QUERY, paramMap); List<HGZL004> results = DaoBase.getInstance().query(HGZL004.QUERY, paramMap);
return CollectionUtils.isEmpty(results) ? null : results.get(0); return CollectionUtils.isEmpty(results) ? null : results.get(0);
} }
} }
public static class THGZL004A { public static class THGZL004A {
public static void deleteByInformIds(List<Long> informIds){
public static void deleteByInformIds(List<Long> informIds) {
AssertUtils.isEmpty(informIds, "通知单ID不能为空"); AssertUtils.isEmpty(informIds, "通知单ID不能为空");
DaoUtils.update(HGZL004A.DELETE_BY_INFORM_IDS,new HashMap<String,Object>(){{put("informIds",informIds);}}); DaoUtils.update(HGZL004A.DELETE_BY_INFORM_IDS, new HashMap<String, Object>() {{
put("informIds", informIds);
}});
} }
} }
/**
* HGZL011 定义
*
* @author:songx
* @date:2024/9/29,14:10
*/
public static class HgZl011 {
/**
* 锁
*
* @param qualityNo
* @return
*/
public static void lock(String qualityNo) {
AssertUtils.isEmpty(qualityNo, "质检单号不能为空");
Map paramMap = new HashMap();
paramMap.put("qualityNo", qualityNo);
DaoBase.getInstance().update(HgZlSqlConst.HgZl011.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.HgZl011.LOCK, paramMap);
}
/**
* 查询
*
* @param qualityNo
*/
public static HGZL011 get(String qualityNo) {
AssertUtils.isEmpty(qualityNo, "质检单号不能为空");
Map paramMap = new HashMap();
paramMap.put(HGZL011.FIELD_QUALITY_NO, qualityNo);
List<HGZL011> results = DaoBase.getInstance().query(HGZL011.QUERY, paramMap);
return CollectionUtils.isEmpty(results) ? null : results.get(0);
}
/**
* 查询
*
* @param qualityNos
* @return
*/
public static List<HGZL011> list(List<String> qualityNos) {
AssertUtils.isEmpty(qualityNos, "质检单号不能为空");
Map<String, Object> paramMap = new HashMap();
paramMap.put("qualityNos", qualityNos);
return DaoBase.getInstance().query(HGZL011.QUERY, paramMap);
}
/**
* 查询
*
* @param qualityNos
* @return
*/
public static Map<String, HGZL011> map(List<String> qualityNos) {
List<HGZL011> results = list(qualityNos);
return results.stream().collect(Collectors.toMap(HGZL011::getQualityNo, item -> item));
}
}
} }
...@@ -2,6 +2,7 @@ package com.baosight.hggp.hg.zl.utils; ...@@ -2,6 +2,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.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;
...@@ -63,4 +64,67 @@ public class HGZLUtils { ...@@ -63,4 +64,67 @@ public class HGZLUtils {
return HGZLTools.HgZl001.map(checkNos); return HGZLTools.HgZl001.map(checkNos);
} }
} }
/**
* HGZL001 工具类
*
* @author:songx
* @date:2024/5/9,16:58
*/
public static class HgZl011 {
/**
* 设置查询条件
*
* @param queryRow 集合
* @return
*/
public static void setCondition(Map queryRow) {
HGUtils.setCondition(queryRow);
// 单据日期
String qualityDate = MapUtils.getString(queryRow, HGZL011.FIELD_QUALITY_DATE);
if (StringUtils.isNotBlank(qualityDate)) {
queryRow.put(HGZL011.FIELD_QUALITY_DATE, DateUtils.formatShort(qualityDate));
}
}
/**
* 锁并且获取数据
*
* @param qualityNo
* @return
*/
public static HGZL011 lockGetData(String qualityNo) {
// 锁
HGZLTools.HgZl011.lock(qualityNo);
// db数据
return HGZLTools.HgZl011.get(qualityNo);
}
/**
* 锁并且获取数据
*
* @param fZl011s
* @return
*/
public static Map<String, HGZL011> lockGetDataEp(List<? extends HGZL011> fZl011s) {
return lockGetData(ObjectUtils.listEpKey(fZl011s, HGZL011.FIELD_QUALITY_NO));
}
/**
* 锁并且获取数据
*
* @param qualityNos
* @return
*/
public static Map<String, HGZL011> lockGetData(List<String> qualityNos) {
// 锁
HGZLTools.HgZl011.lock(qualityNos);
// db数据
return HGZLTools.HgZl011.map(qualityNos);
}
}
} }
...@@ -49,6 +49,7 @@ ...@@ -49,6 +49,7 @@
<sqlMap resource="com/baosight/hggp/hg/kc/sql/HGKC007.xml"/> <sqlMap resource="com/baosight/hggp/hg/kc/sql/HGKC007.xml"/>
<sqlMap resource="com/baosight/hggp/hg/kc/sql/HGKC007A.xml"/> <sqlMap resource="com/baosight/hggp/hg/kc/sql/HGKC007A.xml"/>
<sqlMap resource="com/baosight/hggp/hg/kc/sql/HGKC008.xml"/> <sqlMap resource="com/baosight/hggp/hg/kc/sql/HGKC008.xml"/>
<sqlMap resource="com/baosight/hggp/hg/kc/sql/HGKC008A.xml"/>
<sqlMap resource="com/baosight/hggp/hg/kc/sql/HGKC010.xml"/> <sqlMap resource="com/baosight/hggp/hg/kc/sql/HGKC010.xml"/>
<sqlMap resource="com/baosight/hggp/hg/kc/sql/HGKC010A.xml"/> <sqlMap resource="com/baosight/hggp/hg/kc/sql/HGKC010A.xml"/>
<sqlMap resource="com/baosight/hggp/hg/kc/sql/HGKC011.xml"/> <sqlMap resource="com/baosight/hggp/hg/kc/sql/HGKC011.xml"/>
...@@ -61,6 +62,7 @@ ...@@ -61,6 +62,7 @@
<sqlMap resource="com/baosight/hggp/hg/zl/sql/HGZL003.xml"/> <sqlMap resource="com/baosight/hggp/hg/zl/sql/HGZL003.xml"/>
<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/sc/sql/HGSC001.xml"/> <sqlMap resource="com/baosight/hggp/hg/sc/sql/HGSC001.xml"/>
......
...@@ -15,7 +15,7 @@ $(function () { ...@@ -15,7 +15,7 @@ $(function () {
e.response.docType = docName.substring(index + 1); e.response.docType = docName.substring(index + 1);
} }
try { try {
parent.JSColorbox.setValueCallback(e); uploadFile(e);
} catch (e) { } catch (e) {
} }
}, },
...@@ -23,4 +23,30 @@ $(function () { ...@@ -23,4 +23,30 @@ $(function () {
}; };
}); });
/**
* 附件上传回调
*
* @param docId
*/
function uploadFile(e) {
let inInfo = new EiInfo();
inInfo.set("result-0-bizId", $("#inqu_status-0-bizId").val());
inInfo.set("result-0-bizType", $("#inqu_status-0-bizType").val());
inInfo.set("result-0-docId", e.response.docId);
inInfo.set("result-0-docName", e.response.docName);
inInfo.set("result-0-docType", e.response.docType);
EiCommunicator.send('HGDM099', 'upload', inInfo, {
onSuccess(res) {
if (res.status > -1) {
parent.JSColorbox.setValueCallback(e);
} else {
message(res.msg);
}
},
onFail(errorMessage, status, e) {
NotificationUtil("执行失败!", "error");
}
}, {
async: false
});
}
...@@ -7,6 +7,8 @@ ...@@ -7,6 +7,8 @@
<EF:EFPage title="附件上传"> <EF:EFPage title="附件上传">
<EF:EFRegion id="result" title="请选择文件"> <EF:EFRegion id="result" title="请选择文件">
<EF:EFInput ename="bizId" cname="业务ID" blockId="inqu_status" row="0" type="hidden"/>
<EF:EFInput ename="bizType" cname="业务类型" blockId="inqu_status" row="0" type="hidden"/>
<EF:EFUpload blockId="result" ename="uploadFile" docTag="fj_file" path="biz"/> <EF:EFUpload blockId="result" ename="uploadFile" docTag="fj_file" path="biz"/>
</EF:EFRegion> </EF:EFRegion>
</EF:EFPage> </EF:EFPage>
...@@ -25,12 +25,16 @@ ...@@ -25,12 +25,16 @@
<EF:EFInput ename="inqu_status-0-inventName" cname="存货名称" colWidth="3"/> <EF:EFInput ename="inqu_status-0-inventName" cname="存货名称" colWidth="3"/>
</div> </div>
</EF:EFRegion> </EF:EFRegion>
<EF:EFRegion id="result" title="记录集"> <EF:EFRegion id="result" title="记录集">
<EF:EFGrid blockId="result" autoDraw="no" isFloat="true" copyToAdd="false" checkMode="row"> <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="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:EFCodeOption codeName="hggp.hgkc.ScllStatus"/>
</EF:EFComboColumn>
<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"
...@@ -61,6 +65,8 @@ ...@@ -61,6 +65,8 @@
displayType="0.000" sort="true" align="right" maxLength="17" required="false" defaultValue="0" displayType="0.000" sort="true" align="right" maxLength="17" required="false" defaultValue="0"
data-regex="/^-?[0-9]{1,17}([.][0-9]{1,3})?$/" data-regex="/^-?[0-9]{1,17}([.][0-9]{1,3})?$/"
data-errorprompt="请输入数字,该值最大可设置17位整数和3位小数!"/> data-errorprompt="请输入数字,该值最大可设置17位整数和3位小数!"/>
<EF:EFColumn ename="applyLineCode" cname="领料单行号" enable="false" width="130" align="center"/>
<EF:EFColumn ename="qualityNo" cname="质检单号" enable="false" width="120" align="center"/>
</EF:EFGrid> </EF:EFGrid>
</EF:EFRegion> </EF:EFRegion>
</EF:EFPage> </EF:EFPage>
$(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: "HGZL011A",
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", "HGZL011", "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="inqu_status-0-spec" colWidth="3" filter="contains" optionLabel="全部"
defultValue="">
<EF:EFOptions blockId="spec_name_block_id" textField="textField" valueField="valueField"/>
</EF:EFSelect>
</div>
<div class="row">
<EF: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>
<EF:EFInput cname="领料单号" ename="applyCode" 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('HGZL011', '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", "HGXS007A", "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="SCLL_QUALITY_PROBLEM"/>
<EF:EFOption label="处理照片" value="SCLL_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">
<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", "HGZL011B", "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="applyCode" 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="内码" hidden="true"/>
<EF:EFColumn ename="applyLineCode" cname="领料单行号" 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:EFComboColumn ename="inventType" cname="存货类型" width="120" align="center"
blockName="invent_type_box_block_id" textField="textField" valueField="valueField"
columnTemplate="#=textField#" itemTemplate="#=textField#" readonly="true" enable="false"
filter="contains">
</EF:EFComboColumn>
<EF:EFColumn ename="inventTypeDetail" cname="存货类型大类" hidden="true"/>
<EF:EFColumn ename="invSpecId" cname="规格id" hidden="true"/>
<EF:EFColumn ename="invSpec" cname="规格" width="120" align="center" enable="false"/>
<EF:EFColumn ename="invLength" cname="长度(MM)" width="120" align="center" enable="false"/>
<EF:EFColumn ename="invWidth" cname="宽度(MM)" width="120" align="center" enable="false"/>
<EF:EFColumn ename="invThick" cname="厚度(MM)" width="120" align="center" enable="false"/>
<EF:EFColumn ename="invQty" cname="数量" width="120" align="right" format="{0:N3}" enable="true"
/>
<EF:EFColumn ename="invUnitWeight" cname="单重(KG)" enable="false" width="100" align="right" format="{0:N3}"
sort="true"/>
<EF:EFColumn ename="invWeight" cname="重量" enable="false" width="100" align="right" format="{0:N3}"
sort="true"/>
</EF:EFGrid>
</EF:EFRegion>
</EF:EFPage>
...@@ -248,7 +248,7 @@ let deptCodeChange = function (e) { ...@@ -248,7 +248,7 @@ let deptCodeChange = function (e) {
} }
function refreshQuery() { function refreshQuery() {
// resultGrid.dataSource.page(1); resultGrid.dataSource.page(1);
} }
const flashUser = (userGroup) => { const flashUser = (userGroup) => {
......
...@@ -27,8 +27,8 @@ ...@@ -27,8 +27,8 @@
required="true"> required="true">
<EF:EFCodeOption codeName="hggp.role.dataAuthType"/> <EF:EFCodeOption codeName="hggp.role.dataAuthType"/>
</EF:EFComboColumn> </EF:EFComboColumn>
<EF:EFComboColumn ename="depCode" cname="所属部门编码" width="110" align="center" <EF:EFComboColumn ename="depCode" cname="所属部门编码" width="150" align="center"
defaultValue="" filter="contains" required="true" defaultValue="" filter="contains"
columnTemplate="#=valueField#"> columnTemplate="#=valueField#">
<EF:EFOptions blockId="dept_code_block_id" valueField="valueField" textField="textField"/> <EF:EFOptions blockId="dept_code_block_id" valueField="valueField" textField="textField"/>
</EF:EFComboColumn> </EF:EFComboColumn>
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment