Commit 0232928a by liulei

移动端接口优化、产品模板需求

parent 55135f43
...@@ -252,6 +252,50 @@ public enum DdynamicEnum { ...@@ -252,6 +252,50 @@ public enum DdynamicEnum {
FACTORY_CODE_BLOCK_ID("factory_code_block_id","factoryCode","factoryName","HPXS001.queryFactoryCode"), FACTORY_CODE_BLOCK_ID("factory_code_block_id","factoryCode","factoryName","HPXS001.queryFactoryCode"),
/** /**
* 模块:巡检填报APP下拉
* 用途:巡检填报APP下拉查询
* 编写:ll
*/
APP_MAP_BLOCK_FACTORY("app_map_block_factory","factoryCode","factoryName","HPMT002.queryFactory"),
/**
* 模块:巡检填报APP下拉
* 用途:巡检填报APP下拉查询
* 编写:ll
*/
APP_MAP_BLOCK_ORG_NO("app_map_block_org_no","orgNo","orgName","HPMT002.queryOrgNo"),
/**
* 模块:巡检填报APP下拉
* 用途:巡检填报APP下拉查询
* 编写:ll
*/
APP_MAP_BLOCK_PROJCODE("app_map_block_projcode","projCode","projName","HPMT002.queryProjCode"),
/**
* 模块:巡检填报APP下拉
* 用途:巡检填报APP下拉查询
* 编写:ll
*/
APP_MAP_BLOCK_PRDTCODE("app_map_block_prdtcode","prdtCode","prdtName","HPMT002.queryPrdtCode"),
/**
* 模块:巡检填报APP下拉
* 用途:巡检填报APP下拉查询
* 编写:ll
*/
APP_MAP_BLOCK_PARTCODE("app_map_block_partcode","partCode","partName","HPMT002.queryPartCode"),
/**
* 模块:巡检填报APP下拉
* 用途:巡检填报APP下拉查询
* 编写:ll
*/
APP_MAP_BLOCK_PRODTASKNO("app_map_block_prodtaskno","prodTaskNo","prodorderNo","HPMT002.queryProdTaskNo");
FACTORY_CODE_BLOCK_ID("factory_code_block_id","factoryCode","factoryName","HPXS001.queryFactoryCode"),
/**
* 模块:工人管理 * 模块:工人管理
* 用途:工人管理下拉框 * 用途:工人管理下拉框
* 编写:wwl * 编写:wwl
......
...@@ -48,8 +48,7 @@ public class ServiceHPMT001 extends ServiceBase { ...@@ -48,8 +48,7 @@ public class ServiceHPMT001 extends ServiceBase {
* @return * @return
*/ */
public EiInfo pmOverview(EiInfo inInfo) { public EiInfo pmOverview(EiInfo inInfo) {
Map queryMap = EiInfoUtils.getFirstRow(inInfo); String queryMonth = inInfo.getString("queryMonth");
String queryMonth = MapUtils.getString(queryMap, "queryMonth");
String companyCode = UserSessionUtils.getCompanyCode(); String companyCode = UserSessionUtils.getCompanyCode();
if (StrUtil.isEmpty(companyCode)) { if (StrUtil.isEmpty(companyCode)) {
inInfo.setMsg("账号异常"); inInfo.setMsg("账号异常");
...@@ -86,8 +85,7 @@ public class ServiceHPMT001 extends ServiceBase { ...@@ -86,8 +85,7 @@ public class ServiceHPMT001 extends ServiceBase {
* @return * @return
*/ */
public EiInfo pmBenchmarking(EiInfo inInfo) { public EiInfo pmBenchmarking(EiInfo inInfo) {
Map queryMap = EiInfoUtils.getFirstRow(inInfo); String queryMonth = inInfo.getString("queryMonth");
String queryMonth = MapUtils.getString(queryMap, "queryMonth");
String companyCode = UserSessionUtils.getCompanyCode(); String companyCode = UserSessionUtils.getCompanyCode();
if (StrUtil.isEmpty(companyCode)) { if (StrUtil.isEmpty(companyCode)) {
inInfo.setMsg("账号异常"); inInfo.setMsg("账号异常");
......
package com.baosight.hpjx.hp.mt.service; package com.baosight.hpjx.hp.mt.service;
import cn.hutool.core.util.PageUtil;
import cn.hutool.core.util.StrUtil; import cn.hutool.core.util.StrUtil;
import com.baosight.hpjx.common.DdynamicEnum; import com.baosight.hpjx.common.DdynamicEnum;
import com.baosight.hpjx.core.constant.CommonConstant; import com.baosight.hpjx.core.constant.CommonConstant;
...@@ -64,29 +65,57 @@ public class ServiceHPMT002 extends ServiceBase { ...@@ -64,29 +65,57 @@ public class ServiceHPMT002 extends ServiceBase {
* @return * @return
*/ */
public EiInfo pmProject(EiInfo inInfo) { public EiInfo pmProject(EiInfo inInfo) {
Map queryMap = EiInfoUtils.getFirstRow(inInfo); String projName = inInfo.getString("projName");
int offset = inInfo.getInt("offset");//当前页
int pageSize = inInfo.getInt("pageSize");//每页条数
String companyCode = UserSessionUtils.getCompanyCode(); String companyCode = UserSessionUtils.getCompanyCode();
if (StrUtil.isEmpty(companyCode)) { if (StrUtil.isEmpty(companyCode)) {
inInfo.setMsg("账号异常"); inInfo.setMsg("账号异常");
} }
Map sqlMap = new HashMap(); Map sqlMap = new HashMap();
sqlMap.put("companyCode", companyCode); sqlMap.put("companyCode", companyCode);
sqlMap.put("projName", projName);
List count = this.dao.query("HPMT002.pmProjectCount", sqlMap);
offset=(offset-1)*pageSize;
sqlMap.put("offset", offset);
sqlMap.put("pageSize", pageSize);
List<Map> rows = this.dao.query("HPMT002.pmProject", sqlMap); List<Map> rows = this.dao.query("HPMT002.pmProject", sqlMap);
EiInfo outInfo = new EiInfo(); EiInfo outInfo = new EiInfo();
EiBlock eiBlock = new EiBlock(EiConstant.resultBlock); EiBlock eiBlock = new EiBlock(EiConstant.resultBlock);
eiBlock.setRows(rows); eiBlock.setRows(rows);
outInfo.setBlock(eiBlock); outInfo.setBlock(eiBlock);
outInfo.set("count",count.get(0));
return outInfo; return outInfo;
} }
/** /**
* 生产管理-项⽬跟踪总数
*
* @param inInfo
* @return
*/
public EiInfo pmProjectCount(EiInfo inInfo) {
String projName = inInfo.getString("projName");
String companyCode = UserSessionUtils.getCompanyCode();
if (StrUtil.isEmpty(companyCode)) {
inInfo.setMsg("账号异常");
}
Map sqlMap = new HashMap();
sqlMap.put("companyCode", companyCode);
sqlMap.put("projName", projName);
int count = this.dao.count("HPMT002.pmProjectCount", sqlMap);
inInfo.set("count", count);
return inInfo;
}
/**
* 生产管理-质量分析报表 * 生产管理-质量分析报表
* *
* @param inInfo * @param inInfo
* @return * @return
*/ */
public EiInfo pmQuality(EiInfo inInfo) { public EiInfo pmQuality(EiInfo inInfo) {
Map queryMap = EiInfoUtils.getFirstRow(inInfo); String queryMonth = inInfo.getString("queryMonth");
String companyCode = UserSessionUtils.getCompanyCode(); String companyCode = UserSessionUtils.getCompanyCode();
if (StrUtil.isEmpty(companyCode)) { if (StrUtil.isEmpty(companyCode)) {
inInfo.setMsg("账号异常"); inInfo.setMsg("账号异常");
...@@ -109,18 +138,27 @@ public class ServiceHPMT002 extends ServiceBase { ...@@ -109,18 +138,27 @@ public class ServiceHPMT002 extends ServiceBase {
*/ */
public EiInfo pmQualityList(EiInfo inInfo) { public EiInfo pmQualityList(EiInfo inInfo) {
String status = inInfo.getString("status"); String status = inInfo.getString("status");
String projName = inInfo.getString("projName");
int offset = inInfo.getInt("offset");//当前页
int pageSize = inInfo.getInt("pageSize");//每页条数
String companyCode = UserSessionUtils.getCompanyCode(); String companyCode = UserSessionUtils.getCompanyCode();
if (StrUtil.isEmpty(companyCode)) { if (StrUtil.isEmpty(companyCode)) {
inInfo.setMsg("账号异常"); inInfo.setMsg("账号异常");
} }
Map sqlMap = new HashMap(); Map sqlMap = new HashMap();
sqlMap.put("companyCode", companyCode); sqlMap.put("companyCode", companyCode);
sqlMap.put("projName", projName);
sqlMap.put("status", status); sqlMap.put("status", status);
List count = this.dao.query("HPMT002.pmQualityCount", sqlMap);
offset=(offset-1)*pageSize;
sqlMap.put("offset", offset);
sqlMap.put("pageSize", pageSize);
List<Map> rows = this.dao.query("HPMT002.pmQualityList", sqlMap); List<Map> rows = this.dao.query("HPMT002.pmQualityList", sqlMap);
EiInfo outInfo = new EiInfo(); EiInfo outInfo = new EiInfo();
EiBlock eiBlock = new EiBlock(EiConstant.resultBlock); EiBlock eiBlock = new EiBlock(EiConstant.resultBlock);
eiBlock.setRows(rows); eiBlock.setRows(rows);
outInfo.setBlock(eiBlock); outInfo.setBlock(eiBlock);
outInfo.set("count", count.get(0));
return outInfo; return outInfo;
} }
...@@ -180,7 +218,7 @@ public class ServiceHPMT002 extends ServiceBase { ...@@ -180,7 +218,7 @@ public class ServiceHPMT002 extends ServiceBase {
String prodCode = inInfo.getString("projCode");//项目id String prodCode = inInfo.getString("projCode");//项目id
String orgNo = inInfo.getString("orgNo");//生产组id String orgNo = inInfo.getString("orgNo");//生产组id
String inventCode = inInfo.getString("inventCode");//部件id String inventCode = inInfo.getString("inventCode");//部件id
String subInventCode = inInfo.getString("subInventCode");//件id String subInventCode = inInfo.getString("subInventCode");//件id
String companyCode = UserSessionUtils.getCompanyCode(); String companyCode = UserSessionUtils.getCompanyCode();
if (StrUtil.isEmpty(companyCode)) { if (StrUtil.isEmpty(companyCode)) {
inInfo.setMsg("账号异常"); inInfo.setMsg("账号异常");
...@@ -194,13 +232,15 @@ public class ServiceHPMT002 extends ServiceBase { ...@@ -194,13 +232,15 @@ public class ServiceHPMT002 extends ServiceBase {
sqlMap.put("subInventCode", subInventCode); sqlMap.put("subInventCode", subInventCode);
EiInfo outInfo = new EiInfo(); EiInfo outInfo = new EiInfo();
TEDCM01 tedcm01 = new TEDCM01(); TEDCM01 tedcm01 = new TEDCM01();
CommonMethod.initBlock(outInfo, Arrays.asList(DdynamicEnum.FACTORY_RECORD_BLOCK_ID), null, false); CommonMethod.initBlock(outInfo, Arrays.asList(DdynamicEnum.APP_MAP_BLOCK_FACTORY), null, false);
CommonMethod.initBlock(outInfo, Arrays.asList(DdynamicEnum.PROJ_PRODQUERY_BLOCK_ID), sqlMap, false); CommonMethod.initBlock(outInfo, Arrays.asList(DdynamicEnum.APP_MAP_BLOCK_PROJCODE), sqlMap, false);
CommonMethod.initBlock(outInfo, Arrays.asList(DdynamicEnum.PROJ_QUERYPROD_BLOCK_ID), sqlMap, false); CommonMethod.initBlock(outInfo, Arrays.asList(DdynamicEnum.APP_MAP_BLOCK_PRDTCODE), sqlMap, false);
CommonMethod.initBlock(outInfo, Arrays.asList(DdynamicEnum.INVENT_RECORD_BLOCK_ID), sqlMap, false); CommonMethod.initBlock(outInfo, Arrays.asList(DdynamicEnum.APP_MAP_BLOCK_ORG_NO), sqlMap, false);
CommonMethod.initBlock(outInfo, Arrays.asList(DdynamicEnum.GROUP_PRO_BLOCK_ID), sqlMap, false); CommonMethod.initBlock(outInfo, Arrays.asList(DdynamicEnum.APP_MAP_BLOCK_PARTCODE), sqlMap, false);
CommonMethod.initBlock(outInfo, Arrays.asList(DdynamicEnum.SUB_INVENT_RECORD_BLOCK_ID), sqlMap, false);
CommonMethod.initBlock(outInfo, Arrays.asList(DdynamicEnum.POOR_TYPE_BLOCK_ID), null, false); CommonMethod.initBlock(outInfo, Arrays.asList(DdynamicEnum.POOR_TYPE_BLOCK_ID), null, false);
if(subInventCode!=null&&!subInventCode.equals("")){
CommonMethod.initBlock(outInfo, Arrays.asList(DdynamicEnum.APP_MAP_BLOCK_PRODTASKNO), sqlMap, false);
}
return outInfo; return outInfo;
} }
......
...@@ -38,17 +38,33 @@ ...@@ -38,17 +38,33 @@
PARENT_ID = hpjx.T_HPSC003.PLAN_INFO_NO PARENT_ID = hpjx.T_HPSC003.PLAN_INFO_NO
) AS "num" <!-- 计划数量 --> ) AS "num" <!-- 计划数量 -->
FROM hpjx.T_HPSC003 WHERE COMPANY_CODE= #companyCode# FROM hpjx.T_HPSC003 WHERE COMPANY_CODE= #companyCode#
<isNotEmpty prepend=" AND " property="projName">
PROJ_NAME LIKE CONCAT('%', #projName#, '%')
</isNotEmpty>
order by STATUS,PLAN_COMPLETION_DATE
limit #offset#, #pageSize#
</select> </select>
<select id="pmProjectCount" resultClass="int">
SELECT
COUNT(*)
FROM hpjx.T_HPSC003 WHERE COMPANY_CODE= #companyCode#
<isNotEmpty prepend=" AND " property="projName">
PROJ_NAME LIKE CONCAT('%', #projName#, '%')
</isNotEmpty>
</select>
<select id="pmQuality" resultClass="java.util.HashMap"> <select id="pmQuality" resultClass="java.util.HashMap">
SELECT SELECT
POOR_TYPE,<!-- 不良品类 --> POOR_TYPE,<!-- 不良品类 -->
COUNT(POOR_TYPE) AS POOR_TYPE_NUM,<!-- 单种不良品类数量 --> COUNT(POOR_TYPE) AS POOR_TYPE_NUM,<!-- 单种不良品类数量 -->
CONCAT( FORMAT(COUNT(POOR_TYPE)/ ( CONCAT( FORMAT(COUNT(POOR_TYPE)/ (
SELECT COUNT(*) FROM hpjx.t_hpzl001 WHERE SELECT COUNT(*) FROM hpjx.t_hpzl001 WHERE
COMPANY_CODE=#companyCode# )* 100,2),'%') AS NUM, COMPANY_CODE=#companyCode#
<isNotEmpty prepend=" AND " property="queryMonth">
SUBSTR(CREATED_TIME,1,6) = #queryMonth#
</isNotEmpty>
and SUBSTR(CREATED_TIME,1,6) = #queryMonth# )* 100,2),'%') AS NUM,
ITEM_CNAME AS ITEM_CNAME ITEM_CNAME AS ITEM_CNAME
FROM hpjx.t_hpzl001 A LEFT JOIN ( FROM hpjx.t_hpzl001 A LEFT JOIN (
SELECT SELECT
...@@ -58,6 +74,9 @@ ...@@ -58,6 +74,9 @@
WHERE CODESET_CODE = 'hpjx.hpjx.poorType' WHERE CODESET_CODE = 'hpjx.hpjx.poorType'
) B ON A.POOR_TYPE =B.ITEM_CODE ) B ON A.POOR_TYPE =B.ITEM_CODE
WHERE COMPANY_CODE= #companyCode# AND DELETE_FLAG =0 WHERE COMPANY_CODE= #companyCode# AND DELETE_FLAG =0
<isNotEmpty prepend=" AND " property="queryMonth">
SUBSTR(CREATED_TIME,1,6) = #queryMonth#
</isNotEmpty>
GROUP BY POOR_TYPE GROUP BY POOR_TYPE
</select> </select>
...@@ -88,6 +107,21 @@ ...@@ -88,6 +107,21 @@
WHERE CODESET_CODE = 'hpjx.hpjx.poorType' WHERE CODESET_CODE = 'hpjx.hpjx.poorType'
) B ON A.POOR_TYPE =B.ITEM_CODE ) B ON A.POOR_TYPE =B.ITEM_CODE
WHERE COMPANY_CODE= #companyCode# AND STATUS=#status# AND DELETE_FLAG =0 WHERE COMPANY_CODE= #companyCode# AND STATUS=#status# AND DELETE_FLAG =0
<isNotEmpty prepend=" AND " property="projName">
PROJ_NAME LIKE CONCAT('%', #projName#, '%')
</isNotEmpty>
order by STATUS
limit #offset#, #pageSize#
</select>
<select id="pmQualityCount" resultClass="int">
SELECT
COUNT(*)
FROM hpjx.t_hpzl001
WHERE COMPANY_CODE= #companyCode# AND STATUS=#status# AND DELETE_FLAG =0
<isNotEmpty prepend=" AND " property="projName">
PROJ_NAME LIKE CONCAT('%', #projName#, '%')
</isNotEmpty>
</select> </select>
<select id="pmQualityDetail" resultClass="java.util.HashMap"> <select id="pmQualityDetail" resultClass="java.util.HashMap">
...@@ -121,6 +155,7 @@ ...@@ -121,6 +155,7 @@
) B ON A.POOR_TYPE =B.ITEM_CODE ) B ON A.POOR_TYPE =B.ITEM_CODE
WHERE COMPANY_CODE= #companyCode# WHERE COMPANY_CODE= #companyCode#
AND DELETE_FLAG = 0 AND ID = #id# AND DELETE_FLAG = 0 AND ID = #id#
order by STATUS
</select> </select>
<insert id="insert"> <insert id="insert">
...@@ -162,4 +197,116 @@ ...@@ -162,4 +197,116 @@
SELECT CHG_NAME FROM iplat.TEUDM02 where DOC_ID=#docId# SELECT CHG_NAME FROM iplat.TEUDM02 where DOC_ID=#docId#
</select> </select>
<select id="queryFactory" resultClass="java.util.HashMap">
SELECT DISTINCT
B.FACTORY_CODE as "factoryCode",
B.FACTORY_NAME as "factoryName"
FROM HPJX.`t_hpsc005` A LEFT JOIN (
SELECT * FROM HPJX.`t_hpsc005a` WHERE COMPANY_CODE=#companyCode#
) B ON A.PROD_ORDER_NO=B.PROD_ORDER_NO WHERE A.COMPANY_CODE=#companyCode#
AND A.STATUS IN('1','2') AND B.NUM!=B.COMPLETE_NUM
</select>
<select id="queryOrgNo" resultClass="java.util.HashMap">
SELECT DISTINCT
B.ORG_NO as "orgNo",
B.ORG_NAME as "orgName"
FROM HPJX.`t_hpsc005` A LEFT JOIN (
SELECT * FROM HPJX.`t_hpsc005a` WHERE COMPANY_CODE=#companyCode#
) B ON A.PROD_ORDER_NO=B.PROD_ORDER_NO WHERE A.COMPANY_CODE=#companyCode#
AND A.STATUS IN('1','2') AND B.NUM!=B.COMPLETE_NUM
<isNotEmpty prepend=" AND " property="factoryCode">
B.FACTORY_CODE = #factoryCode#
</isNotEmpty>
</select>
<select id="queryProjCode" resultClass="java.util.HashMap">
SELECT DISTINCT
A.PROJ_CODE as "projCode",
A.PROJ_NAME as "projName"
FROM HPJX.`t_hpsc005` A LEFT JOIN (
SELECT * FROM HPJX.`t_hpsc005a` WHERE COMPANY_CODE=#companyCode#
) B ON A.PROD_ORDER_NO=B.PROD_ORDER_NO WHERE A.COMPANY_CODE=#companyCode#
AND A.STATUS IN('1','2') AND B.NUM!=B.COMPLETE_NUM
<isNotEmpty prepend=" AND " property="factoryCode">
B.FACTORY_CODE = #factoryCode#
</isNotEmpty>
<isNotEmpty prepend=" AND " property="orgNo">
B.ORG_NO = #orgNo#
</isNotEmpty>
</select>
<select id="queryPrdtCode" resultClass="java.util.HashMap">
SELECT DISTINCT
A.PRDT_CODE as "prdtCode",
CONCAT(A.PRDT_NAME,'-',A.PRDT_SPEC) as "prdtName"
FROM HPJX.`t_hpsc005` A LEFT JOIN (
SELECT * FROM HPJX.`t_hpsc005a` WHERE COMPANY_CODE=#companyCode#
) B ON A.PROD_ORDER_NO=B.PROD_ORDER_NO WHERE A.COMPANY_CODE=#companyCode#
AND A.STATUS IN('1','2') AND B.NUM!=B.COMPLETE_NUM
<isNotEmpty prepend=" AND " property="factoryCode">
B.FACTORY_CODE = #factoryCode#
</isNotEmpty>
<isNotEmpty prepend=" AND " property="orgNo">
B.ORG_NO = #orgNo#
</isNotEmpty>
<isNotEmpty prepend=" AND " property="prodCode">
A.PROJ_CODE = #prodCode#
</isNotEmpty>
</select>
<select id="queryPartCode" resultClass="java.util.HashMap">
SELECT DISTINCT
A.PART_CODE as "partCode",
CONCAT(A.PART_NAME,'-',A.PART_SPEC) as "partName"
FROM HPJX.`t_hpsc005` A LEFT JOIN (
SELECT * FROM HPJX.`t_hpsc005a` WHERE COMPANY_CODE=#companyCode#
) B ON A.PROD_ORDER_NO=B.PROD_ORDER_NO WHERE A.COMPANY_CODE=#companyCode#
AND A.STATUS IN('1','2') AND B.NUM!=B.COMPLETE_NUM
<isNotEmpty prepend=" AND " property="factoryCode">
B.FACTORY_CODE = #factoryCode#
</isNotEmpty>
<isNotEmpty prepend=" AND " property="orgNo">
B.ORG_NO = #orgNo#
</isNotEmpty>
<isNotEmpty prepend=" AND " property="prodCode">
A.PROJ_CODE = #prodCode#
</isNotEmpty>
<isNotEmpty prepend=" AND " property="parentPrdtCode">
A.PRDT_CODE = #parentPrdtCode#
</isNotEmpty>
</select>
<select id="queryProdTaskNo" resultClass="java.util.HashMap">
SELECT DISTINCT
B.PROD_TASK_NO as "prodTaskNo",
B.PROD_ORDER_NO as "prodorderNo"
FROM HPJX.`t_hpsc005` A LEFT JOIN (
SELECT * FROM HPJX.`t_hpsc005a` WHERE COMPANY_CODE=#companyCode#
) B ON A.PROD_ORDER_NO=B.PROD_ORDER_NO WHERE A.COMPANY_CODE=#companyCode#
AND A.STATUS IN('1','2') AND B.NUM!=B.COMPLETE_NUM
<isNotEmpty prepend=" AND " property="factoryCode">
B.FACTORY_CODE = #factoryCode#
</isNotEmpty>
<isNotEmpty prepend=" AND " property="orgNo">
B.ORG_NO = #orgNo#
</isNotEmpty>
<isNotEmpty prepend=" AND " property="prodCode">
A.PROJ_CODE = #prodCode#
</isNotEmpty>
<isNotEmpty prepend=" AND " property="parentPrdtCode">
A.PRDT_CODE = #parentPrdtCode#
</isNotEmpty>
<isNotEmpty prepend=" AND " property="subInventCode">
A.PART_CODE = #subInventCode#
</isNotEmpty>
LIMIT 1
</select>
</sqlMap> </sqlMap>
package com.baosight.hpjx.hp.pz.domain;
import com.baosight.iplat4j.core.util.NumberUtils;
import com.baosight.iplat4j.core.ei.EiColumn;
import com.baosight.iplat4j.core.data.DaoEPBase;
import java.util.HashMap;
import java.util.Map;
import com.baosight.iplat4j.core.util.StringUtils;
/**
* Project: <br>
* Title:HPPZ015.java <br>
* Description: <br>
*
* Copyrigth:Baosight Software LTD.co Copyright (c) 2019. <br>
*
* @version 1.0
* @history 2024-03-11 9:59:34 create
*/
public class HPPZ015 extends DaoEPBase {
private static final long serialVersionUID = 1L;
public static final String FIELD_ID = "id"; /* ID*/
public static final String FIELD_COMPANY_CODE = "companyCode"; /* 企业编码 预留*/
public static final String FIELD_DEP_CODE = "depCode"; /* 部门编码 预留*/
public static final String FIELD_PROJ_CODE = "projCode"; /* 项目编码*/
public static final String FIELD_TEMPLATE_CODE = "templateCode"; /* 产品代码*/
public static final String FIELD_TEMPLATE_NAME = "templateName"; /* 产品名称*/
public static final String FIELD_REMARK = "remark"; /* 备注*/
public static final String FIELD_DELETE_FLAG = "deleteFlag"; /* 是否删除0:否1.是*/
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_TIME = "updatedTime"; /* 修改人名称*/
public static final String FIELD_UPDATED_NAME = "updatedName"; /* 修改时间*/
public static final String COL_ID = "ID"; /* ID*/
public static final String COL_COMPANY_CODE = "COMPANY_CODE"; /* 企业编码 预留*/
public static final String COL_DEP_CODE = "DEP_CODE"; /* 部门编码 预留*/
public static final String COL_PROJ_CODE = "PROJ_CODE"; /* 项目编码*/
public static final String COL_TEMPLATE_CODE = "TEMPLATE_CODE"; /* 产品代码*/
public static final String COL_TEMPLATE_NAME = "TEMPLATE_NAME"; /* 产品名称*/
public static final String COL_REMARK = "REMARK"; /* 备注*/
public static final String COL_DELETE_FLAG = "DELETE_FLAG"; /* 是否删除0:否1.是*/
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_TIME = "UPDATED_TIME"; /* 修改人名称*/
public static final String COL_UPDATED_NAME = "UPDATED_NAME"; /* 修改时间*/
public static final String QUERY = "HPPZ015.query";
public static final String COUNT = "HPPZ015.count";
public static final String INSERT = "HPPZ015.insert";
public static final String UPDATE = "HPPZ015.update";
public static final String DELETE = "HPPZ015.delete";
private Long id = new Long(0); /* ID*/
private String companyCode = " "; /* 企业编码 预留*/
private String depCode = " "; /* 部门编码 预留*/
private String projCode = " "; /* 项目编码*/
private String templateCode = " "; /* 产品代码*/
private String templateName = " "; /* 产品名称*/
private String remark = " "; /* 备注*/
private Boolean deleteFlag; /* 是否删除0:否1.是*/
private String createdBy = " "; /* 创建人*/
private String createdName = " "; /* 创建人名称*/
private String createdTime = " "; /* 创建时间*/
private String updatedBy = " "; /* 修改人*/
private String updatedTime = " "; /* 修改人名称*/
private String updatedName = " "; /* 修改时间*/
/**
* initialize the metadata.
*/
public void initMetaData() {
EiColumn eiColumn;
eiColumn = new EiColumn(FIELD_ID);
eiColumn.setPrimaryKey(true);
eiColumn.setDescName("ID");
eiMetadata.addMeta(eiColumn);
eiColumn = new EiColumn(FIELD_COMPANY_CODE);
eiColumn.setDescName("企业编码 预留");
eiMetadata.addMeta(eiColumn);
eiColumn = new EiColumn(FIELD_DEP_CODE);
eiColumn.setDescName("部门编码 预留");
eiMetadata.addMeta(eiColumn);
eiColumn = new EiColumn(FIELD_PROJ_CODE);
eiColumn.setDescName("项目编码");
eiMetadata.addMeta(eiColumn);
eiColumn = new EiColumn(FIELD_TEMPLATE_CODE);
eiColumn.setDescName("产品代码");
eiMetadata.addMeta(eiColumn);
eiColumn = new EiColumn(FIELD_TEMPLATE_NAME);
eiColumn.setDescName("产品名称");
eiMetadata.addMeta(eiColumn);
eiColumn = new EiColumn(FIELD_REMARK);
eiColumn.setDescName("备注");
eiMetadata.addMeta(eiColumn);
eiColumn = new EiColumn(FIELD_DELETE_FLAG);
eiColumn.setDescName("是否删除0:否1.是");
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_TIME);
eiColumn.setDescName("修改人名称");
eiMetadata.addMeta(eiColumn);
eiColumn = new EiColumn(FIELD_UPDATED_NAME);
eiColumn.setDescName("修改时间");
eiMetadata.addMeta(eiColumn);
}
/**
* the constructor.
*/
public HPPZ015() {
initMetaData();
}
/**
* get the id - ID.
* @return the id
*/
public Long getId() {
return this.id;
}
/**
* set the id - ID.
*
* @param id - ID
*/
public void setId(Long id) {
this.id = id;
}
/**
* get the 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 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 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 templateCode - 产品代码.
* @return the templateCode
*/
public String getTemplateCode() {
return this.templateCode;
}
/**
* set the templateCode - 产品代码.
*
* @param templateCode - 产品代码
*/
public void setTemplateCode(String templateCode) {
this.templateCode = templateCode;
}
/**
* get the templateName - 产品名称.
* @return the templateName
*/
public String getTemplateName() {
return this.templateName;
}
/**
* set the templateName - 产品名称.
*
* @param templateName - 产品名称
*/
public void setTemplateName(String templateName) {
this.templateName = templateName;
}
/**
* get the remark - 备注.
* @return the remark
*/
public String getRemark() {
return this.remark;
}
/**
* set the remark - 备注.
*
* @param remark - 备注
*/
public void setRemark(String remark) {
this.remark = remark;
}
/**
* get the deleteFlag - 是否删除0:否1.是.
* @return the deleteFlag
*/
public Boolean getDeleteFlag() {
return this.deleteFlag;
}
/**
* set the deleteFlag - 是否删除0:否1.是.
*
* @param deleteFlag - 是否删除0:否1.是
*/
public void setDeleteFlag(Boolean deleteFlag) {
this.deleteFlag = deleteFlag;
}
/**
* 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 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 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 value from Map.
*
* @param map - source data map
*/
@Override
public void fromMap(Map map) {
setId(NumberUtils.toLong(StringUtils.toString(map.get(FIELD_ID)), id));
setCompanyCode(StringUtils.defaultIfEmpty(StringUtils.toString(map.get(FIELD_COMPANY_CODE)), companyCode));
setDepCode(StringUtils.defaultIfEmpty(StringUtils.toString(map.get(FIELD_DEP_CODE)), depCode));
setProjCode(StringUtils.defaultIfEmpty(StringUtils.toString(map.get(FIELD_PROJ_CODE)), projCode));
setTemplateCode(StringUtils.defaultIfEmpty(StringUtils.toString(map.get(FIELD_TEMPLATE_CODE)), templateCode));
setTemplateName(StringUtils.defaultIfEmpty(StringUtils.toString(map.get(FIELD_TEMPLATE_NAME)), templateName));
setRemark(StringUtils.defaultIfEmpty(StringUtils.toString(map.get(FIELD_REMARK)), remark));
setDeleteFlag(NumberUtils.toBoolean(StringUtils.toString(map.get(FIELD_DELETE_FLAG)), deleteFlag));
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));
setUpdatedTime(StringUtils.defaultIfEmpty(StringUtils.toString(map.get(FIELD_UPDATED_TIME)), updatedTime));
setUpdatedName(StringUtils.defaultIfEmpty(StringUtils.toString(map.get(FIELD_UPDATED_NAME)), updatedName));
}
/**
* set the value to Map.
*/
@Override
public Map toMap() {
Map map = new HashMap();
map.put(FIELD_ID, StringUtils.toString(id, eiMetadata.getMeta(FIELD_ID)));
map.put(FIELD_COMPANY_CODE, StringUtils.toString(companyCode, eiMetadata.getMeta(FIELD_COMPANY_CODE)));
map.put(FIELD_DEP_CODE, StringUtils.toString(depCode, eiMetadata.getMeta(FIELD_DEP_CODE)));
map.put(FIELD_PROJ_CODE, StringUtils.toString(projCode, eiMetadata.getMeta(FIELD_PROJ_CODE)));
map.put(FIELD_TEMPLATE_CODE, StringUtils.toString(templateCode, eiMetadata.getMeta(FIELD_TEMPLATE_CODE)));
map.put(FIELD_TEMPLATE_NAME, StringUtils.toString(templateName, eiMetadata.getMeta(FIELD_TEMPLATE_NAME)));
map.put(FIELD_REMARK, StringUtils.toString(remark, eiMetadata.getMeta(FIELD_REMARK)));
map.put(FIELD_DELETE_FLAG, StringUtils.toString(deleteFlag, eiMetadata.getMeta(FIELD_DELETE_FLAG)));
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_TIME, StringUtils.toString(updatedTime, eiMetadata.getMeta(FIELD_UPDATED_TIME)));
map.put(FIELD_UPDATED_NAME, StringUtils.toString(updatedName, eiMetadata.getMeta(FIELD_UPDATED_NAME)));
return map;
}
}
package com.baosight.hpjx.hp.pz.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:THpsc002.java <br>
* Description: <br>
*
* Copyrigth:Baosight Software LTD.co Copyright (c) 2019. <br>
*
* @version 1.0
* @history 2024-02-23 9:16:14 create
*/
public class HPPZ015A extends DaoEPBase {
private static final long serialVersionUID = 1L;
public static final String FIELD_ID = "id";
public static final String FIELD_COMPANY_CODE = "companyCode"; /* 企业编码 预留*/
public static final String FIELD_DEP_CODE = "depCode"; /* 部门编码 预留*/
public static final String FIELD_PROJ_CODE = "projCode"; /* 项目编码*/
public static final String FIELD_PROJ_NAME = "projName"; /* 项目名称*/
public static final String FIELD_PARENT_ID = "parentId"; /* 父节点ID*/
public static final String FIELD_PARENT_PRDT_NAME = "parentPrdtName"; /* 父节点-产品名称*/
public static final String FIELD_TYPE = "type"; /* 类别*/
public static final String FIELD_LEAF = "leaf"; /* 是否有叶子节点*/
public static final String FIELD_SORT = "sort"; /* 排序字段*/
public static final String FIELD_ICON = "icon"; /* 图片地址*/
public static final String FIELD_PRDT_TYPE = "prdtType"; /* 产品类型*/
public static final String FIELD_PRDT_CODE = "prdtCode"; /* 产品编码*/
public static final String FIELD_PRDT_NAME = "prdtName"; /* 产品名称*/
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_INVENT_RECORD_ID = "inventRecordId"; /* 项目档案ID*/
public static final String FIELD_SPEC = "spec"; /* 规格*/
public static final String FIELD_NUM = "num"; /* 数量*/
public static final String FIELD_UNIT_WT = "unitWt"; /* 单重*/
public static final String FIELD_TOTAL_WT = "totalWt"; /* 总重*/
public static final String FIELD_FILE_PATH1 = "filePath1"; /* 文件地址1*/
public static final String FIELD_FILE_PATH2 = "filePath2"; /* 文件地址2*/
public static final String FIELD_FILE_PATH3 = "filePath3"; /* 文件地址3*/
public static final String FIELD_FILE_PATH4 = "filePath4"; /* 文件地址4*/
public static final String FIELD_FILE_PATH5 = "filePath5"; /* 文件地址5*/
public static final String FIELD_STATUS = "status"; /* 状态 0-未审核,1-已审核*/
public static final String FIELD_DEL_STATUS = "delStatus"; /* 状态 1未删除,0已删除*/
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_REMARK = "remark"; /* 备注*/
public static final String FIELD_PGSTATUS = "pgStatus"; /* 派工状态*/
public static final String FIELD_LV = "lv"; /* 树的层级*/
public static final String COL_ID = "ID";
public static final String COL_COMPANY_CODE = "COMPANY_CODE"; /* 企业编码 预留*/
public static final String COL_DEP_CODE = "DEP_CODE"; /* 部门编码 预留*/
public static final String COL_PROJ_CODE = "PROJ_CODE"; /* 项目编码*/
public static final String COL_PROJ_NAME = "PROJ_NAME"; /* 项目名称*/
public static final String COL_PARENT_ID = "PARENT_ID"; /* 父节点ID*/
public static final String COL_PARENT_PRDT_NAME = "PARENT_PRDT_NAME"; /* 父节点-产品名称*/
public static final String COL_TYPE = "TYPE"; /* 类别*/
public static final String COL_LEAF = "LEAF"; /* 是否有叶子节点*/
public static final String COL_SORT = "SORT"; /* 排序字段*/
public static final String COL_ICON = "ICON"; /* 图片地址*/
public static final String COL_PRDT_TYPE = "PRDT_TYPE"; /* 产品类型*/
public static final String COL_PRDT_CODE = "PRDT_CODE"; /* 产品编码*/
public static final String COL_PRDT_NAME = "PRDT_NAME"; /* 产品名称*/
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_INVENT_RECORD_ID = "INVENT_RECORD_ID"; /* 项目档案ID*/
public static final String COL_SPEC = "SPEC"; /* 规格*/
public static final String COL_NUM = "NUM"; /* 数量*/
public static final String COL_UNIT_WT = "UNIT_WT"; /* 单重*/
public static final String COL_TOTAL_WT = "TOTAL_WT"; /* 总重*/
public static final String COL_FILE_PATH1 = "FILE_PATH1"; /* 文件地址1*/
public static final String COL_FILE_PATH2 = "FILE_PATH2"; /* 文件地址2*/
public static final String COL_FILE_PATH3 = "FILE_PATH3"; /* 文件地址3*/
public static final String COL_FILE_PATH4 = "FILE_PATH4"; /* 文件地址4*/
public static final String COL_FILE_PATH5 = "FILE_PATH5"; /* 文件地址5*/
public static final String COL_STATUS = "STATUS"; /* 状态 0-未审核,1-已审核*/
public static final String COL_DEL_STATUS = "DEL_STATUS"; /* 状态 1未删除,0已删除*/
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_REMARK = "REMARK"; /* 备注*/
public static final String COL_PGSTATUS = "PGSTATUS"; /* 派工状态*/
public static final String COL_LV = "LV"; /* 树的层级*/
public static final String QUERY = "HPSC002.query";
public static final String COUNT = "HPSC002.count";
public static final String INSERT = "HPSC002.insert";
public static final String UPDATE = "HPSC002.update";
public static final String DELETE = "HPSC002.delete";
private Long id;
private String companyCode = " "; /* 企业编码 预留*/
private String depCode = " "; /* 部门编码 预留*/
private String projCode = " "; /* 项目编码*/
private String projName = " "; /* 项目名称*/
private String parentId = " "; /* 父节点ID*/
private String parentPrdtName = " "; /* 父节点-产品名称*/
private String type = " "; /* 类别*/
private String leaf = "1"; /* 是否有叶子节点*/
private String sort = " "; /* 排序字段*/
private String icon = " "; /* 图片地址*/
private Integer prdtType; /* 产品类型*/
private String prdtCode = " "; /* 产品编码*/
private String prdtName = " "; /* 产品名称*/
private BigDecimal length = new BigDecimal("0"); /* 长*/
private BigDecimal width = new BigDecimal("0"); /* 宽*/
private BigDecimal thick = new BigDecimal("0"); /* 厚*/
private Long inventRecordId; /* 项目档案ID*/
private String spec = " "; /* 规格*/
private BigDecimal num = new BigDecimal(0.000); /* 数量*/
private BigDecimal unitWt = new BigDecimal(0.000); /* 单重*/
private BigDecimal totalWt = new BigDecimal(0.000); /* 总重*/
private String filePath1 = " "; /* 文件地址1*/
private String filePath2 = " "; /* 文件地址2*/
private String filePath3 = " "; /* 文件地址3*/
private String filePath4 = " "; /* 文件地址4*/
private String filePath5 = " "; /* 文件地址5*/
private Integer status; /* 状态 0-未审核,1-已审核*/
private Integer delStatus; /* 状态 1未删除,0已删除*/
private String createdBy = " "; /* 创建人*/
private String createdName = " "; /* 创建人名称*/
private String createdTime = " "; /* 创建时间*/
private String updatedBy = " "; /* 更新人*/
private String updatedName = " "; /* 修改人名称*/
private String updatedTime = " "; /* 更新时间*/
private String remark = " "; /* 备注*/
private String pgStatus = " "; /* 派工状态*/
private Integer lv; /* 树的层级*/
/**
* 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_COMPANY_CODE);
eiColumn.setDescName("企业编码 预留");
eiMetadata.addMeta(eiColumn);
eiColumn = new EiColumn(FIELD_DEP_CODE);
eiColumn.setDescName("部门编码 预留");
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_PARENT_ID);
eiColumn.setDescName("父节点ID");
eiMetadata.addMeta(eiColumn);
eiColumn = new EiColumn(FIELD_PARENT_PRDT_NAME);
eiColumn.setDescName("父节点-产品名称");
eiMetadata.addMeta(eiColumn);
eiColumn = new EiColumn(FIELD_TYPE);
eiColumn.setDescName("类别");
eiMetadata.addMeta(eiColumn);
eiColumn = new EiColumn(FIELD_LEAF);
eiColumn.setDescName("是否有叶子节点");
eiMetadata.addMeta(eiColumn);
eiColumn = new EiColumn(FIELD_SORT);
eiColumn.setDescName("排序字段");
eiMetadata.addMeta(eiColumn);
eiColumn = new EiColumn(FIELD_ICON);
eiColumn.setDescName("图片地址");
eiMetadata.addMeta(eiColumn);
eiColumn = new EiColumn(FIELD_PRDT_TYPE);
eiColumn.setDescName("产品类型");
eiMetadata.addMeta(eiColumn);
eiColumn = new EiColumn(FIELD_PRDT_CODE);
eiColumn.setDescName("产品编码");
eiMetadata.addMeta(eiColumn);
eiColumn = new EiColumn(FIELD_PRDT_NAME);
eiColumn.setDescName("产品名称");
eiMetadata.addMeta(eiColumn);
eiColumn = new EiColumn(FIELD_LENGTH);
eiColumn.setType("N");
eiColumn.setScaleLength(3);
eiColumn.setFieldLength(12);
eiColumn.setDescName("长");
eiMetadata.addMeta(eiColumn);
eiColumn = new EiColumn(FIELD_WIDTH);
eiColumn.setType("N");
eiColumn.setScaleLength(3);
eiColumn.setFieldLength(12);
eiColumn.setDescName("宽");
eiMetadata.addMeta(eiColumn);
eiColumn = new EiColumn(FIELD_THICK);
eiColumn.setType("N");
eiColumn.setScaleLength(3);
eiColumn.setFieldLength(12);
eiColumn.setDescName("厚");
eiMetadata.addMeta(eiColumn);
eiColumn = new EiColumn(FIELD_INVENT_RECORD_ID);
eiColumn.setDescName("项目档案ID");
eiMetadata.addMeta(eiColumn);
eiColumn = new EiColumn(FIELD_SPEC);
eiColumn.setDescName("规格");
eiMetadata.addMeta(eiColumn);
eiColumn = new EiColumn(FIELD_NUM);
eiColumn.setType("N");
eiColumn.setScaleLength(3);
eiColumn.setFieldLength(15);
eiColumn.setDescName("数量");
eiMetadata.addMeta(eiColumn);
eiColumn = new EiColumn(FIELD_UNIT_WT);
eiColumn.setType("N");
eiColumn.setScaleLength(3);
eiColumn.setFieldLength(15);
eiColumn.setDescName("单重");
eiMetadata.addMeta(eiColumn);
eiColumn = new EiColumn(FIELD_TOTAL_WT);
eiColumn.setType("N");
eiColumn.setScaleLength(3);
eiColumn.setFieldLength(15);
eiColumn.setDescName("总重");
eiMetadata.addMeta(eiColumn);
eiColumn = new EiColumn(FIELD_FILE_PATH1);
eiColumn.setDescName("文件地址1");
eiMetadata.addMeta(eiColumn);
eiColumn = new EiColumn(FIELD_FILE_PATH2);
eiColumn.setDescName("文件地址2");
eiMetadata.addMeta(eiColumn);
eiColumn = new EiColumn(FIELD_FILE_PATH3);
eiColumn.setDescName("文件地址3");
eiMetadata.addMeta(eiColumn);
eiColumn = new EiColumn(FIELD_FILE_PATH4);
eiColumn.setDescName("文件地址4");
eiMetadata.addMeta(eiColumn);
eiColumn = new EiColumn(FIELD_FILE_PATH5);
eiColumn.setDescName("文件地址5");
eiMetadata.addMeta(eiColumn);
eiColumn = new EiColumn(FIELD_STATUS);
eiColumn.setDescName("状态 0-未审核,1-已审核");
eiMetadata.addMeta(eiColumn);
eiColumn = new EiColumn(FIELD_DEL_STATUS);
eiColumn.setDescName("状态 1未删除,0已删除");
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_REMARK);
eiColumn.setDescName("备注");
eiMetadata.addMeta(eiColumn);
eiColumn = new EiColumn(FIELD_LV);
eiColumn.setDescName("树的层级");
eiMetadata.addMeta(eiColumn);
eiColumn = new EiColumn(FIELD_PGSTATUS);
eiColumn.setDescName("派工状态");
eiMetadata.addMeta(eiColumn);
}
/**
* the constructor.
*/
public HPPZ015A() {
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 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 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 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 parentId - 父节点ID.
* @return the parentId
*/
public String getParentId() {
return this.parentId;
}
/**
* set the parentId - 父节点ID.
*
* @param parentId - 父节点ID
*/
public void setParentId(String parentId) {
this.parentId = parentId;
}
/**
* get the parentPrdtName - 父节点-产品名称.
* @return the parentPrdtName
*/
public String getParentPrdtName() {
return this.parentPrdtName;
}
/**
* set the parentPrdtName - 父节点-产品名称.
*
* @param parentPrdtName - 父节点-产品名称
*/
public void setParentPrdtName(String parentPrdtName) {
this.parentPrdtName = parentPrdtName;
}
/**
* get the type - 类别.
* @return the type
*/
public String getType() {
return this.type;
}
/**
* set the type - 类别.
*
* @param type - 类别
*/
public void setType(String type) {
this.type = type;
}
/**
* get the leaf - 是否有叶子节点.
* @return the leaf
*/
public String getLeaf() {
return this.leaf;
}
/**
* set the leaf - 是否有叶子节点.
*
* @param leaf - 是否有叶子节点
*/
public void setLeaf(String leaf) {
this.leaf = leaf;
}
/**
* get the sort - 排序字段.
* @return the sort
*/
public String getSort() {
return this.sort;
}
/**
* set the sort - 排序字段.
*
* @param sort - 排序字段
*/
public void setSort(String sort) {
this.sort = sort;
}
/**
* get the icon - 图片地址.
* @return the icon
*/
public String getIcon() {
return this.icon;
}
/**
* set the icon - 图片地址.
*
* @param icon - 图片地址
*/
public void setIcon(String icon) {
this.icon = icon;
}
/**
* get the prdtType - 产品类型.
* @return the prdtType
*/
public Integer getPrdtType() {
return this.prdtType;
}
/**
* set the prdtType - 产品类型.
*
* @param prdtType - 产品类型
*/
public void setPrdtType(Integer prdtType) {
this.prdtType = prdtType;
}
/**
* get the prdtCode - 产品编码.
* @return the prdtCode
*/
public String getPrdtCode() {
return this.prdtCode;
}
/**
* set the prdtCode - 产品编码.
*
* @param prdtCode - 产品编码
*/
public void setPrdtCode(String prdtCode) {
this.prdtCode = prdtCode;
}
/**
* get the prdtName - 产品名称.
* @return the prdtName
*/
public String getPrdtName() {
return this.prdtName;
}
/**
* set the prdtName - 产品名称.
*
* @param prdtName - 产品名称
*/
public void setPrdtName(String prdtName) {
this.prdtName = prdtName;
}
/**
* 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 inventRecordId - 项目档案ID.
* @return the inventRecordId
*/
public Long getInventRecordId() {
return this.inventRecordId;
}
/**
* set the inventRecordId - 项目档案ID.
*
* @param inventRecordId - 项目档案ID
*/
public void setInventRecordId(Long inventRecordId) {
this.inventRecordId = inventRecordId;
}
/**
* get the 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 num - 数量.
* @return the num
*/
public BigDecimal getNum() {
return this.num;
}
/**
* set the num - 数量.
*
* @param num - 数量
*/
public void setNum(BigDecimal num) {
this.num = num;
}
/**
* get the unitWt - 单重.
* @return the unitWt
*/
public BigDecimal getUnitWt() {
return this.unitWt;
}
/**
* set the unitWt - 单重.
*
* @param unitWt - 单重
*/
public void setUnitWt(BigDecimal unitWt) {
this.unitWt = unitWt;
}
/**
* get the totalWt - 总重.
* @return the totalWt
*/
public BigDecimal getTotalWt() {
return this.totalWt;
}
/**
* set the totalWt - 总重.
*
* @param totalWt - 总重
*/
public void setTotalWt(BigDecimal totalWt) {
this.totalWt = totalWt;
}
/**
* get the filePath1 - 文件地址1.
* @return the filePath1
*/
public String getFilePath1() {
return this.filePath1;
}
/**
* set the filePath1 - 文件地址1.
*
* @param filePath1 - 文件地址1
*/
public void setFilePath1(String filePath1) {
this.filePath1 = filePath1;
}
/**
* get the filePath2 - 文件地址2.
* @return the filePath2
*/
public String getFilePath2() {
return this.filePath2;
}
/**
* set the filePath2 - 文件地址2.
*
* @param filePath2 - 文件地址2
*/
public void setFilePath2(String filePath2) {
this.filePath2 = filePath2;
}
/**
* get the filePath3 - 文件地址3.
* @return the filePath3
*/
public String getFilePath3() {
return this.filePath3;
}
/**
* set the filePath3 - 文件地址3.
*
* @param filePath3 - 文件地址3
*/
public void setFilePath3(String filePath3) {
this.filePath3 = filePath3;
}
/**
* get the filePath4 - 文件地址4.
* @return the filePath4
*/
public String getFilePath4() {
return this.filePath4;
}
/**
* set the filePath4 - 文件地址4.
*
* @param filePath4 - 文件地址4
*/
public void setFilePath4(String filePath4) {
this.filePath4 = filePath4;
}
/**
* get the filePath5 - 文件地址5.
* @return the filePath5
*/
public String getFilePath5() {
return this.filePath5;
}
/**
* set the filePath5 - 文件地址5.
*
* @param filePath5 - 文件地址5
*/
public void setFilePath5(String filePath5) {
this.filePath5 = filePath5;
}
/**
* 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 delStatus - 状态 1未删除,0已删除.
* @return the delStatus
*/
public Integer getDelStatus() {
return this.delStatus;
}
/**
* set the delStatus - 状态 1未删除,0已删除.
*
* @param delStatus - 状态 1未删除,0已删除
*/
public void setDelStatus(Integer delStatus) {
this.delStatus = delStatus;
}
/**
* 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 remark - 备注.
* @return the remark
*/
public String getRemark() {
return this.remark;
}
/**
* set the remark - 备注.
*
* @param remark - 备注
*/
public void setRemark(String remark) {
this.remark = remark;
}
/**
* get the lv - 树的层级.
* @return the lv
*/
public Integer getLv() {
return this.lv;
}
/**
* set the lv - 树的层级.
*
* @param lv - 树的层级
*/
public void setLv(Integer lv) {
this.lv = lv;
}
/**
* get the status - 状态 0-未审核,1-已审核.
* @return the status
*/
public String getPgStatus() {
return this.pgStatus;
}
/**
* set the status - 状态 0-未审核,1-已审核.
*
* @param pgStatus - 状态 0-未审核,1-已审核
*/
public void setPgStatus(String pgStatus) {
this.pgStatus = pgStatus;
}
/**
* 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));
setCompanyCode(StringUtils.defaultIfEmpty(StringUtils.toString(map.get(FIELD_COMPANY_CODE)), companyCode));
setDepCode(StringUtils.defaultIfEmpty(StringUtils.toString(map.get(FIELD_DEP_CODE)), depCode));
setProjCode(StringUtils.defaultIfEmpty(StringUtils.toString(map.get(FIELD_PROJ_CODE)), projCode));
setProjName(StringUtils.defaultIfEmpty(StringUtils.toString(map.get(FIELD_PROJ_NAME)), projName));
setParentId(StringUtils.defaultIfEmpty(StringUtils.toString(map.get(FIELD_PARENT_ID)), parentId));
setParentPrdtName(StringUtils.defaultIfEmpty(StringUtils.toString(map.get(FIELD_PARENT_PRDT_NAME)), parentPrdtName));
setType(StringUtils.defaultIfEmpty(StringUtils.toString(map.get(FIELD_TYPE)), type));
setLeaf(StringUtils.defaultIfEmpty(StringUtils.toString(map.get(FIELD_LEAF)), leaf));
setSort(StringUtils.defaultIfEmpty(StringUtils.toString(map.get(FIELD_SORT)), sort));
setIcon(StringUtils.defaultIfEmpty(StringUtils.toString(map.get(FIELD_ICON)), icon));
setPrdtType(NumberUtils.toInteger(StringUtils.toString(map.get(FIELD_PRDT_TYPE)), prdtType));
setPrdtCode(StringUtils.defaultIfEmpty(StringUtils.toString(map.get(FIELD_PRDT_CODE)), prdtCode));
setPrdtName(StringUtils.defaultIfEmpty(StringUtils.toString(map.get(FIELD_PRDT_NAME)), prdtName));
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));
setInventRecordId(NumberUtils.toLong(StringUtils.toString(map.get(FIELD_INVENT_RECORD_ID)), inventRecordId));
setSpec(StringUtils.defaultIfEmpty(StringUtils.toString(map.get(FIELD_SPEC)), spec));
setNum(NumberUtils.toBigDecimal(StringUtils.toString(map.get(FIELD_NUM)), num));
setUnitWt(NumberUtils.toBigDecimal(StringUtils.toString(map.get(FIELD_UNIT_WT)), unitWt));
setTotalWt(NumberUtils.toBigDecimal(StringUtils.toString(map.get(FIELD_TOTAL_WT)), totalWt));
setFilePath1(StringUtils.defaultIfEmpty(StringUtils.toString(map.get(FIELD_FILE_PATH1)), filePath1));
setFilePath2(StringUtils.defaultIfEmpty(StringUtils.toString(map.get(FIELD_FILE_PATH2)), filePath2));
setFilePath3(StringUtils.defaultIfEmpty(StringUtils.toString(map.get(FIELD_FILE_PATH3)), filePath3));
setFilePath4(StringUtils.defaultIfEmpty(StringUtils.toString(map.get(FIELD_FILE_PATH4)), filePath4));
setFilePath5(StringUtils.defaultIfEmpty(StringUtils.toString(map.get(FIELD_FILE_PATH5)), filePath5));
setStatus(NumberUtils.toInteger(StringUtils.toString(map.get(FIELD_STATUS)), status));
setDelStatus(NumberUtils.toInteger(StringUtils.toString(map.get(FIELD_DEL_STATUS)), delStatus));
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));
setRemark(StringUtils.defaultIfEmpty(StringUtils.toString(map.get(FIELD_REMARK)), remark));
setLv(NumberUtils.toInteger(StringUtils.toString(map.get(FIELD_LV)), lv));
setPgStatus(StringUtils.defaultIfEmpty(StringUtils.toString(map.get(FIELD_PGSTATUS)), pgStatus));
}
/**
* set the value to Map.
*/
@Override
public Map toMap() {
Map map = new HashMap();
map.put(FIELD_ID, StringUtils.toString(id, eiMetadata.getMeta(FIELD_ID)));
map.put(FIELD_COMPANY_CODE, StringUtils.toString(companyCode, eiMetadata.getMeta(FIELD_COMPANY_CODE)));
map.put(FIELD_DEP_CODE, StringUtils.toString(depCode, eiMetadata.getMeta(FIELD_DEP_CODE)));
map.put(FIELD_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_PARENT_ID, StringUtils.toString(parentId, eiMetadata.getMeta(FIELD_PARENT_ID)));
map.put(FIELD_PARENT_PRDT_NAME, StringUtils.toString(parentPrdtName, eiMetadata.getMeta(FIELD_PARENT_PRDT_NAME)));
map.put(FIELD_TYPE, StringUtils.toString(type, eiMetadata.getMeta(FIELD_TYPE)));
map.put(FIELD_LEAF, StringUtils.toString(leaf, eiMetadata.getMeta(FIELD_LEAF)));
map.put(FIELD_SORT, StringUtils.toString(sort, eiMetadata.getMeta(FIELD_SORT)));
map.put(FIELD_ICON, StringUtils.toString(icon, eiMetadata.getMeta(FIELD_ICON)));
map.put(FIELD_PRDT_TYPE, StringUtils.toString(prdtType, eiMetadata.getMeta(FIELD_PRDT_TYPE)));
map.put(FIELD_PRDT_CODE, StringUtils.toString(prdtCode, eiMetadata.getMeta(FIELD_PRDT_CODE)));
map.put(FIELD_PRDT_NAME, StringUtils.toString(prdtName, eiMetadata.getMeta(FIELD_PRDT_NAME)));
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_INVENT_RECORD_ID, StringUtils.toString(inventRecordId, eiMetadata.getMeta(FIELD_INVENT_RECORD_ID)));
map.put(FIELD_SPEC, StringUtils.toString(spec, eiMetadata.getMeta(FIELD_SPEC)));
map.put(FIELD_NUM, StringUtils.toString(num, eiMetadata.getMeta(FIELD_NUM)));
map.put(FIELD_UNIT_WT, StringUtils.toString(unitWt, eiMetadata.getMeta(FIELD_UNIT_WT)));
map.put(FIELD_TOTAL_WT, StringUtils.toString(totalWt, eiMetadata.getMeta(FIELD_TOTAL_WT)));
map.put(FIELD_FILE_PATH1, StringUtils.toString(filePath1, eiMetadata.getMeta(FIELD_FILE_PATH1)));
map.put(FIELD_FILE_PATH2, StringUtils.toString(filePath2, eiMetadata.getMeta(FIELD_FILE_PATH2)));
map.put(FIELD_FILE_PATH3, StringUtils.toString(filePath3, eiMetadata.getMeta(FIELD_FILE_PATH3)));
map.put(FIELD_FILE_PATH4, StringUtils.toString(filePath4, eiMetadata.getMeta(FIELD_FILE_PATH4)));
map.put(FIELD_FILE_PATH5, StringUtils.toString(filePath5, eiMetadata.getMeta(FIELD_FILE_PATH5)));
map.put(FIELD_STATUS, StringUtils.toString(status, eiMetadata.getMeta(FIELD_STATUS)));
map.put(FIELD_DEL_STATUS, StringUtils.toString(delStatus, eiMetadata.getMeta(FIELD_DEL_STATUS)));
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_REMARK, StringUtils.toString(remark, eiMetadata.getMeta(FIELD_REMARK)));
map.put(FIELD_LV, StringUtils.toString(lv, eiMetadata.getMeta(FIELD_LV)));
map.put(FIELD_PGSTATUS, StringUtils.toString(pgStatus, eiMetadata.getMeta(FIELD_PGSTATUS)));
return map;
}
}
package com.baosight.hpjx.hp.pz.service;
import com.baosight.hpjx.aspect.annotation.OperationLogAnnotation;
import com.baosight.hpjx.core.constant.CommonConstant;
import com.baosight.hpjx.core.security.UserSessionUtils;
import com.baosight.hpjx.hp.pz.domain.HPPZ015;
import com.baosight.hpjx.hp.pz.domain.HPPZ015;
import com.baosight.hpjx.hp.pz.domain.HPPZ015A;
import com.baosight.hpjx.hp.pz.tools.HPPZTools;
import com.baosight.hpjx.hp.sc.domain.HPSC001;
import com.baosight.hpjx.hp.sc.domain.HPSC002;
import com.baosight.hpjx.hp.sc.tools.HPSCTools;
import com.baosight.hpjx.util.AssertUtils;
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.ServiceBase;
import com.baosight.iplat4j.core.web.threadlocal.UserSession;
import jdk.nashorn.internal.ir.IfNode;
import java.math.BigDecimal;
import java.text.SimpleDateFormat;
import java.util.Date;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
/**
*
*/
public class ServiceHPPZ015 extends ServiceBase {
/**
* 画面初始化.
*/
@OperationLogAnnotation(operModul = "产品模板",operType = "查询",operDesc = "初始化")
public EiInfo initLoad(EiInfo inInfo) {
HPPZ015 hppz015 = new HPPZ015();
EiInfo outInfo = super.initLoad(inInfo, hppz015);
outInfo.addBlock(EiConstant.resultBlock).addBlockMeta(hppz015.eiMetadata);
return inInfo;
}
/**
* 查询操作.
*/
@OperationLogAnnotation(operModul = "产品模板",operType = "查询",operDesc = "查询")
@Override
public EiInfo query(EiInfo inInfo) {
/* 调用EI查询方法.*/
EiInfo outInfo = super.query(inInfo, "HPPZ015.query", new HPPZ015());
return outInfo;
}
/**
* 新增操作.
*/
@OperationLogAnnotation(operModul = "产品模板",operType = "新增",operDesc = "新增")
@Override
public EiInfo insert(EiInfo inInfo) {
HashMap map = new HashMap();
map.put("projCode",inInfo.getString("projCode"));
List<HPPZ015> query = this.dao.query("HPPZ015.query", map);
if (query.size() > 0) {
inInfo.setStatus(EiConstant.STATUS_FAILURE);
inInfo.setMsg("该产品模板已存在,生成失败!");
logError("生成产品模板失败","该产品模板已存在");
return inInfo;
}
HPSC001 hpsc001 = HPSCTools.HpSc001.get(inInfo.getString("projCode"));
SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss");
try {
HPPZ015 HPPZ015 = new HPPZ015();
HPPZ015.setId(hpsc001.getId());
HPPZ015.setProjCode(inInfo.getString("projCode"));
HPPZ015.setTemplateName(inInfo.getString("templateName"));
HPPZ015.setCreatedBy(UserSession.getUserId());
HPPZ015.setCompanyCode(UserSession.getUserId());
HPPZ015.setCreatedName(UserSession.getLoginName());
HPPZ015.setCreatedTime(sdf.format(new Date()));
HPPZ015.setUpdatedBy(null);
HPPZ015.setUpdatedTime(null);
this.dao.insert("HPPZ015.insert", HPPZ015.toMap());
//模板物料清单
map.put("companyCode", UserSessionUtils.getCompanyCode());
this.dao.insert("HPPZ015A.insertMb", map);
inInfo.setStatus(EiConstant.STATUS_SUCCESS);
inInfo.setMsg("生成产品模板成功!");
} catch (PlatException e) {
e.printStackTrace();
inInfo.setStatus(EiConstant.STATUS_FAILURE);
inInfo.setMsg("生成产品模板失败!原因参见详细错误描述!");
inInfo.setDetailMsg(e.getMessage());
logError("生成产品模板失败", e.getMessage());
return inInfo;
}
return inInfo;
}
/**
* 新增操作.
*/
@OperationLogAnnotation(operModul = "产品模板",operType = "新增",operDesc = "物料生成")
public EiInfo assign(EiInfo inInfo) {
HashMap map = new HashMap();
map.put("projCode",inInfo.getString("projCode"));
try {
//模板清单
List<HPPZ015A> hppz015AList = this.dao.query("HPPZ015A.queryById",map);
if (hppz015AList.size()==0) {
inInfo.setStatus(EiConstant.STATUS_FAILURE);
inInfo.setMsg("生成物料清单失败!该模板物料清单不存在!");
return inInfo;
}
//生成清单
HPPZTools.HpPz015A.chekParentId(hppz015AList);
inInfo.setStatus(EiConstant.STATUS_SUCCESS);
inInfo.setMsg("生成物料清单成功!");
} catch (PlatException e) {
e.printStackTrace();
inInfo.setStatus(EiConstant.STATUS_FAILURE);
inInfo.setMsg("生成物料清单板失败!原因参见详细错误描述!");
inInfo.setDetailMsg(e.getMessage());
logError("生成物料清单失败", e.getMessage());
return inInfo;
}
return inInfo;
}
/**
* 修改操作.
*/
@OperationLogAnnotation(operModul = "产品模板",operType = "修改",operDesc = "修改")
public EiInfo update(EiInfo inInfo) {
SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss");
try {
HPPZ015 HPPZ015 = new HPPZ015();
EiBlock eiBlock = inInfo.getBlock(EiConstant.resultBlock);
for (int i = 0; i < eiBlock.getRowCount(); i++) {
Map<?, ?> map = eiBlock.getRow(i);
HPPZ015.fromMap(map);
HPPZ015.setUpdatedBy(UserSession.getUserId());
HPPZ015.setUpdatedTime(sdf.format(new Date()));
this.dao.update("HPPZ015.update", HPPZ015.toMap());
}
inInfo.setStatus(EiConstant.STATUS_SUCCESS);
inInfo.setMsg("修改成功!");
} catch (PlatException e) {
inInfo.setStatus(EiConstant.STATUS_FAILURE);
inInfo.setMsg("操作失败!原因参见详细错误描述!");
inInfo.setDetailMsg(e.getMessage());
logError("修改失败", e.getMessage());
return inInfo;
}
return query(inInfo);
}
/**
* 删除操作.
*/
@OperationLogAnnotation(operModul = "产品模板",operType = "删除",operDesc = "删除")
public EiInfo delete(EiInfo eiInfo) {
HPPZ015 HPPZ015 = new HPPZ015();
EiBlock eiBlock = eiInfo.getBlock(EiConstant.resultBlock);
try {
for (int i = 0; i < eiBlock.getRowCount(); i++) {
Map<?, ?> map = eiBlock.getRow(i);
HPPZ015.fromMap(map);
this.dao.delete("HPPZ015.delete", HPPZ015.toMap());
}
} catch (PlatException e) {
eiInfo.setStatus(EiConstant.STATUS_FAILURE);
eiInfo.setMsg("删除失败,原因参见详细错误描述!");
eiInfo.setDetailMsg(e.getMessage());
logError("删除失败!", e.getMessage());
return eiInfo;
}
eiInfo.setStatus(EiConstant.STATUS_SUCCESS);
eiInfo.setMsg("删除成功!");
return eiInfo;
}
}
package com.baosight.hpjx.hp.pz.service;
import cn.hutool.core.bean.BeanUtil;
import com.baosight.hpjx.aspect.annotation.OperationLogAnnotation;
import com.baosight.hpjx.common.DdynamicEnum;
import com.baosight.hpjx.core.constant.CommonConstant;
import com.baosight.hpjx.core.dao.DaoUtils;
import com.baosight.hpjx.core.security.UserSessionUtils;
import com.baosight.hpjx.hp.constant.HPConstant;
import com.baosight.hpjx.hp.ds.domain.HPDS002;
import com.baosight.hpjx.hp.pz.domain.HPPZ015A;
import com.baosight.hpjx.hp.pz.tools.HPPZTools;
import com.baosight.hpjx.hp.sc.domain.*;
import com.baosight.hpjx.hp.sc.tools.HPSCTools;
import com.baosight.hpjx.util.*;
import com.baosight.iplat4j.core.ei.EiBlock;
import com.baosight.iplat4j.core.ei.EiConstant;
import com.baosight.iplat4j.core.ei.EiInfo;
import com.baosight.iplat4j.core.exception.PlatException;
import com.baosight.iplat4j.core.service.impl.ServiceBase;
import com.baosight.iplat4j.core.util.NumberUtils;
import com.baosight.iplat4j.ed.util.SequenceGenerator;
import org.apache.commons.collections.CollectionUtils;
import org.apache.commons.lang.StringUtils;
import java.math.BigDecimal;
import java.text.DecimalFormat;
import java.util.*;
import java.util.stream.Collectors;
/**
*
*/
public class ServiceHPPZ015A extends ServiceBase {
/**
* 画面初始化
*
* @param inInfo
* @return
*/
@OperationLogAnnotation(operModul = "物料清单",operType = "查询",operDesc = "初始化")
public EiInfo initLoad(EiInfo inInfo) {
try {
Map<String, Object> map = new HashMap<>();
map.put("itemCode", "ITEM_CODE in ('2','3','4')");
CommonMethod.initBlock(inInfo,
Arrays.asList(DdynamicEnum.INVENT_NAME_BLOCK_ID, DdynamicEnum.CODESET_CODE_BLOCK_ID), map,
false);
Map queryMap = EiInfoUtils.getFirstRow(inInfo);
String id = MapUtils.getString(queryMap, "projId");
HPSC001 hpsc001 = HPSCTools.HpSc001.getId(id);
HPPZ015A hppz015A = new HPPZ015A();
hppz015A.setProjCode(hpsc001.getProjCode());
inInfo.addBlock(EiConstant.resultBlock).addBlockMeta(new HPPZ015A().eiMetadata);
} catch (Exception e) {
LogUtils.setDetailMsg(inInfo, e, "初始化失败");
}
return inInfo;
}
/**
* 查询操作.
*/
@OperationLogAnnotation(operModul = "物料清单",operType = "查询",operDesc = "查询")
@Override
public EiInfo query(EiInfo inInfo) {
try {
inInfo = super.query(inInfo, "HPPZ015A.query", new HPPZ015A());
} catch (Exception e) {
LogUtils.setDetailMsg(inInfo, e, "查询失败");
}
return inInfo;
}
/**
* 保存操作.
*
* @param inInfo
* @return
*/
@OperationLogAnnotation(operModul = "物料清单",operType = "保存",operDesc = "保存")
public EiInfo save(EiInfo inInfo) {
try {
List<Map> resultRows = inInfo.getBlock(EiConstant.resultBlock).getRows();
// 写入数据
for (int i = 0; i < resultRows.size(); i++) {
HPPZ015A HPPZ015A = new HPPZ015A();
HPPZ015A.fromMap(resultRows.get(i));
if (HPPZ015A.getId() == null || HPPZ015A.getId() == 0) {
this.add(HPPZ015A);
} else {
this.modify(HPPZ015A);
}
}
inInfo.setStatus(EiConstant.STATUS_DEFAULT);
inInfo.setMsg("操作成功!本次对[" + resultRows.size() + "]条数据保存成功!");
} catch (Exception e) {
LogUtils.setDetailMsg(inInfo, e, "保存失败");
}
return inInfo;
}
/**
* 新增操作.
*/
public EiInfo add(HPPZ015A HPPZ015A) {
EiInfo inInfo = new EiInfo();
try {
HPPZ015A.setLeaf("1");
HPPZ015A.setDelStatus(CommonConstant.YesNo.NO_0.intValue());
// if (StringUtils.isNotEmpty(hppz002.getPrdtCode()) && !hppz002.getParentId().equals("root")) {
// hppz002.setPrdtName(HPPZTools.getPz004ByCode(hppz002.getPrdtCode()).getInventName());
// }
HPPZ015A.setSpec(HPPZTools.HpPz006.jointSpec(HPPZ015A.getLength(),HPPZ015A.getWidth(),HPPZ015A.getThick()));
if(HPPZ015A.getParentId().equals("root")){
HPPZ015A.setLv(new Integer(1));
}else{
HPPZ015A.setPrdtCode(HPPZTools.HpPz004.checkAndSave(HPPZ015A.getPrdtType(),HPPZ015A.getPrdtName()));
Integer lv = (Integer) this.dao.get("HPPZ015A.queryLv","id",HPPZ015A.getParentId());
HPPZ015A.setLv(lv.intValue()+1);
}
DaoUtils.insert("HPPZ015A.insert", HPPZ015A.toMap());
if (!HPPZ015A.getParentId().equals("root")) {
this.checkTreeNodeLeaf(HPPZ015A.getParentId());
}
inInfo.setStatus(EiConstant.STATUS_SUCCESS);
inInfo.setMsg("新增成功!");
} catch (PlatException e) {
e.printStackTrace();
inInfo.setStatus(EiConstant.STATUS_FAILURE);
inInfo.setMsg("新增失败!原因参见详细错误描述!");
inInfo.setDetailMsg(e.getMessage());
logError("新增失败", e.getMessage());
return inInfo;
}
return inInfo;
}
/**
* 修改操作.
*/
public EiInfo modify(HPPZ015A HPPZ015A) {
EiInfo inInfo = new EiInfo();
try {
this.updateHPPZ015A(HPPZ015A);
inInfo.setStatus(EiConstant.STATUS_SUCCESS);
inInfo.setMsg("修改成功!");
} catch (PlatException e) {
inInfo.setStatus(EiConstant.STATUS_FAILURE);
inInfo.setMsg("操作失败!原因参见详细错误描述!");
inInfo.setDetailMsg(e.getMessage());
logError("修改失败", e.getMessage());
return inInfo;
}
return inInfo;
}
/**
* 新增操作.
*/
@OperationLogAnnotation(operModul = "物料清单",operType = "新增",operDesc = "新增操作")
@Override
public EiInfo insert(EiInfo inInfo) {
try {
HPPZ015A hppz002 = new HPPZ015A();
EiBlock eiBlock = inInfo.getBlock(EiConstant.resultBlock);
for (int i = 0; i < eiBlock.getRowCount(); i++) {
Map<?, ?> map = eiBlock.getRow(i);
hppz002.fromMap(map);
hppz002.setLeaf("1");
hppz002.setDelStatus(CommonConstant.YesNo.NO_0.intValue());
// if (StringUtils.isNotEmpty(hppz002.getPrdtCode()) && !hppz002.getParentId().equals("root")) {
// hppz002.setPrdtName(HPPZTools.getPz004ByCode(hppz002.getPrdtCode()).getInventName());
// }
hppz002.setSpec(HPPZTools.HpPz006.jointSpec(hppz002.getLength(),hppz002.getWidth(),hppz002.getThick()));
if(hppz002.getParentId().equals("root")){
hppz002.setLv(new Integer(1));
}else{
hppz002.setPrdtCode(HPPZTools.HpPz004.checkAndSave(hppz002.getPrdtType(),hppz002.getPrdtName()));
Integer lv = (Integer) this.dao.get("HPPZ015A.queryLv","id",hppz002.getParentId());
hppz002.setLv(lv.intValue()+1);
}
DaoUtils.insert("HPPZ015A.insert", hppz002.toMap());
if (!hppz002.getParentId().equals("root")) {
this.checkTreeNodeLeaf(hppz002.getParentId());
}
//处理项目管理中物料状态
HPSCTools.updateProjStatus(hppz002.getProjCode());
}
inInfo.setStatus(EiConstant.STATUS_SUCCESS);
inInfo.setMsg("新增成功!");
} catch (PlatException e) {
e.printStackTrace();
inInfo.setStatus(EiConstant.STATUS_FAILURE);
inInfo.setMsg("新增失败!原因参见详细错误描述!");
inInfo.setDetailMsg(e.getMessage());
logError("新增失败", e.getMessage());
return inInfo;
}
return query(inInfo);
}
/**
* 修改操作.
*/
@OperationLogAnnotation(operModul = "物料清单",operType = "修改",operDesc = "修改操作")
public EiInfo update(EiInfo inInfo) {
try {
HPPZ015A hppz002 = new HPPZ015A();
EiBlock eiBlock = inInfo.getBlock(EiConstant.resultBlock);
for (int i = 0; i < eiBlock.getRowCount(); i++) {
Map<?, ?> map = eiBlock.getRow(i);
hppz002.fromMap(map);
this.updateHPPZ015A(hppz002);
}
inInfo.setStatus(EiConstant.STATUS_SUCCESS);
inInfo.setMsg("修改成功!");
} catch (PlatException e) {
inInfo.setStatus(EiConstant.STATUS_FAILURE);
inInfo.setMsg("操作失败!原因参见详细错误描述!");
inInfo.setDetailMsg(e.getMessage());
logError("修改失败", e.getMessage());
return inInfo;
}
return query(inInfo);
}
public void updateHPPZ015A(HPPZ015A hppz002) {
hppz002.setDelStatus(CommonConstant.YesNo.NO_0.intValue());
hppz002.setSpec(HPPZTools.HpPz006.jointSpec(hppz002.getLength(),hppz002.getWidth(),hppz002.getThick()));
DaoUtils.update("HPPZ015A.update", hppz002.toMap());
}
/**
* 删除操作
*
* @param inInfo
* @return
*/
@OperationLogAnnotation(operModul = "物料清单",operType = "删除",operDesc = "删除操作")
public EiInfo delete(EiInfo inInfo) {
try {
List<Map> resultRows = inInfo.getBlock(EiConstant.resultBlock).getRows();
// 删除之前数据校验
for (Map resultRow : resultRows) {
HPPZ015A fSc002 = new HPPZ015A();
fSc002.fromMap(resultRow);
// 存在子节点不能删除
List<HPPZ015A> dbSc002s = HPPZTools.HpPz015A.queryByParent(fSc002.getId().toString());
AssertUtils.isNotEmpty(dbSc002s, String.format("部件[%s]已存在子节点不能删除", fSc002.getPrdtName()));
}
// 删除数据
for (Map resultRow : resultRows) {
HPPZ015A fSc002 = new HPPZ015A();
fSc002.fromMap(resultRow);
// 删除附件文件
delectDoc(fSc002.getId());
DaoUtils.update("HPPZ015A.delete", fSc002);
// 修改父级节点状态是叶子节点或非叶子节点
this.checkTreeNodeLeaf(fSc002.getParentId());
// 修改节点状态是叶子节点或非叶子节点
this.checkTreeNodeLeaf(fSc002.getId().toString());
}
inInfo.setStatus(EiConstant.STATUS_DEFAULT);
inInfo.setMsg("操作成功!本次对[" + resultRows.size() + "]条数据删除成功!");
} catch (Exception e) {
LogUtils.setDetailMsg(inInfo, e, "删除失败");
}
return inInfo;
}
/**
* 前端校验,数据是否派工
*
* @param inInfo
* @return
*/
public EiInfo checkIsPg(EiInfo inInfo) {
List<Map> resultRows = (List<Map>) inInfo.get("result");
Boolean checkSatus = true;
String msg = null;
for (Map resultRow : resultRows) {
HPPZ015A fSc002 = new HPPZ015A();
fSc002.fromMap(resultRow);
}
inInfo.set("checkSatus",checkSatus);
inInfo.set("msg",msg);
return inInfo;
}
/**
* 指定树节点
*
* @param inInfo
* @return
*/
@OperationLogAnnotation(operModul = "物料清单",operType = "查询",operDesc = "指定树节点")
public EiInfo queryTreeRoot(EiInfo inInfo) {
Long projId = NumberUtils.toLong(inInfo.get("projId"));
Map queryMap = new HashMap();
String root = "";
if (projId != null) {
Map map = new HashMap();
map.put("id", projId);
HPSC001 HPSC001 = (com.baosight.hpjx.hp.sc.domain.HPSC001) dao.get("HPSC001.queryDomainById", "id",projId);
root = HPSC001.getProjCode() + ":" + HPSC001.getProjName();
}
inInfo.set("root",root);
return inInfo;
}
@OperationLogAnnotation(operModul = "物料清单",operType = "查询",operDesc = "树查询服务")
//树查询服务
public EiInfo queryTreeNode(EiInfo inInfo) {
//1 获取参数
String pEname = inInfo.getCellStr(EiConstant.queryBlock, 0, "node");
if(StringUtils.equals("$",pEname)){
pEname = "root";
}
Long projId = NumberUtils.toLong(inInfo.get("projId"));
Map queryMap = new HashMap();
queryMap.put("pEname", pEname);
if (projId != null) {
Map map = new HashMap();
map.put("id", projId);
List list = dao.query("HPSC001.queryDomainById", map);
if (list.size() > 0) {
String projCode = ((HPSC001)list.get(0)).getProjCode();
queryMap.put("projCode", projCode);
}
}
//2 查询节点
List rows = dao.query("HPPZ015A.queryTree", queryMap);
//3 增加节点block块
EiInfo outInfo = new EiInfo();
EiBlock outBlock = outInfo.addBlock(BeanUtil.isEmpty(pEname) ? "" : pEname);
outBlock.addRows(rows);
return outInfo;
}
/**
* 修改节点状态,是叶子或非叶子节点
*
* @param id
*/
@OperationLogAnnotation(operModul = "物料清单",operType = "修改",operDesc = "修改节点状态,是叶子或非叶子节点")
public void checkTreeNodeLeaf(String id) {
//1 获取参数
Map queryMap = new HashMap();
queryMap.put("id", id);
List rows = this.dao.query("HPPZ015A.queryTreeNodeByParentPrtdCode", queryMap);
if (rows.size() > 0) {
queryMap.put("leaf", "0");
} else {
queryMap.put("leaf", "1");
}
DaoUtils.update("HPPZ015A.updateTreeNodeLeaf", queryMap);
}
/**
* 提交 撤回.
*/
@OperationLogAnnotation(operModul = "物料清单",operType = "提交",operDesc = "提交 撤回")
public EiInfo check(EiInfo eiInfo) {
HPPZ015A hppz002 = new HPPZ015A();
EiBlock eiBlock = eiInfo.getBlock(EiConstant.resultBlock);
try {
for (int i = 0; i < eiBlock.getRowCount(); i++) {
Map<?, ?> map = eiBlock.getRow(i);
hppz002.fromMap(map);
//限制一下,如果二级已经提交通过,这个时候不允许进行撤回
if(map.get("status").equals("0")) {
//找到二级是否已经提交
HPPZ015A THPPZ015A = (HPPZ015A) dao.get("HPPZ015A.query","id",hppz002.getId());
if (THPPZ015A.getStatus() == 1) {
// 二级如果已经提交了则需要去看看计划是否已经更新
}
}
DaoUtils.update("HPPZ015A.check", hppz002.toMap());
}
// 处理三级提交之后判断是否都提交完成,如果都提交完成则二级直接提交通过
for (int i = 0; i < eiBlock.getRowCount(); i++) {
Map<?, ?> map = eiBlock.getRow(i);
hppz002.fromMap(map);
HPPZ015A THPPZ015A = (HPPZ015A) dao.get("HPPZ015A.query","id",hppz002.getId());
Map map1 = new HashMap();
map1.put("parentId",THPPZ015A.getParentId());
List list = dao.query("HPPZ015A.checkExamineNum", map1);
int num = NumberUtils.toint(list.get(0));
Map map2 = new HashMap();
if (num == 0) {
map2.put("status",1);
map2.put("id",THPPZ015A.getParentId());
// 自动生成生产计划
this.autoPlanInfo(THPPZ015A.getParentId());
} else {
map2.put("status",0);
map2.put("id",THPPZ015A.getParentId());
}
DaoUtils.update("HPPZ015A.check",map2);
//处理项目管理中物料状态
HPSCTools.updateProjStatus(hppz002.getProjCode());
}
} catch (PlatException e) {
eiInfo.setStatus(EiConstant.STATUS_FAILURE);
eiInfo.setMsg("提交失败,原因参见详细错误描述!");
eiInfo.setDetailMsg(e.getMessage());
logError("提交失败!", e.getMessage());
return eiInfo;
}
eiInfo.setStatus(EiConstant.STATUS_SUCCESS);
eiInfo.setMsg("提交成功!");
return eiInfo;
}
/**
* 绑定附件
*
* @param inInfo
* @return
*/
@OperationLogAnnotation(operModul = "物料清单",operType = "绑定",operDesc = "绑定附件")
public EiInfo bindDocIdById(EiInfo inInfo) {
EiBlock eiBlock = inInfo.getBlock(EiConstant.resultBlock);
try {
List<Map> resultRows = inInfo.getBlock(EiConstant.resultBlock).getRows();
for (Map resultRow : resultRows) {
HPPZ015A fSc002 = new HPPZ015A();
fSc002.fromMap(resultRow);
Map sqlMap = new HashMap();
sqlMap.put("id", fSc002.getId());
sqlMap.put("filePath1", fSc002.getFilePath1());
sqlMap.put("bizType", "WL");
DaoUtils.update("HPPZ015A.bindDocIdById", fSc002.toMap());
}
inInfo.setStatus(EiConstant.STATUS_DEFAULT);
inInfo.setMsg("操作成功!");
} catch (Exception e) {
LogUtils.setDetailMsg(inInfo, e, "操作失败");
}
return inInfo;
}
/**
* 生成生产计划
*
* @param id 生产ID
*/
@OperationLogAnnotation(operModul = "物料清单",operType = "新增",operDesc = "生成生产计划")
public void autoPlanInfo(String id) {
String planNo;
HPPZ015A dbSc002 = HPPZTools.HpPz015A.get(Long.parseLong(id));
// 生成生产计划t_hpsc003,如果已存在就不新增
HPSC003 dbSc003 = HPSCTools.HpSc003.queryByMat(dbSc002.getId());
if (dbSc003 == null) {
planNo = SequenceGenerator.getNextSequence(HPConstant.SequenceId.HPSC003_PROD_NO);
HPSC003 newSc003 = BeanUtils.copy(dbSc002, HPSC003.class);
newSc003.setPlanInfoNo(planNo);
newSc003.setMatId(dbSc002.getId());
newSc003.setStatus(HPConstant.planStatus.S_0);
DaoUtils.insert(HPSC003.INSERT, newSc003);
} else {
planNo = dbSc003.getPlanInfoNo();
// 更新主计划状态为"计划中"
HPSCTools.HpSc003.updateStatus(dbSc003.getId(), HPConstant.planStatus.S_0);
}
// 生产计划详情
List<HPPZ015A> dbSc002Children = HPPZTools.HpPz015A.queryByParent(id);
for (HPPZ015A dbSc002Child : dbSc002Children) {
// 明细已存在就不在新增
HPSC004 dbSc004 = HPSCTools.HpSc004.queryByMat(dbSc002Child.getId());
if (dbSc004 != null) {
continue;
}
HPSC004 newSc004 = BeanUtils.copy(dbSc002Child, HPSC004.class);
newSc004.setParentId(planNo);
newSc004.setMatId(dbSc002Child.getId());
newSc004.setFilePath1(dbSc002Child.getId().toString());
newSc004.setDelStatus(CommonConstant.YesNo.NO_0);
DaoUtils.insert(HPSC004.INSERT, newSc004);
}
}
/**
* 部件类型下拉框
* @param inInfo 形参
* @return 返回集合
*/
@OperationLogAnnotation(operModul = "物料清单",operType = "查询",operDesc = "部件类型下拉框")
public EiInfo queryPrdtTypeBox(EiInfo inInfo) {
try {
List<DdynamicEnum> list = new ArrayList<>();
Map map = new HashMap();
if (inInfo.getCellStr(EiConstant.queryBlock,0,"itemCode").equals("1")){
map.put("itemCode","ITEM_CODE in ('4')");
}else if (inInfo.getCellStr(EiConstant.queryBlock,0,"itemCode").equals("2")) {
map.put("itemCode","ITEM_CODE in ('2','3')");
}else {
map.put("itemCode","ITEM_CODE in ('2','3','4')");
}
list.add(DdynamicEnum.CODESET_CODE_BLOCK_ID);
CommonMethod.initBlock(inInfo, list, map, false);
} catch (Exception e) {
LogUtils.setDetailMsg(inInfo, e, "查询部件类型失败");
}
return inInfo;
}
/**
* 删除附件文件
* @param id 文件ID
*/
@OperationLogAnnotation(operModul = "物料清单",operType = "删除",operDesc = "删除附件文件")
public void delectDoc(Long id){
Map<String,Object> map = new HashMap<>();
String companyCode = UserSessionUtils.getCompanyCode();
map.put("bizType","WL");
map.put("docIds","(select DOC_ID from HPJX.T_HPPZ015AA where MAT_ID in(" +
" select distinct ID from HPJX.T_HPPZ015A where COMPANY_CODE = '"+companyCode+"' and (ID = '"+id+"' or PARENT_ID = '"+id+"'))" +
" AND BIZ_TYPE = 'WL')");
List<HPDS002> list = this.dao.query("HPDS002.query",map);
if (list.size() > 0) {
for (HPDS002 hpds002: list) {
String realPath = hpds002.getRealPath();
FileUtils.deleteFile(realPath);
}
this.dao.delete(HPDS002.DELETE,map);
}
}
}
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE sqlMap PUBLIC "-//ibatis.apache.org//DTD SQL Map 2.0//EN" "http://ibatis.apache.org/dtd/sql-map-2.dtd"> <!-- table information
Generate time : 2024-03-11 9:59:34
Version : 1.0
schema : hpjx
tableName : T_HPPZ015
ID BIGINT NOT NULL primarykey,
COMPANY_CODE VARCHAR,
DEP_CODE VARCHAR,
PROJ_CODE VARCHAR,
TEMPLATE_CODE VARCHAR,
TEMPLATE_NAME VARCHAR,
REMARK VARCHAR,
DELETE_FLAG TINYINT,
CREATED_BY VARCHAR,
CREATED_NAME VARCHAR,
CREATED_TIME VARCHAR,
UPDATED_BY VARCHAR,
UPDATED_TIME VARCHAR,
UPDATED_NAME VARCHAR
-->
<sqlMap namespace="HPPZ015">
<sql id="condition">
<isNotEmpty prepend=" AND " property="id">
ID = #id#
</isNotEmpty>
<isNotEmpty prepend=" AND " property="companyCode">
COMPANY_CODE = #companyCode#
</isNotEmpty>
<isNotEmpty prepend=" AND " property="depCode">
DEP_CODE = #depCode#
</isNotEmpty>
<isNotEmpty prepend=" AND " property="projCode">
PROJ_CODE = #projCode#
</isNotEmpty>
<isNotEmpty prepend=" AND " property="templateCode">
TEMPLATE_CODE = #templateCode#
</isNotEmpty>
<isNotEmpty prepend=" AND " property="templateName">
TEMPLATE_NAME LIKE CONCAT('%', #templateName#, '%')
</isNotEmpty>
<isNotEmpty prepend=" AND " property="remark">
REMARK = #remark#
</isNotEmpty>
<isNotEmpty prepend=" AND " property="deleteFlag">
DELETE_FLAG = #deleteFlag#
</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="updatedTime">
UPDATED_TIME = #updatedTime#
</isNotEmpty>
<isNotEmpty prepend=" AND " property="updatedName">
UPDATED_NAME = #updatedName#
</isNotEmpty>
</sql>
<select id="query" parameterClass="java.util.HashMap"
resultClass="com.baosight.hpjx.hp.pz.domain.HPPZ015">
SELECT
ID as "id", <!-- ID -->
COMPANY_CODE as "companyCode", <!-- 企业编码 预留 -->
DEP_CODE as "depCode", <!-- 部门编码 预留 -->
PROJ_CODE as "projCode", <!-- 项目编码 -->
TEMPLATE_CODE as "templateCode", <!-- 产品代码 -->
TEMPLATE_NAME as "templateName", <!-- 产品名称 -->
REMARK as "remark", <!-- 备注 -->
DELETE_FLAG as "deleteFlag", <!-- 是否删除0:否1.是 -->
CREATED_BY as "createdBy", <!-- 创建人 -->
CREATED_NAME as "createdName", <!-- 创建人名称 -->
CREATED_TIME as "createdTime", <!-- 创建时间 -->
UPDATED_BY as "updatedBy", <!-- 修改人 -->
UPDATED_TIME as "updatedTime", <!-- 修改人名称 -->
UPDATED_NAME as "updatedName" <!-- 修改时间 -->
FROM ${hpjxSchema}.T_HPPZ015 WHERE 1=1
<include refid="condition" />
<dynamic prepend="ORDER BY">
<isNotEmpty property="orderBy">
$orderBy$
</isNotEmpty>
<isEmpty property="orderBy">
ID asc
</isEmpty>
</dynamic>
</select>
<select id="count" resultClass="int">
SELECT COUNT(*) FROM ${hpjxSchema}.T_HPPZ015 WHERE 1=1
<include refid="condition" />
</select>
<!--
<isNotEmpty prepend=" AND " property="id">
ID = #id#
</isNotEmpty>
<isNotEmpty prepend=" AND " property="companyCode">
COMPANY_CODE = #companyCode#
</isNotEmpty>
<isNotEmpty prepend=" AND " property="depCode">
DEP_CODE = #depCode#
</isNotEmpty>
<isNotEmpty prepend=" AND " property="projCode">
PROJ_CODE = #projCode#
</isNotEmpty>
<isNotEmpty prepend=" AND " property="templateCode">
TEMPLATE_CODE = #templateCode#
</isNotEmpty>
<isNotEmpty prepend=" AND " property="templateName">
TEMPLATE_NAME = #templateName#
</isNotEmpty>
<isNotEmpty prepend=" AND " property="remark">
REMARK = #remark#
</isNotEmpty>
<isNotEmpty prepend=" AND " property="deleteFlag">
DELETE_FLAG = #deleteFlag#
</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="updatedTime">
UPDATED_TIME = #updatedTime#
</isNotEmpty>
<isNotEmpty prepend=" AND " property="updatedName">
UPDATED_NAME = #updatedName#
</isNotEmpty>
-->
<insert id="insert">
INSERT INTO ${hpjxSchema}.T_HPPZ015 (ID, <!-- ID -->
COMPANY_CODE, <!-- 企业编码 预留 -->
DEP_CODE, <!-- 部门编码 预留 -->
PROJ_CODE, <!-- 项目编码 -->
TEMPLATE_CODE, <!-- 产品代码 -->
TEMPLATE_NAME, <!-- 产品名称 -->
REMARK, <!-- 备注 -->
DELETE_FLAG, <!-- 是否删除0:否1.是 -->
CREATED_BY, <!-- 创建人 -->
CREATED_NAME, <!-- 创建人名称 -->
CREATED_TIME, <!-- 创建时间 -->
UPDATED_BY, <!-- 修改人 -->
UPDATED_TIME, <!-- 修改人名称 -->
UPDATED_NAME <!-- 修改时间 -->
)
VALUES (#id#, #companyCode#, #depCode#, #projCode#, #templateCode#, #templateName#, #remark#, #deleteFlag#, #createdBy#, #createdName#, #createdTime#, #updatedBy#, #updatedTime#, #updatedName#)
</insert>
<delete id="delete">
DELETE FROM ${hpjxSchema}.T_HPPZ015 WHERE
ID = #id#
</delete>
<update id="update">
UPDATE ${hpjxSchema}.T_HPPZ015
SET
COMPANY_CODE = #companyCode#, <!-- 企业编码 预留 -->
DEP_CODE = #depCode#, <!-- 部门编码 预留 -->
PROJ_CODE = #projCode#, <!-- 项目编码 -->
TEMPLATE_CODE = #templateCode#, <!-- 产品代码 -->
TEMPLATE_NAME = #templateName#, <!-- 产品名称 -->
REMARK = #remark#, <!-- 备注 -->
DELETE_FLAG = #deleteFlag#, <!-- 是否删除0:否1.是 -->
CREATED_BY = #createdBy#, <!-- 创建人 -->
CREATED_NAME = #createdName#, <!-- 创建人名称 -->
CREATED_TIME = #createdTime#, <!-- 创建时间 -->
UPDATED_BY = #updatedBy#, <!-- 修改人 -->
UPDATED_TIME = #updatedTime#, <!-- 修改人名称 -->
UPDATED_NAME = #updatedName# <!-- 修改时间 -->
WHERE
ID = #id#
</update>
</sqlMap>
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE sqlMap PUBLIC "-//iBATIS.com//DTD SQL Map 2.0//EN" "http://www.ibatis.com/dtd/sql-map-2.dtd">
<sqlMap namespace="HPPZ015A">
<sql id="column">
ID as "id",
COMPANY_CODE as "companyCode", <!-- 企业编码 预留 -->
DEP_CODE as "depCode", <!-- 部门编码 预留 -->
PROJ_CODE as "projCode", <!-- 项目编码 -->
PROJ_NAME as "projName", <!-- 项目名称 -->
PARENT_ID as "parentId", <!-- 父节点-部件编码 -->
PARENT_PRDT_NAME as "parentPrdtName", <!-- 父节点-部件名称 -->
TYPE as "type", <!-- 类别 -->
LEAF as "leaf", <!-- 是否有叶子节点 -->
SORT as "sort", <!-- 排序字段 -->
ICON as "icon", <!-- 图片地址 -->
PRDT_TYPE as "prdtType",
PRDT_CODE as "prdtCode", <!-- 部件编码 -->
PRDT_NAME as "prdtName", <!-- 部件名称 -->
INVENT_RECORD_ID as "inventRecordId", <!-- 存货档案ID -->
NUM as "num", <!-- 数量 -->
UNIT_WT as "unitWt", <!-- 单重 -->
TOTAL_WT as "totalWt", <!-- 总重 -->
FILE_PATH1 as "filePath1", <!-- 文件地址1 -->
FILE_PATH2 as "filePath2", <!-- 文件地址2 -->
FILE_PATH3 as "filePath3", <!-- 文件地址3 -->
FILE_PATH4 as "filePath4", <!-- 文件地址4 -->
FILE_PATH5 as "filePath5", <!-- 文件地址5 -->
STATUS as "status", <!-- 状态 0-未提交,1-已提交 -->
DEL_STATUS as "delStatus", <!-- 状态 1未删除,0已删除 -->
CREATED_BY as "createdBy", <!-- 创建人 -->
CREATED_TIME as "createdTime", <!-- 创建时间 -->
UPDATED_BY as "updatedBy", <!-- 更新人 -->
UPDATED_TIME as "updatedTime", <!-- 更新时间 -->
REMARK as "remark", <!-- 备注 -->
LV as "lv",
SPEC as "spec",
LENGTH as "length", <!-- 长 -->
WIDTH as "width", <!-- 宽 -->
THICK as "thick" <!-- 厚 -->
</sql>
<sql id="column1">
A.ID as "id",
A.COMPANY_CODE as "companyCode", <!-- 企业编码 预留 -->
A.DEP_CODE as "depCode", <!-- 部门编码 预留 -->
A.PROJ_CODE as "projCode", <!-- 项目编码 -->
A.PROJ_NAME as "projName", <!-- 项目名称 -->
A.PARENT_ID as "parentId", <!-- 父节点-部件编码 -->
A.PARENT_PRDT_NAME as "parentPrdtName", <!-- 父节点-部件名称 -->
A.TYPE as "type", <!-- 类别 -->
A.LEAF as "leaf", <!-- 是否有叶子节点 -->
A.SORT as "sort", <!-- 排序字段 -->
A.ICON as "icon", <!-- 图片地址 -->
A.PRDT_TYPE as "prdtType",
A.PRDT_CODE as "prdtCode", <!-- 部件编码 -->
A.PRDT_NAME as "prdtName", <!-- 部件名称 -->
A.INVENT_RECORD_ID as "inventRecordId", <!-- 存货档案ID -->
A.NUM as "num", <!-- 数量 -->
A.UNIT_WT as "unitWt", <!-- 单重 -->
A.TOTAL_WT as "totalWt", <!-- 总重 -->
A.FILE_PATH1 as "filePath1", <!-- 文件地址1 -->
A.FILE_PATH2 as "filePath2", <!-- 文件地址2 -->
A.FILE_PATH3 as "filePath3", <!-- 文件地址3 -->
A.FILE_PATH4 as "filePath4", <!-- 文件地址4 -->
A.FILE_PATH5 as "filePath5", <!-- 文件地址5 -->
A.STATUS as "status", <!-- 状态 0-未提交,1-已提交 -->
A.DEL_STATUS as "delStatus", <!-- 状态 1未删除,0已删除 -->
A.CREATED_BY as "createdBy", <!-- 创建人 -->
A.CREATED_TIME as "createdTime", <!-- 创建时间 -->
A.UPDATED_BY as "updatedBy", <!-- 更新人 -->
A.UPDATED_TIME as "updatedTime", <!-- 更新时间 -->
A.REMARK as "remark", <!-- 备注 -->
A.LV as "lv",
A.SPEC as "spec",
A.LENGTH as "length", <!-- 长 -->
A.WIDTH as "width", <!-- 宽 -->
A.THICK as "thick", <!-- 厚 -->
B.STATUS as "pgStatus" <!-- 派工状态 -->
</sql>
<sql id="condition">
<isNotEmpty prepend=" AND " property="id">
ID = #id#
</isNotEmpty>
<isNotEmpty prepend=" AND " property="parentId">
PARENT_ID = #parentId#
</isNotEmpty>
<isNotEmpty prepend=" AND " property="prdtType">
PRDT_TYPE = #prdtType#
</isNotEmpty>
<isNotEmpty prepend=" AND " property="prdtCode">
PRDT_CODE = #prdtCode#
</isNotEmpty>
<isNotEmpty prepend=" AND " property="prdtName">
PRDT_NAME LIKE CONCAT('%', #prdtName#, '%')
</isNotEmpty>
<isNotEmpty prepend=" AND " property="inventRecordId">
INVENT_RECORD_ID = #inventRecordId#
</isNotEmpty>
<isNotEmpty prepend=" AND " property="projName">
PROJ_NAME LIKE CONCAT('%', #projName#, '%')
</isNotEmpty>
<isNotEmpty prepend=" AND " property="status">
STATUS = #status#
</isNotEmpty>
<isNotEmpty prepend=" AND " property="lv">
LV = #lv#
</isNotEmpty>
</sql>
<sql id="condition1">
<isNotEmpty prepend=" AND " property="id">
A.ID = #id#
</isNotEmpty>
<isNotEmpty prepend=" AND " property="projCode">
A.PROJ_CODE = #projCode#
</isNotEmpty>
<isNotEmpty prepend=" AND " property="parentId">
A.PARENT_ID = #parentId#
</isNotEmpty>
<isNotEmpty prepend=" AND " property="prdtType">
A.PRDT_TYPE = #prdtType#
</isNotEmpty>
<isNotEmpty prepend=" AND " property="prdtCode">
A.PRDT_CODE = #prdtCode#
</isNotEmpty>
<isNotEmpty prepend=" AND " property="prdtName">
A.PRDT_NAME LIKE CONCAT('%', #prdtName#, '%')
</isNotEmpty>
<isNotEmpty prepend=" AND " property="inventRecordId">
A.INVENT_RECORD_ID = #inventRecordId#
</isNotEmpty>
<isNotEmpty prepend=" AND " property="projName">
A.PROJ_NAME LIKE CONCAT('%', #projName#, '%')
</isNotEmpty>
<isNotEmpty prepend=" AND " property="status">
A.STATUS = #status#
</isNotEmpty>
<isNotEmpty prepend=" AND " property="lv">
A.LV = #lv#
</isNotEmpty>
</sql>
<sql id="order">
<dynamic prepend="ORDER BY">
<isNotEmpty property="order">
$order$
</isNotEmpty>
<isEmpty property="order">
A.ID DESC
</isEmpty>
</dynamic>
</sql>
<select id="query" parameterClass="java.util.HashMap" resultClass="com.baosight.hpjx.hp.pz.domain.HPPZ015A">
SELECT
<include refid="column1"/>
FROM hpjx.t_hppz015a A
LEFT JOIN hpjx.t_hpsc005 B on A.ID = B.MAT_ID
WHERE 1=1
AND PARENT_ID NOT IN ('root')
AND DEL_STATUS = 0
<include refid="condition1"/>
<include refid="order"/>
</select>
<select id="count" resultClass="int">
SELECT COUNT(*) FROM hpjx.t_hppz015a WHERE 1=1
AND PARENT_ID NOT IN ('root')
AND DEL_STATUS = 0
<include refid="condition"/>
</select>
<insert id="insert">
INSERT INTO hpjx.t_hppz015a (ID,
COMPANY_CODE, <!-- 企业编码 预留 -->
DEP_CODE, <!-- 部门编码 预留 -->
PROJ_CODE, <!-- 项目编码 -->
PROJ_NAME, <!-- 项目名称 -->
PARENT_ID, <!-- 父节点-部件编码 -->
PARENT_PRDT_NAME, <!-- 父节点-部件名称 -->
TYPE, <!-- 类别 -->
LEAF, <!-- 是否有叶子节点 -->
SORT, <!-- 排序字段 -->
ICON, <!-- 图片地址 -->
PRDT_TYPE,
PRDT_CODE, <!-- 部件编码 -->
PRDT_NAME, <!-- 部件名称 -->
INVENT_RECORD_ID, <!-- 存货档案ID -->
NUM, <!-- 数量 -->
UNIT_WT, <!-- 单重 -->
TOTAL_WT, <!-- 总重 -->
FILE_PATH1, <!-- 文件地址1 -->
FILE_PATH2, <!-- 文件地址2 -->
FILE_PATH3, <!-- 文件地址3 -->
FILE_PATH4, <!-- 文件地址4 -->
FILE_PATH5, <!-- 文件地址5 -->
STATUS, <!-- 状态 0-未提交,1-已提交 -->
DEL_STATUS, <!-- 状态 1未删除,0已删除 -->
CREATED_BY, <!-- 创建人 -->
CREATED_TIME, <!-- 创建时间 -->
UPDATED_BY, <!-- 更新人 -->
UPDATED_TIME, <!-- 更新时间 -->
REMARK, <!-- 备注 -->
LV,
SPEC,
LENGTH, <!-- 长 -->
WIDTH, <!-- 宽 -->
THICK <!-- 厚 -->
)
VALUES (#id#, #companyCode#, #depCode#, #projCode#, #projName#, #parentId#, #parentPrdtName#,
#type#, #leaf#, #sort#, #icon#, #prdtType#, #prdtCode#, #prdtName#, #inventRecordId#, #num#,
#unitWt#, #totalWt#, #filePath1#, #filePath2#, #filePath3#, #filePath4#, #filePath5#, #status#,
#delStatus#, #createdBy#, #createdTime#, #updatedBy#, #updatedTime#, #remark#, #lv#, #spec#,
#length#, #width#, #thick#)
</insert>
<insert id="insertMb" parameterClass="java.util.HashMap">
INSERT INTO hpjx.t_hppz015a (
SELECT * FROM hpjx.t_hpsc002 WHERE PROJ_CODE=#projCode# AND COMPANY_CODE=#companyCode#
)
</insert>
<!-- 删除 -->
<delete id="delete">
DELETE FROM hpjx.t_hppz015a WHERE ID = #id#
</delete>
<update id="update">
UPDATE hpjx.t_hppz015a
SET
COMPANY_CODE = #companyCode#, <!-- 企业编码 预留 -->
DEP_CODE = #depCode#, <!-- 部门编码 预留 -->
PROJ_CODE = #projCode#, <!-- 项目编码 -->
PROJ_NAME = #projName#, <!-- 项目名称 -->
PARENT_ID = #parentId#, <!-- 父节点-部件编码 -->
PARENT_PRDT_NAME = #parentPrdtName#, <!-- 父节点-部件名称 -->
TYPE = #type#, <!-- 类别 -->
LEAF = #leaf#, <!-- 是否有叶子节点 -->
SORT = #sort#, <!-- 排序字段 -->
ICON = #icon#, <!-- 图片地址 -->
PRDT_CODE = #prdtCode#, <!-- 部件编码 -->
PRDT_TYPE = #prdtType#,
PRDT_NAME = #prdtName#, <!-- 部件名称 -->
INVENT_RECORD_ID = #inventRecordId#, <!-- 存货档案ID -->
NUM = #num#, <!-- 数量 -->
UNIT_WT = #unitWt#, <!-- 单重 -->
TOTAL_WT = #totalWt#, <!-- 总重 -->
FILE_PATH1 = #filePath1#, <!-- 文件地址1 -->
FILE_PATH2 = #filePath2#, <!-- 文件地址2 -->
FILE_PATH3 = #filePath3#, <!-- 文件地址3 -->
FILE_PATH4 = #filePath4#, <!-- 文件地址4 -->
FILE_PATH5 = #filePath5#, <!-- 文件地址5 -->
STATUS = #status#, <!-- 状态 0-未提交,1-已提交 -->
DEL_STATUS = #delStatus#, <!-- 状态 1未删除,0已删除 -->
CREATED_BY = #createdBy#, <!-- 创建人 -->
CREATED_TIME = #createdTime#, <!-- 创建时间 -->
UPDATED_BY = #updatedBy#, <!-- 更新人 -->
UPDATED_TIME = #updatedTime#, <!-- 更新时间 -->
REMARK = #remark#, <!-- 备注 -->
SPEC = #spec#, <!-- 规格 -->
LENGTH = #length#, <!-- 长 -->
WIDTH = #width#, <!-- 宽 -->
THICK = #thick# <!-- 厚 -->
WHERE
ID = #id#
</update>
<select id="queryTree" resultClass="java.util.HashMap">
SELECT
ID as "nodeId",
PRDT_TYPE as "prdtType",
PRDT_CODE as "prdtCode", <!-- 项目编码 -->
PROJ_CODE as "projCode", <!-- 项目编码 -->
PRDT_name as "prdtName", <!-- 项目编码 -->
PROJ_NAME as "projName",<!-- 项目名称 -->
ID as "label", <!-- 名部件编码-->
PRDT_NAME as "text", <!-- 部件名称 -->
INVENT_RECORD_ID as "inventRecordId", <!-- 存货档案ID -->
PARENT_ID as "pId", <!-- 父节点编码 -->
TYPE as "type", <!-- 类别 -->
LEAF as "leaf", <!-- 是否有叶子节点 -->
SORT as "sort", <!-- 排序字段 -->
ICON as "icon", <!-- 图片地址 -->
LV as "lv",
SPEC as "spec"
FROM
hpjx.t_hppz015a
WHERE
1=1
<isNotEmpty prepend=" AND " property="pEname">
PARENT_ID = #pEname#
</isNotEmpty>
<isNotEmpty prepend=" AND " property="projCode">
PROJ_CODE = #projCode#
</isNotEmpty>
ORDER BY CREATED_TIME DESC
</select>
<!-- 根据父级ID查询 -->
<select id="queryTreeNodeByParentPrtdCode" resultClass="java.util.HashMap">
SELECT
<include refid="column"/>
FROM hpjx.t_hppz015a
WHERE 1 = 1
<isNotEmpty prepend=" AND " property="id">
PARENT_ID = #id#
</isNotEmpty>
<isNotEmpty prepend=" AND " property="projCode">
PROJ_CODE = #projCode#
</isNotEmpty>
</select>
<!-- 根据父级ID查询 -->
<select id="queryEntityByParentPrtdCode" resultClass="com.baosight.hpjx.hp.pz.domain.HPPZ015A">
SELECT
<include refid="column"/>
FROM HPJX.t_hppz015a
WHERE 1 = 1
<isNotEmpty prepend=" AND " property="id">
ID = #id#
</isNotEmpty>
<isNotEmpty prepend=" AND " property="parentId">
PARENT_ID = #parentId#
</isNotEmpty>
</select>
<update id="updateTreeNodeLeaf">
UPDATE hpjx.t_hppz015a SET LEAF = #leaf# WHERE ID = #id#
</update>
<update id="check">
UPDATE hpjx.t_hppz015a SET status = #status# WHERE ID = #id#
</update>
<update id="bindDocIdById">
UPDATE hpjx.t_hppz015a SET FILE_PATH1 = #filePath1# WHERE ID = #id# AND BIZ_TYPE = #bizType#
</update>
<select id="checkExamineNum1" resultClass="int">
SELECT COUNT(1) from hpjx.t_hppz015a
WHERE 1 = 1
AND PARENT_ID != 'root'
AND `STATUS` = 0
<isNotEmpty prepend=" AND " property="projCode">
PROJ_CODE = #projCode#
</isNotEmpty>
</select>
<select id="queryLv" resultClass="int">
SELECT LV from hpjx.t_hppz015a
WHERE ID = #id#
</select>
<select id="checkExamineNum1Count" resultClass="int">
SELECT COUNT(1) from hpjx.t_hppz015a
WHERE 1 = 1
AND PARENT_ID != 'root'
<isNotEmpty prepend=" AND " property="projCode">
PROJ_CODE = #projCode#
</isNotEmpty>
</select>
<select id="checkExamineNum" resultClass="int">
SELECT COUNT(1) FROM hpjx.t_hppz015a
WHERE LEAF = '1'
AND STATUS = 0 AND DEL_STATUS = 0
<isNotEmpty prepend=" AND " property="parentId">
PARENT_ID = #parentId#
</isNotEmpty>
</select>
<select id="querySmallCode" parameterClass="java.util.HashMap" resultClass="java.util.HashMap">
select distinct
ITEM_CODE as "itemCode",
ITEM_CNAME as "itemCname",
case when ITEM_CODE in ('2','3') then '3'
when ITEM_CODE in ('4') then '4'
else '0' end "param1Field"
from
iplat.tedcm01
where STATUS = '1' and CODESET_CODE = 'hpjx.hpkc.inventType'
<isNotEmpty prepend=" AND " property="itemCode">
$itemCode$
</isNotEmpty>
</select>
<select id="queryById" parameterClass="java.util.HashMap" resultClass="com.baosight.hpjx.hp.pz.domain.HPPZ015A">
SELECT
COMPANY_CODE as "companyCode", <!-- 企业编码 预留 -->
DEP_CODE as "depCode", <!-- 部门编码 预留 -->
PROJ_CODE as "projCode", <!-- 项目编码 -->
PROJ_NAME as "projName", <!-- 项目名称 -->
PARENT_ID as "parentId", <!-- 父节点-部件编码 -->
PARENT_PRDT_NAME as "parentPrdtName", <!-- 父节点-部件名称 -->
TYPE as "type", <!-- 类别 -->
LEAF as "leaf", <!-- 是否有叶子节点 -->
PRDT_TYPE as "prdtType",
PRDT_CODE as "prdtCode", <!-- 部件编码 -->
PRDT_NAME as "prdtName", <!-- 部件名称 -->
UNIT_WT as "unitWt", <!-- 单重 -->
REMARK as "remark", <!-- 备注 -->
LV as "lv",
SPEC as "spec",
LENGTH as "length", <!-- 长 -->
WIDTH as "width", <!-- 宽 -->
THICK as "thick" <!-- 厚 -->
FROM hpjx.t_hppz015a
WHERE 1=1 AND PROJ_CODE=#projCode#
</select>
</sqlMap>
...@@ -7,6 +7,9 @@ import com.baosight.hpjx.core.dao.DaoUtils; ...@@ -7,6 +7,9 @@ import com.baosight.hpjx.core.dao.DaoUtils;
import com.baosight.hpjx.hp.constant.HPConstant; import com.baosight.hpjx.hp.constant.HPConstant;
import com.baosight.hpjx.hp.constant.HPSqlConstant; import com.baosight.hpjx.hp.constant.HPSqlConstant;
import com.baosight.hpjx.hp.pz.domain.*; import com.baosight.hpjx.hp.pz.domain.*;
import com.baosight.hpjx.hp.sc.domain.HPSC002;
import com.baosight.hpjx.hp.sc.tools.HPSCTools;
import com.baosight.hpjx.hp.pz.domain.*;
import com.baosight.hpjx.util.AssertUtils; import com.baosight.hpjx.util.AssertUtils;
import com.baosight.hpjx.util.MapUtils; import com.baosight.hpjx.util.MapUtils;
import com.baosight.hpjx.util.ObjectUtils; import com.baosight.hpjx.util.ObjectUtils;
...@@ -14,12 +17,15 @@ import com.baosight.hpjx.util.StringUtils; ...@@ -14,12 +17,15 @@ import com.baosight.hpjx.util.StringUtils;
import com.baosight.iplat4j.core.data.DaoEPBase; import com.baosight.iplat4j.core.data.DaoEPBase;
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.web.threadlocal.UserSession;
import com.baosight.iplat4j.ed.util.SequenceGenerator; import com.baosight.iplat4j.ed.util.SequenceGenerator;
import org.apache.commons.beanutils.BeanUtils; import org.apache.commons.beanutils.BeanUtils;
import org.apache.commons.collections.CollectionUtils; import org.apache.commons.collections.CollectionUtils;
import java.math.BigDecimal; import java.math.BigDecimal;
import java.math.RoundingMode; import java.math.RoundingMode;
import java.text.SimpleDateFormat;
import java.util.Date;
import java.util.HashMap; import java.util.HashMap;
import java.util.List; import java.util.List;
import java.util.Map; import java.util.Map;
...@@ -569,4 +575,124 @@ public class HPPZTools { ...@@ -569,4 +575,124 @@ public class HPPZTools {
} }
} }
/**
* HPSC002公共DAO定义
*
* @author:songx
* @date:2024/2/4,10:17
*/
public static class HpPz015A {
/**
* 查询
*
* @param prdtCode
* @return
*/
public static HPPZ015A getByPrdt(String prdtCode) {
AssertUtils.isEmpty(prdtCode, "部件编码不能为空");
Map queryMap = new HashMap();
queryMap.put("prdtCode", prdtCode);
List<HPPZ015A> results = DaoBase.getInstance().query("HPPZ015A.query", queryMap);
AssertUtils.isNull(results, String.format("部件编码[%s]信息不存在", prdtCode));
return results.get(0);
}
/**
* 查询节点
*
* @param id
* @return
*/
public static HPPZ015A get(Long id) {
AssertUtils.isNull(id, "节点ID不能为空");
Map queryMap = new HashMap();
queryMap.put("id", id);
List<HPPZ015A> results = DaoBase.getInstance().query("HPPZ015A.queryEntityByParentPrtdCode", queryMap);
AssertUtils.isNull(results, String.format("节点ID[%s]信息不存在", id));
return results.get(0);
}
/**
* 查询叶子节点
*
* @param parentId
* @return
*/
public static List<HPPZ015A> queryByParent(String parentId) {
AssertUtils.isEmpty(parentId, "节点ID不能为空");
Map queryMap = new HashMap();
queryMap.put("parentId", parentId);
return DaoBase.getInstance().query("HPPZ015A.queryEntityByParentPrtdCode", queryMap);
}
public static List queryTreeNodeByParentPrtdCode(String id) {
AssertUtils.isEmpty(id, "节点ID不能为空");
Map queryMap = new HashMap();
queryMap.put("id", id);
return DaoBase.getInstance().query("HPPZ015A.queryTreeNodeByParentPrtdCode", queryMap);
}
/**
* 查询叶子节点
*
* @param hppz015AList
* @return
*/
public static void chekParentId(List<HPPZ015A> hppz015AList) {
SimpleDateFormat sdf = new SimpleDateFormat("yyyyMMddHHmmss");
Long root = null;
Long prdtId = null;
Long prdtId_new = null;
//处理root
for (int i = 0; i<hppz015AList.size(); i++) {
if(hppz015AList.get(i).getLv().equals("1")){
HPSC002 hpsc002 = new HPSC002();
hpsc002.fromMap(hppz015AList.get(i).toMap());
hpsc002.setCreatedName(UserSession.getUserId());
hpsc002.setUpdatedTime(sdf.format(new Date()));
hpsc002.setStatus(CommonConstant.YesNo.NO_0);
hpsc002.setDelStatus(CommonConstant.YesNo.NO_0);
DaoBase.getInstance().insert("HPSC002.insert", hpsc002);
HPSC002 byProjCode = HPSCTools.HpSc002.getByProjCode(hpsc002.getProjCode());
root=byProjCode.getId();
break;
}
}
//处理部件
for (int i = 0; i<hppz015AList.size(); i++) {
if(hppz015AList.get(i).getLv().equals("2")){
prdtId=hppz015AList.get(i).getId();//旧
HPSC002 hpsc002 = new HPSC002();
hpsc002.setParentId(root.toString());
hpsc002.fromMap(hppz015AList.get(i).toMap());
hpsc002.setCreatedName(UserSession.getUserId());
hpsc002.setUpdatedTime(sdf.format(new Date()));
hpsc002.setStatus(CommonConstant.YesNo.NO_0);
hpsc002.setDelStatus(CommonConstant.YesNo.NO_0);
DaoBase.getInstance().insert("HPSC002.insert", hpsc002);
HPSC002 byProjCode = HPSCTools.HpSc002.getByProjCode(hpsc002.getProjCode());
prdtId_new=byProjCode.getId();
for (int j = 0; j<hppz015AList.size(); j++) {
if(hppz015AList.get(i).getLv().equals("3")) {
if(hppz015AList.get(j).getParentId().equals(prdtId)){
HPSC002 hpsc002_lv = new HPSC002();
hpsc002_lv.setParentId(prdtId_new.toString());
hpsc002_lv.fromMap(hppz015AList.get(i).toMap());
hpsc002_lv.setCreatedName(UserSession.getUserId());
hpsc002_lv.setUpdatedTime(sdf.format(new Date()));
hpsc002_lv.setStatus(CommonConstant.YesNo.NO_0);
hpsc002_lv.setDelStatus(CommonConstant.YesNo.NO_0);
DaoBase.getInstance().insert("HPSC002.insert", hpsc002_lv);
}
}
}
}
}
}
}
} }
package com.baosight.hpjx.hp.sc.service;
import com.baosight.hpjx.aspect.annotation.OperationLogAnnotation;
import com.baosight.hpjx.common.DdynamicEnum;
import com.baosight.hpjx.hp.pz.domain.HPPZ015;
import com.baosight.hpjx.hp.sc.domain.HPSC005C;
import com.baosight.hpjx.hp.sc.tools.HPSCTools;
import com.baosight.hpjx.util.CommonMethod;
import com.baosight.hpjx.util.EiInfoUtils;
import com.baosight.hpjx.util.LogUtils;
import com.baosight.hpjx.util.MapUtils;
import com.baosight.iplat4j.core.ei.EiConstant;
import com.baosight.iplat4j.core.ei.EiInfo;
import com.baosight.iplat4j.core.service.impl.ServiceBase;
import java.util.Arrays;
import java.util.Map;
/**
* @author:songx
* @date:2024/2/6,10:39
*/
public class ServiceHPSC002C extends ServiceBase {
/**
* 画面初始化
*
* @param inInfo
* @return
*/
@OperationLogAnnotation(operModul = "产品模板",operType = "查询",operDesc = "物料清单选择-产品模板-初始化")
public EiInfo initLoad(EiInfo inInfo) {
try {
inInfo.addBlock(EiConstant.resultBlock).addBlockMeta(new HPPZ015().eiMetadata);
} catch (Exception e) {
LogUtils.setMsg(inInfo, e, "初始化失败");
}
return inInfo;
}
/**
* 查询操作.
*
* @param inInfo
* @return
*/
@OperationLogAnnotation(operModul = "产品模板",operType = "查询",operDesc = "物料清单选择-产品模板-查询")
@Override
public EiInfo query(EiInfo inInfo) {
try {
Map queryRow = EiInfoUtils.getFirstRow(inInfo);
inInfo = super.query(inInfo, HPPZ015.QUERY, new HPPZ015());
} catch (Throwable e) {
LogUtils.setDetailMsg(inInfo, e, "查询失败");
}
return inInfo;
}
}
...@@ -181,17 +181,17 @@ public class HPSCTools { ...@@ -181,17 +181,17 @@ public class HPSCTools {
/** /**
* 查询 * 查询
* *
* @param projName * @param id
* @return * @return
*/ */
public static HPSC001 getId(String projName) { public static HPSC001 getId(String id) {
AssertUtils.isEmpty(projName, "项目编码不能为空"); AssertUtils.isEmpty(id, "项目编码不能为空");
String companyCode = UserSessionUtils.getCompanyCode(); String companyCode = UserSessionUtils.getCompanyCode();
Map queryMap = new HashMap(); Map queryMap = new HashMap();
queryMap.put("projName", projName); queryMap.put("id", id);
queryMap.put("companyCode", companyCode); queryMap.put("companyCode", companyCode);
List<HPSC001> results = DaoBase.getInstance().query("HPSC001.queryProjCode", queryMap); List<HPSC001> results = DaoBase.getInstance().query("HPSC001.queryProjCode", queryMap);
AssertUtils.isNull(results.get(0).getProjCode(), String.format("项目名[%s]信息不存在", projName)); AssertUtils.isNull(results.get(0).getProjCode(), String.format("项目名[%s]信息不存在", id));
return results.get(0); return results.get(0);
} }
...@@ -247,6 +247,21 @@ public class HPSCTools { ...@@ -247,6 +247,21 @@ public class HPSCTools {
AssertUtils.isNull(results, String.format("部件编码[%s]信息不存在", prdtCode)); AssertUtils.isNull(results, String.format("部件编码[%s]信息不存在", prdtCode));
return results.get(0); return results.get(0);
} }
/**
* 查询
*
* @param projCode
* @return
*/
public static HPSC002 getByProjCode(String projCode) {
AssertUtils.isEmpty(projCode, "项目编码不能为空");
Map queryMap = new HashMap();
queryMap.put("projCode", projCode);
List<HPSC002> results = DaoBase.getInstance().query("HPSC002.query", queryMap);
AssertUtils.isNull(results, String.format("项目编码[%s]信息不存在", projCode));
return results.get(0);
}
/** /**
* 查询节点 * 查询节点
......
$(function () {
$("#QUERY").on("click", function () {
resultGrid.dataSource.page(1);
});
IPLATUI.EFGrid.result = {
pageable: {
pageSize: 20,
pageSizes: [10, 20, 50, 70, 100],
},
columns: [
{
field: "operator",
template: function (item) {
let template = '<a style="cursor: pointer;display: inline-flex;justify-content: center;margin:auto 5px" ' +
'onclick="jump(' + item.id + ')" >物料清单</a>';
return template;
}
}
],
}
});
function jump(id) {
var herf= ctx + "\\web\\"+ "HPPZ015A?inqu_status-0-projId=" + id;
window.open(herf);
}
<!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}"/>
<head>
<%-- <link rel="stylesheet" href="${ctx}/css/simulatedOperation.css"/>--%>
</head>
<EF:EFPage title="产品模板">
<EF:EFRegion id="inqu" title="查询条件"><%-- type="query" efRegionShowClear="true" efRegionSave="true"--%>
<div class="row"> <%-- blockId="inqu_status" row="0" --%>
<EF:EFInput blockId="inqu_status" ename="templateName" cname="模板名称:" colWidth="4" row="0"/>
<EF:EFInput blockId="inqu_status" ename="createdName" cname="创建人:" colWidth="4" row="0"/>
</div>
</EF:EFRegion>
<EF:EFRegion id="result" title="记录集">
<EF:EFGrid blockId="result" autoDraw="no">
<EF:EFColumn ename="id" cname="主键" hidden="true"/>
<EF:EFColumn ename="projCode" cname="项目编码" hidden="true"/>
<EF:EFColumn ename="operator" cname="操作" enable="false" width="120" align="center"/>
<EF:EFColumn ename="templateName" cname="模板名称" enable="false" width="120" align="center"/>
<EF:EFColumn ename="createdBy" enable="false" cname="创建人"/>
<EF:EFColumn ename="createdTime" dateFormat="yyyy-MM-dd HH:mm:ss" enable="false" cname="创建时间"/>
<EF:EFColumn ename="updatedBy" enable="false" cname="修改人"/>
<EF:EFColumn ename="updatedTime" dateFormat="yyyy-MM-dd HH:mm:ss" enable="false" cname="修改时间"/>
</EF:EFGrid>
</EF:EFRegion>
</EF:EFPage>
<script>
var ctx = "${ctx}";
</script>
<script src="${ctx}/HP/PZ/HPPZ015.js"></script>
\ No newline at end of file
inventNameGlobalData = [];
prdtNameGlobalData = [];
// 传递参数 将附件ID与当前记录ID进行绑定
// let rowId = '';
let parentId = '';
let projCode = '';
var strs;
var url = location.search; //获取url中"?"符后的字串
if (url.indexOf("?") != -1) { //判断是否有参数
var str = url.substr(1); //从第一个字符开始 因为第0个是?号 获取所有除问号的所有符串
strs = str.split("="); //用等号进行分隔 (因为知道只有一个参数 所以直接用等号进分隔 如果有多个参数 要用&号分隔 再用等号进行分隔)
// console.log('strs=' + strs) //直接弹出第一个参数 (如果有多个参数 还要进行循环的)
}
$(function () {
IPLATUI.EFTree = {
"materialTree": {
ROOT: "root:项目列表",
/**
* 树加载完成后的回调函数
* @param options: 树的配置项
*/
query: function (postEiInfo, model) {
postEiInfo.set("projId",strs?strs[1] : null);
return postEiInfo;
},
loadComplete: function (options) {
// 保持结点展开状态
var expanded = Cookies.get('expanded');
if (expanded) {
Cookies.remove('expanded');
expanded = JSON.parse(expanded);
$("#menu").data("kendoTreeView").expandPath(_.keys(expanded));
}
},
/**
* 选中树结点时触发的事件,注意点击树 折叠/展开 的图标不会触发此事件
*
* @param e
* e.sender kendoTree对象, tree01Tree(EFTree的id + "Tree")
* e.node 点击的节点DOM元素
*/
select: function (e) {
var nodeData = this.dataItem(e.node);
let eiInfo = new EiInfo();
if (nodeData.lv == 1){
eiInfo.set("inqu_status-0-inventTypes", [4]);
}else if (nodeData.lv == 2){
eiInfo.set("inqu_status-0-inventTypes", [3]);
}
var dataSource;
EiCommunicator.send("HPPZ006", "queryPrdtComboBox", eiInfo, {
onSuccess: function (ei) {
dataSource = ei.getBlock("invent_prdt_name_block_id").getMappedRows();
inventNameGlobalData = dataSource;
},
onFail: function (ei) {
}
}, {async: false});
IPLATUI.EFTree.materialTree.selectTreeNode.nodeId = nodeData.nodeId;
IPLATUI.EFTree.materialTree.selectTreeNode.prdtCode = nodeData.prdtCode;
IPLATUI.EFTree.materialTree.selectTreeNode.projCode = nodeData.projCode;
IPLATUI.EFTree.materialTree.selectTreeNode.prdtName = nodeData.prdtName;
IPLATUI.EFTree.materialTree.selectTreeNode.projName = nodeData.projName;
IPLATUI.EFTree.materialTree.selectTreeNode.lv = nodeData.lv;
// 重新查询EFGrid
parentId = nodeData.nodeId;
query();
},
selectTreeNode: {}
}
};
$("#QUERY").on("click", function () {
query();
});
IPLATUI.EFGrid = {
result: {
pageable: {
pageSize: 20,
pageSizes: [10, 20, 50, 70, 100],
},
loadComplete: function (grid) { // 在Grid加载完成后,才能给Grid上的按钮绑定事件
$("#SC02").on("click", function () {
if (grid.getCheckedBlockData().rows.length === 0) {
IPLAT.alert({
message: '<b>请勾选一项</b>',
okFn: function (e) {
},
title: '提示'
});
} else {
console.log(grid.getCheckedBlockData().rows[0][10]);
}
});
},
onSuccess: function (e) {
if(e.eiInfo.extAttr.methodName == 'save'
||e.eiInfo.extAttr.methodName == 'delete'){
query();
refreshTree();
}
},
query: function () {
var ei = new EiInfo();
ei.set("inqu_status-0-prdtType",$("#inqu_status-0-prdtType").val());
ei.set("inqu_status-0-prdtCode",$("#inqu_status-0-prdtCode").val());
ei.set("inqu_status-0-status",$("#inqu_status-0-status").val());
ei.set("inqu_status-0-parentId",parentId? parentId : strs[1]);
// ei.set("inqu_status-0-parentId",-1);
return ei;
},
/**
* 点击行首checkbox,勾选行时触发的事件
* @param e kendo的Event对象
* e.sender kendoGrid对象,resultGrid
* e.fake 用于区分是手动点击的事件还是模拟的事件
* e.checked 用于区分是勾选还是取消勾选
* e.model 勾选或取消勾选的行数据,kendo.data.Model
* e.row 当前行的行号
* e.tr 行的tr,包括固定列和数据列 jquery对象
*/
onCheckRow: function (e) {
if (e.checked) {
console.log('选中');
}
},
/**
* EFGrid新增行之前触发的事件,可以根据业务逻辑控制是否进行新增
* @param e 事件对象
* e.sender Grid对象
* e.preventDefault 阻止事件发生
*/
beforeAdd: function (e) {
var logic = IPLATUI.EFTree.materialTree.selectTreeNode.nodeId ? false : true;
if (logic) { // 通过业务逻辑判断, 控制是否进行新增
IPLAT.alert({
message: '<b>请选择项目列表</b>',
okFn: function (e) {
},
title: '提示'
});
e.preventDefault();
}
},
/**
* EFGrid新增行时触发的事件,此时数据行tr元素还未渲染
* @param e 事件对象
* e.sender Grid对象
* e.preventDefault 不会触发dataBound,不渲染tr
* e.index 插入的行号
* e.items 将要插入的数据行数组([Model,Model, ...])
*/
onAdd: function (e) {
// 动态设置默认邮箱
let selectTreeNode = IPLATUI.EFTree.materialTree.selectTreeNode;
//e.items[0]['prdtType'] = selectTreeNode.lv = 4;
$.each(e.items, function (index, item) {
item['projCode'] = selectTreeNode.projCode;
item['projName'] = selectTreeNode.projName;
item['parentId'] = selectTreeNode.nodeId;
item['parentPrdtName'] = selectTreeNode.prdtName;
if (selectTreeNode.lv == 1){
item['prdtType'] = 4;
}else if (selectTreeNode.lv == 2){
item['prdtType'] = 3;
}
//item['id'] = null
});
},
/**
* 点击Grid保存按钮时触发的事件
* @param e 事件对象
* e.sender Grid对象
*/
onSave: function (e) {
e.preventDefault();
saveFunc();
},
/**
* 点击Grid删除按钮时触发的事件
* @param e 事件对象
* e.sender Grid对象
*/
onDelete: function (e) {
e.preventDefault();
deleteFunc();
},
toolbarConfig: {
hidden: false, // true时,不显示功能按钮,但保留setting导出按钮
// add: false, // 不显示新增按钮
// cancel: false, // 不显示取消按钮
// save: false, // 不显示保存按钮
delete: true, // 显示删除按钮
},
columns: [
{
field: "prdtType",
title: "部件类型",
filter: function (options) {
let selectTreeNode = IPLATUI.EFTree.materialTree.selectTreeNode;
if(selectTreeNode.lv == 1) {
// 返回我们过滤后的数据集
/*return options.values[0][province];*/
return _.filter(options.values, function (item) {
return item["valueField"]==4;
})
} else {
return _.filter(options.values, function (item) {
return item["valueField"]==2 || item["valueField"]==3;
})
}
}
},{
field: "prdtName",
title: "部件名称",
/*query: function (container, options) {
let eiInfo = new EiInfo();
eiInfo.set("inqu_status-0-inventTypes", [3, 4]);
eiInfo.set("inqu_status-0-inventType", options.model["prdtType"]);
return eiInfo;
}*/
template: function (dataItem) {
for (let i = 0; i < prdtNameGlobalData.length; i++) {
if (prdtNameGlobalData[i]['textField'] === dataItem['prdtName']) {
//dataItem["prdtCode"] = prdtNameGlobalData[i]['valueField']
resultGrid.setCellValue(0, "prdtCode", prdtNameGlobalData[i]['valueField']);
return prdtNameGlobalData[i]['textField'];
}
}
return dataItem["prdtName"];
},
editor: function (container, options) {
var grid = container.closest(".k-grid").data("kendoGrid");
var cellIndex = grid.cellIndex(container);
var input = $('<input />');
input.attr("name", options.field);
input.attr("id", options.field);
input.appendTo(container);
let eiInfo = new EiInfo();
let selectTreeNode = IPLATUI.EFTree.materialTree.selectTreeNode;
if (selectTreeNode.lv == 1){
eiInfo.set("inventType", 4);
}else if (selectTreeNode.lv == 2){
eiInfo.set("inventTypes", [2,3]);
}else {
eiInfo.set("inventTypes", [3,4]);
}
eiInfo.set("isSplicingSymbol",false);
var dataSource;
EiCommunicator.send("HPPZ004", "queryComboBox", eiInfo, {
onSuccess: function (ei) {
dataSource = ei.getBlock("invent_name_block_id").getMappedRows();
prdtNameGlobalData = dataSource;
},
onFail: function (ei) {
}
}, {async: false});
input.kendoAutoComplete({
valuePrimitive: true,
dataSource: dataSource,
dataTextField: "textField",
dataValueField: "valueField",
required: "true",
optionLabelTemplate: "#:textField#",
valueTemplate: "#:valueField#",
template: "#:textField#",
filter: "contains"
});
}
}, {
field: "parentPrdtName",
template: function (dataItem) {
if(dataItem.lv > 2){
return dataItem['parentPrdtName'];
}
return "";
}
}
]
},
};
// 关闭事件
IPLATUI.EFWindow = {
"uploadFile": {
close: function (e) {
let $iframe = uploadFileWindow.element.children("iframe");
let iframejQuery = $iframe[0].contentWindow.$; // 子窗口中的jQuery对象
let uploadFile = iframejQuery("#fileDocId").val();
if (isBlank(uploadFile)) {
return;
}
let inEiInfo = new EiInfo();
// inEiInfo.set("result-0-id", rowId);
inEiInfo.set("result-0-filePath1", uploadFile);
EiCommunicator.send('HPPZ015A', 'bindDocIdById', inEiInfo, {
onSuccess(response) {
query();
},
onFail(errorMessage, status, e) {
NotificationUtil("执行失败!", "error");
}
},
{
async: false
}
);
},
}
};
//部件类型下拉联动
$('input[name="inqu_status-0-prdtType"]').change(function () {
var inInfo=new EiInfo();
var prdtType=$("#inqu_status-0-prdtType").val();
inInfo.set("inventType",prdtType);
EiCommunicator.send("HPPZ004", "queryComboBox", inInfo, {
onSuccess: function (ei) {
var input=$("#inqu_status-0-prdtCode");
dataEdition=ei.getBlock("invent_name_block_id").getMappedRows();
input.kendoDropDownList({
valuePrimitive: true,
dataTextField: "textField",
dataValueField: "valueField",
optionLabel:"请选择",
dataSource: dataEdition,
template: "#=textField#"
});
}, onFail: function (ei) {
}
}, {async: false});
});
});
$(window).load(function () {
// 存货名称
let inInfo = new EiInfo();
inInfo.set("inqu_status-0-inventTypes", [3, 4]);
EiCommunicator.send("HPPZ006", "queryPrdtComboBox", inInfo, {
onSuccess: function (ei) {
inventNameGlobalData = ei.getBlock("invent_prdt_name_block_id").getMappedRows();
},
onFail: function (ei) {
}
}, {async: false});
// 查
query();
});
/**
* 查询
*/
let query = function () {
resultGrid.dataSource.page(1);
}
let refreshTree = function () {
//更新树
var tree = $("#materialTree").data("kendoTreeView");
var inInfo = new EiInfo();
EiCommunicator.send("HPPZ015A", "queryTreeNode", inInfo, {//传入参数
onSuccess: function (inInfo) {
tree.reload("root");//更新树
}
});
}
function openUploadFile(id) {
uploadFileWindow.open().center();
// rowId = id;
}
function check(id, auditStatus) {
const inEiInfo = new EiInfo();
inEiInfo.set("result-0-id", id);
inEiInfo.set("result-0-status", auditStatus);
EiCommunicator.send('HPPZ015A', 'check', inEiInfo, {
onSuccess(response) {
NotificationUtil(response.msg);
query();
},
onFail(errorMessage, status, e) {
NotificationUtil("执行失败!", "error");
}
},
{
async: false
}
);
}
/**
* 删除
*/
function deleteFunc() {
let rows = resultGrid.getCheckedRows();
if (rows.length < 1) {
message("请选择数据");
return;
}
let flag = true;
$.each(rows, function(index, item) {
let pgStatus= item.get("pgStatus");
if(pgStatus==="1"||pgStatus==="2"){
message("选中的第"+(index+1)+"行记录已派工,不能删除!");
flag = false;
return false;
}
});
if(flag){
JSUtils.confirm("确定对勾选中的[" + rows.length + "]条数据做\"删除\"操作? ", {
ok: function () {
JSUtils.submitGridsData("result", "HPPZ015A", "delete", true);
updateTree();
}
});
}
}
function saveFunc() {
let rows = resultGrid.getCheckedRows();
if (rows.length < 1) {
message("请选择数据");
return;
}
let flag = true;
$.each(rows, function(index, item) {
let prdtType= item.get("prdtType");
let prdtName= item.get("prdtName");
let unitWt= item.get("unitWt");
if(isBlank(prdtType)){
message("选中的第"+(index+1)+"行\"部件类型\",不能为空!");
flag = false;
return false;
}
if(isBlank(prdtName)){
message("选中的第"+(index+1)+"行\"部件名称\",不能为空!");
flag = false;
return false;
}
if(isBlank(unitWt)){
message("选中的第"+(index+1)+"行\"单重\",不能为空!");
flag = false;
return false;
}
});
if(flag){
JSUtils.confirm("确定对勾选中的[" + rows.length + "]条数据做\"保存\"操作? ", {
ok: function () {
JSUtils.submitGridsData("result", "HPPZ015A", "save", true);
updateTree();
}
});
}
}
//更新树
function updateTree() {
var tree = $("#materialTree").data("kendoTreeView");
var inInfo = new EiInfo();
EiCommunicator.send("HPPZ015A", "queryTreeNode", inInfo, {//传入参数
onSuccess: function (inInfo) {
tree.reload("root");//更新树
}
});
}
<!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}"/>
<head>
<%-- <link rel="stylesheet" href="${ctx}/css/simulatedOperation.css"/>--%>
</head>
<EF:EFPage title="产品模板-物料清单">
<EF:EFRegion id="inqu" title="查询条件">
<div class="row">
<EF:EFSelect cname="部件名称" ename="inqu_status-0-prdtCode" colWidth="3" filter="contains" defultValue="">
<EF:EFOption label="全部" value=""/>
<EF:EFOptions blockId="invent_name_block_id" textField="textField" valueField="valueField"/>
</EF:EFSelect>
</div>
<%-- <EF:EFButton ename="QUERY" cname="查询" row="1" class="btn-align-right"></EF:EFButton>--%>
</EF:EFRegion>
<div id="splitter" class="i-fit-height" style="display: inline">
<div id="left-pane" class="i-fit-height" style="width: 20%;float:left;">
<EF:EFRegion id="projTree" title="BOM结构图" fitHeight="true">
<EF:EFTree id="materialTree"
valueField="label"
textField="text"
hasChildren="leaf"
serviceName="HPPZ015A"
methodName="queryTreeNode">
</EF:EFTree>
</EF:EFRegion>
</div>
<div id="right-pane" class="i-fit-height" style="width: 80%;float: right">
<EF:EFRegion id="result" title="明细信息">
<EF:EFGrid blockId="result" autoDraw="override">
<EF:EFColumn ename="id" cname="主键" hidden="true"/>
<EF:EFColumn ename="level" cname="层级" hidden="true"/>
<EF:EFColumn ename="projCode" cname="项目编码" enable="false" hidden="true"/>
<EF:EFColumn ename="projName" cname="项目名称" enable="false" hidden="true"/>
<EF:EFComboColumn ename="prdtType" cname="部件类型" align="center" required="true"
filter="contains" width="90" enable="false" hidden="true">
<EF:EFOptions blockId="codeset_code_block_id" valueField="valueField" textField="textField"/>
</EF:EFComboColumn>
<EF:EFColumn ename="prdtCode" cname="部件编码" hidden='true'/>
<EF:EFColumn ename="prdtName" cname="部件名称" width="140" align="center" maxLength="50"
required="true"/>
<EF:EFColumn ename="length" cname="长(MM)" width="80" format="{0:N3}" maxLength="12" displayType="0.000"
data-regex="/^-?[0-9]{1,9}([.][0-9]{1,3})?$/"
data-errorprompt="请输入数字,该值最大可设置9位整数和3位小数!"/>
<EF:EFColumn ename="width" cname="宽(MM)" width="80" format="{0:N3}" maxLength="12" displayType="0.000"
data-regex="/^-?[0-9]{1,9}([.][0-9]{1,3})?$/"
data-errorprompt="请输入数字,该值最大可设置9位整数和3位小数!"/>
<EF:EFColumn ename="thick" cname="厚(MM)" width="80" format="{0:N3}" maxLength="12" displayType="0.000"
data-regex="/^-?[0-9]{1,9}([.][0-9]{1,3})?$/"
data-errorprompt="请输入数字,该值最大可设置9位整数和3位小数!"/>
<EF:EFColumn enable="false" ename="parentId" hidden="true" cname="上级部件名称"/>
<EF:EFColumn enable="false" ename="parentPrdtName" hidden="true" cname="上级部件名称"/>
<EF:EFColumn ename="unitWt" format="{0:N3}" cname="单重(T)" maxLength="15" displayType="0.000"
data-regex="/^-?[0-9]{1,12}([.][0-9]{1,3})?$/"
data-errorprompt="请输入数字,该值最大可设置12位整数和3位小数!"
required="true"/>
</EF:EFGrid>
</EF:EFRegion>
</div>
</div>
</EF:EFPage>
<script>
let ctx="${ctx}";
</script>
<script src="${ctx}/HP/SC/HPSC012.js"></script>
...@@ -420,10 +420,115 @@ $(function () { ...@@ -420,10 +420,115 @@ $(function () {
window.location.href = href; window.location.href = href;
}); });
/**
* 生成模板
*/
$("#GENERATE").on("click", function () {
var projCode = IPLATUI.EFTree.materialTree.selectTreeNode.projCode;
if (projCode === undefined) {
IPLAT.alert({
message: '<b>请选择项目列表</b>',
okFn: function (e) {
},
title: '提示'
});
}else {
IPLAT.confirm({
message: '<b>模板名称:<red>*<red></b> <input id="generateName" name="generateName" ' +
'class="k-textbox" with="30px" required="true" />',
okFn: function (e) {
var generateName = $("#generateName").val();
if (generateName === "") {
message("模板名称不能为空!");
} else {
generateMode(projCode, generateName);
}
},
cancelFn: function (e) {
IPLAT.NotificationUtil('取消该操作');
},
title: '生成物料清单模板确认',
minWidth: 300
});
}
});
// 模板选择
$("#ASSIGN").on("click", assign);
/**
* 物料生成
*/
function assign() {
var projCode = IPLATUI.EFTree.materialTree.selectTreeNode.projCode;
if (projCode === undefined) {
IPLAT.alert({
message: '<b>请选择项目列表</b>',
okFn: function (e) {
},
title: '提示'
});
}else {
JSColorbox.open({
href: "HPSC002C?methodName=initLoad",
title: "<div style='text-align: center;'>选择产品模板</div>",
width: "70%",
height: "70%",
callbackName: function (row) {
var info = new EiInfo()
info.set("id", row.id);
info.set("projCode", row.projCode);
/* EiCommunicator.send("HPPZ015", "assign", info, {
onSuccess: function (ei) {
if (ei["status"] == -1) {
NotificationUtil(ei, "error");
} else {
NotificationUtil({
msg: ei.msg
});
// 刷新列表
resultGrid.dataSource.page(1);
// 关闭弹窗
JSColorbox.close();
}
}, onFail: function (ei) {
}
}, {async: false});*/
}
});
}
}
function generateMode(projCode,generateName) {
const inEiInfo = new EiInfo();
inEiInfo.set("projCode", projCode);
inEiInfo.set("templateName", generateName);
EiCommunicator.send('HPPZ015', 'insert', inEiInfo, {
onSuccess(response) {
if(response.status === -1) {
IPLAT.NotificationUtil(response.msg, "error");
}
else {
IPLAT.NotificationUtil(response.msg);
}
},
onFail(errorMessage, status, e) {
NotificationUtil("执行失败!", e.message);
}
},
{
async: false
}
);
}
// 关闭事件 // 关闭事件
IPLATUI.EFWindow = { IPLATUI.EFWindow = {
"uploadFile": { "uploadFile": {
close: function (e) { close: function (e) {
var tree = $("#materialTree").data("kendoTreeView");
let $iframe = uploadFileWindow.element.children("iframe"); let $iframe = uploadFileWindow.element.children("iframe");
let iframejQuery = $iframe[0].contentWindow.$; // 子窗口中的jQuery对象 let iframejQuery = $iframe[0].contentWindow.$; // 子窗口中的jQuery对象
let uploadFile = iframejQuery("#fileDocId").val(); let uploadFile = iframejQuery("#fileDocId").val();
...@@ -541,6 +646,7 @@ function check(id, auditStatus) { ...@@ -541,6 +646,7 @@ function check(id, auditStatus) {
); );
} }
/** /**
* 删除 * 删除
*/ */
...@@ -631,3 +737,4 @@ function updateTree() { ...@@ -631,3 +737,4 @@ function updateTree() {
$(function () {
// 查询
$("#QUERY").on("click", query);
IPLATUI.EFGrid = {
"result": {
pageable: {
input: true,
numeric: false,
pageSize: 15,
position: 'top',
pageSizes: [15, 50, 100, 200]
},
columns: []
}
}
$("#CONFIRM").on("click", function () {
let rows = resultGrid.getCheckedRows()
console.log(rows)
if (rows.length != 1) {
message("请选择一条数据 ");
return;
}
let row = rows[0];
let isInput= decodeURI(window.location.href.split("&")[1]);
if(isInput==="isInput"){
parent.JSColorbox.setValueCallback(row);
return;
};
JSUtils.confirm("确定选择改模板吗? ", {
ok: function () {
parent.JSColorbox.setValueCallback(row);
}
});
});
$('input[name="inqu_status-0-factoryCode"]').change(function () {
var inInfo=new EiInfo();
var factoryCode=$("#inqu_status-0-factoryCode").val();
var orgType = $('#inqu_status-0-orgType').val();
inInfo.set("inqu_status-0-parentOrgId",factoryCode);
inInfo.set("inqu_status-0-orgType",orgType);
EiCommunicator.send("HPXSOrg", "queryGroupComboBox", inInfo, {
onSuccess: function (ei) {
var input=$("#inqu_status-0-groupCode");
dataEdition=ei.getBlock("group_record_block_id").getMappedRows();
input.kendoDropDownList({
valuePrimitive: true,
dataTextField: "textField",
dataValueField: "valueField",
optionLabel:"请选择",
dataSource: dataEdition,
template: "#=textField#"
});
}, onFail: function (ei) {
}
}, {async: false});
});
});
$(window).load(function () {
// 查询
query();
});
let query = function () {
resultGrid.dataSource.page(1);
}
\ No newline at end of file
<!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="查询条件">
<EF:EFInput cname="组类型" ename="orgType" blockId="inqu_status" row="0" type="hidden"/>
<div class="row">
<EF:EFInput blockId="inqu_status" ename="templateName" cname="模板名称:" colWidth="4" row="0"/>
</div>
</EF:EFRegion>
<EF:EFRegion id="result" title="明细信息">
<EF:EFGrid blockId="result" autoDraw="override" isFloat="true" checkMode="single,row">
<EF:EFColumn ename="id" cname="主键" hidden="true"/>
<EF:EFColumn ename="projCode" cname="项目编码" hidden="true"/>
<EF:EFColumn ename="templateName" cname="模板名称" enable="false" width="120" align="center"/>
<EF:EFColumn ename="createdBy" enable="false" cname="创建人"/>
</EF:EFGrid>
</EF:EFRegion>
</EF:EFPage>
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment