Commit ea3f0bf1 by yukang

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

# Conflicts:
#	src/main/webapp/HP/SC/HPSC010.js
parents 9fe96665 8af5b219
......@@ -351,6 +351,12 @@ public enum DdynamicEnum {
*/
GROUP_RECORD1_BLOCK_ID("group_record_block_id","orgId","orgCname","HPSC010.queryGroupComboBox"),
FACTORY_CODE_BOX_BLOCK_ID("factoryCodeBox_block_id","factoryCode","factoryName","HPSB001.queryFactoryCodeBox"),
GROUP_CODE_BOX_BLOCK_ID("groupCodeBox_block_id","groupCode","groupName","factoryCode","factoryName","HPSB001.queryGroupCodeBox"),
USER_ID_BOX_BLOCK_ID("userIdBox_block_id","userId","userName","HPSB001.queryUserIdBox"),
/**
* 模块:工人管理
* 用途:工人管理下拉框
......
......@@ -46,12 +46,12 @@
from (select
(select
sum(USER_COUNT)
FROM hpjx.t_hpsc008
from hpjx.t_hpsc008
where DELETE_FLAG = 0 and COMPANY_CODE = #companyCode# and left(REGISTER_DATE,4) = left(#date#,4) and REGISTER_DATE <![CDATA[<=]]> #date# and FACTORY_CODE = #factorycode# ) as YGL,
0 as JHCL,
(select
sum(WEIGHT)
FROM hpjx.t_hpsc008
from hpjx.t_hpsc008
where DELETE_FLAG = 0 and COMPANY_CODE = #companyCode# and left(REGISTER_DATE,4) = left(#date#,4) and REGISTER_DATE <![CDATA[<=]]> #date# and FACTORY_CODE = #factorycode# ) as SJCL
from dual) a
</select>
......@@ -62,13 +62,13 @@
concat(format(ifnull(JH,0),2),'T') as JH,
concat(format(ifnull(ZH,0),2),'T') as ZH
from (select
(select sum(WEIGHT) FROM hpjx.T_HPXS001
(select sum(WEIGHT) FROM hpjx.t_hpsc009
where DELETE_FLAG = 0 and COMPANY_CODE = #companyCode# and REGISTER_DATE = #date# and FACTORY_CODE = #factorycode#
group by FACTORY_CODE) as ZP,
(select sum(WEIGHT_JH) FROM hpjx.T_HPXS001
(select sum(WEIGHT_JH) FROM hpjx.t_hpsc009
where DELETE_FLAG = 0 and COMPANY_CODE = #companyCode# and REGISTER_DATE = #date# and FACTORY_CODE = #factorycode#
group by FACTORY_CODE) as JH,
(select sum(ifnull(WEIGHT,0)+ifnull(WEIGHT_JH,0))/2 FROM hpjx.T_HPXS001
(select sum(ifnull(WEIGHT,0)+ifnull(WEIGHT_JH,0))/2 FROM hpjx.t_hpsc009
where DELETE_FLAG = 0 and COMPANY_CODE = #companyCode# and REGISTER_DATE = #date# and FACTORY_CODE = #factorycode#
group by FACTORY_CODE) as ZH
from dual) a
......@@ -91,7 +91,7 @@
join iplat.TXSOG01 b on a.ORG_ID = b.PARENT_ORG_ID
join iplat.TXSOG01 c on b.ORG_ID = c.PARENT_ORG_ID
where a.ORG_TYPE = 'factory' and b.ORG_TYPE = 'dept' and c.ORG_TYPE = 'prodGroup' and a.IS_DELETED = 0 and b.IS_DELETED =0 and c.IS_DELETED = 0) a
left join hpjx.T_HPXS001 b on b.FACTORY_CODE = a.FACTORY_CODE and b.GROUP_CODE = a.GROUP_CODE and b.COMPANY_CODE = #companyCode# and b.REGISTER_DATE = #date# and b.FACTORY_CODE = #factorycode# and b.DELETE_FLAG = 0
left join hpjx.t_hpsc009 b on b.FACTORY_CODE = a.FACTORY_CODE and b.GROUP_CODE = a.GROUP_CODE and b.COMPANY_CODE = #companyCode# and b.REGISTER_DATE = #date# and b.FACTORY_CODE = #factorycode# and b.DELETE_FLAG = 0
group by a.GROUP_NAME,b.GROUP_TYPE
union all
select
......@@ -108,7 +108,7 @@
join iplat.TXSOG01 b on a.ORG_ID = b.PARENT_ORG_ID
join iplat.TXSOG01 c on b.ORG_ID = c.PARENT_ORG_ID
where a.ORG_TYPE = 'factory' and b.ORG_TYPE = 'dept' and c.ORG_TYPE = 'prodGroup' and a.IS_DELETED = 0 and b.IS_DELETED =0 and c.IS_DELETED = 0) a
left join hpjx.T_HPXS001 b on b.FACTORY_CODE = a.FACTORY_CODE and b.GROUP_CODE = a.GROUP_CODE and b.COMPANY_CODE = #companyCode# and b.REGISTER_DATE = #date# and b.FACTORY_CODE = #factorycode# and b.DELETE_FLAG = 0
left join hpjx.t_hpsc009 b on b.FACTORY_CODE = a.FACTORY_CODE and b.GROUP_CODE = a.GROUP_CODE and b.COMPANY_CODE = #companyCode# and b.REGISTER_DATE = #date# and b.FACTORY_CODE = #factorycode# and b.DELETE_FLAG = 0
group by a.GROUP_NAME,b.GROUP_TYPE
union all
select
......@@ -125,7 +125,7 @@
join iplat.TXSOG01 b on a.ORG_ID = b.PARENT_ORG_ID
join iplat.TXSOG01 c on b.ORG_ID = c.PARENT_ORG_ID
where a.ORG_TYPE = 'factory' and b.ORG_TYPE = 'dept' and c.ORG_TYPE = 'prodGroup' and a.IS_DELETED = 0 and b.IS_DELETED =0 and c.IS_DELETED = 0) a
left join hpjx.T_HPXS001 b on b.FACTORY_CODE = a.FACTORY_CODE and b.GROUP_CODE = a.GROUP_CODE and b.COMPANY_CODE = #companyCode# and b.REGISTER_DATE = #date# and b.FACTORY_CODE = #factorycode# and b.DELETE_FLAG = 0
left join hpjx.t_hpsc009 b on b.FACTORY_CODE = a.FACTORY_CODE and b.GROUP_CODE = a.GROUP_CODE and b.COMPANY_CODE = #companyCode# and b.REGISTER_DATE = #date# and b.FACTORY_CODE = #factorycode# and b.DELETE_FLAG = 0
group by a.GROUP_NAME) a
order by SORT,SORT1 asc
</select>
......@@ -138,7 +138,7 @@
join iplat.TXSOG01 b on a.ORG_ID = b.PARENT_ORG_ID
join iplat.TXSOG01 c on b.ORG_ID = c.PARENT_ORG_ID
where a.ORG_TYPE = 'factory' and b.ORG_TYPE = 'dept' and c.ORG_TYPE = 'prodGroup' and a.IS_DELETED = 0 and b.IS_DELETED =0 and c.IS_DELETED = 0) a
left join hpjx.T_HPXS001 b on a.GROUP_CODE = b.GROUP_CODE and b.REGISTER_DATE = #date# and b.DELETE_FLAG = 0
left join hpjx.t_hpsc009 b on a.GROUP_CODE = b.GROUP_CODE and b.REGISTER_DATE = #date# and b.DELETE_FLAG = 0
where a.COMPANY_CODE = #companyCode# and a.FACTORY_CODE = #factorycode#
group by a.GROUP_NAME,a.GROUP_CODE
order by a.GROUP_CODE
......@@ -150,7 +150,7 @@
select
a.GROUP_NAME as SERIES,
concat(substring(replace(date_sub(str_to_date(#date#,'%Y%m%d'), INTERVAL 4 day),'-',''),5,2),'/',substring(replace(date_sub(str_to_date(#date#,'%Y%m%d'), INTERVAL 4 day),'-',''),7,2)) as X,
ifnull(sum(WEIGHT),0) as VALUE
sum(ifnull(WEIGHT,0)+ifnull(WEIGHT_JH,0))/2 as VALUE
,replace(date_sub(str_to_date(#date#,'%Y%m%d'), INTERVAL 4 day),'-','') as date,
case when right(a.GROUP_NAME,2) = '一组' then 1
when right(a.GROUP_NAME,2) = '二组' then 2
......@@ -161,14 +161,14 @@
join iplat.TXSOG01 b on a.ORG_ID = b.PARENT_ORG_ID
join iplat.TXSOG01 c on b.ORG_ID = c.PARENT_ORG_ID
where a.ORG_TYPE = 'factory' and b.ORG_TYPE = 'dept' and c.ORG_TYPE = 'prodGroup' and a.IS_DELETED = 0 and b.IS_DELETED =0 and c.IS_DELETED = 0) a
left join hpjx.T_HPXS001 b on b.FACTORY_CODE = a.FACTORY_CODE and b.GROUP_CODE = a.GROUP_CODE and b.COMPANY_CODE = #companyCode# and b.DELETE_FLAG = 0
left join hpjx.t_hpsc009 b on b.FACTORY_CODE = a.FACTORY_CODE and b.GROUP_CODE = a.GROUP_CODE and b.COMPANY_CODE = #companyCode# and b.DELETE_FLAG = 0
and b.REGISTER_DATE = replace(date_sub(str_to_date(#date#,'%Y%m%d'), INTERVAL 4 day),'-','') and b.FACTORY_CODE = #factorycode#
group by a.GROUP_NAME,b.REGISTER_DATE
union all
select
a.GROUP_NAME as SERIES,
concat(substring(replace(date_sub(str_to_date(#date#,'%Y%m%d'), INTERVAL 3 day),'-',''),5,2),'/',substring(replace(date_sub(str_to_date(#date#,'%Y%m%d'), INTERVAL 3 day),'-',''),7,2)) as X,
ifnull(sum(WEIGHT),0) as VALUE
sum(ifnull(WEIGHT,0)+ifnull(WEIGHT_JH,0))/2 as VALUE
,replace(date_sub(str_to_date(#date#,'%Y%m%d'), INTERVAL 3 day),'-','') as date,
case when right(a.GROUP_NAME,2) = '一组' then 1
when right(a.GROUP_NAME,2) = '二组' then 2
......@@ -179,14 +179,14 @@
join iplat.TXSOG01 b on a.ORG_ID = b.PARENT_ORG_ID
join iplat.TXSOG01 c on b.ORG_ID = c.PARENT_ORG_ID
where a.ORG_TYPE = 'factory' and b.ORG_TYPE = 'dept' and c.ORG_TYPE = 'prodGroup' and a.IS_DELETED = 0 and b.IS_DELETED =0 and c.IS_DELETED = 0) a
left join hpjx.T_HPXS001 b on b.FACTORY_CODE = a.FACTORY_CODE and b.GROUP_CODE = a.GROUP_CODE and b.COMPANY_CODE = #companyCode# and b.DELETE_FLAG = 0
left join hpjx.t_hpsc009 b on b.FACTORY_CODE = a.FACTORY_CODE and b.GROUP_CODE = a.GROUP_CODE and b.COMPANY_CODE = #companyCode# and b.DELETE_FLAG = 0
and b.REGISTER_DATE = replace(date_sub(str_to_date(#date#,'%Y%m%d'), INTERVAL 3 day),'-','') and b.FACTORY_CODE = #factorycode#
group by a.GROUP_NAME,b.REGISTER_DATE
union all
select
a.GROUP_NAME as SERIES,
concat(substring(replace(date_sub(str_to_date(#date#,'%Y%m%d'), INTERVAL 2 day),'-',''),5,2),'/',substring(replace(date_sub(str_to_date(#date#,'%Y%m%d'), INTERVAL 2 day),'-',''),7,2)) as X,
ifnull(sum(WEIGHT),0) as VALUE
sum(ifnull(WEIGHT,0)+ifnull(WEIGHT_JH,0))/2 as VALUE
,replace(date_sub(str_to_date(#date#,'%Y%m%d'), INTERVAL 2 day),'-','') as date,
case when right(a.GROUP_NAME,2) = '一组' then 1
when right(a.GROUP_NAME,2) = '二组' then 2
......@@ -197,14 +197,14 @@
join iplat.TXSOG01 b on a.ORG_ID = b.PARENT_ORG_ID
join iplat.TXSOG01 c on b.ORG_ID = c.PARENT_ORG_ID
where a.ORG_TYPE = 'factory' and b.ORG_TYPE = 'dept' and c.ORG_TYPE = 'prodGroup' and a.IS_DELETED = 0 and b.IS_DELETED =0 and c.IS_DELETED = 0) a
left join hpjx.T_HPXS001 b on b.FACTORY_CODE = a.FACTORY_CODE and b.GROUP_CODE = a.GROUP_CODE and b.COMPANY_CODE = #companyCode# and b.DELETE_FLAG = 0
left join hpjx.t_hpsc009 b on b.FACTORY_CODE = a.FACTORY_CODE and b.GROUP_CODE = a.GROUP_CODE and b.COMPANY_CODE = #companyCode# and b.DELETE_FLAG = 0
and b.REGISTER_DATE = replace(date_sub(str_to_date(#date#,'%Y%m%d'), INTERVAL 2 day),'-','') and b.FACTORY_CODE = #factorycode#
group by a.GROUP_NAME,b.REGISTER_DATE
union all
select
a.GROUP_NAME as SERIES,
concat(substring(replace(date_sub(str_to_date(#date#,'%Y%m%d'), INTERVAL 1 day),'-',''),5,2),'/',substring(replace(date_sub(str_to_date(#date#,'%Y%m%d'), INTERVAL 1 day),'-',''),7,2)) as X,
ifnull(sum(WEIGHT),0) as VALUE
sum(ifnull(WEIGHT,0)+ifnull(WEIGHT_JH,0))/2 as VALUE
,replace(date_sub(str_to_date(#date#,'%Y%m%d'), INTERVAL 1 day),'-','') as date,
case when right(a.GROUP_NAME,2) = '一组' then 1
when right(a.GROUP_NAME,2) = '二组' then 2
......@@ -215,14 +215,14 @@
join iplat.TXSOG01 b on a.ORG_ID = b.PARENT_ORG_ID
join iplat.TXSOG01 c on b.ORG_ID = c.PARENT_ORG_ID
where a.ORG_TYPE = 'factory' and b.ORG_TYPE = 'dept' and c.ORG_TYPE = 'prodGroup' and a.IS_DELETED = 0 and b.IS_DELETED =0 and c.IS_DELETED = 0) a
left join hpjx.T_HPXS001 b on b.FACTORY_CODE = a.FACTORY_CODE and b.GROUP_CODE = a.GROUP_CODE and b.COMPANY_CODE = #companyCode# and b.DELETE_FLAG = 0
left join hpjx.t_hpsc009 b on b.FACTORY_CODE = a.FACTORY_CODE and b.GROUP_CODE = a.GROUP_CODE and b.COMPANY_CODE = #companyCode# and b.DELETE_FLAG = 0
and b.REGISTER_DATE = replace(date_sub(str_to_date(#date#,'%Y%m%d'), INTERVAL 1 day),'-','') and b.FACTORY_CODE = #factorycode#
group by a.GROUP_NAME,b.REGISTER_DATE
union all
select
a.GROUP_NAME as SERIES,
concat(substring(#date#,5,2),'/',substring(#date#,7,2)) as X,
ifnull(sum(WEIGHT),0) as VALUE
sum(ifnull(WEIGHT,0)+ifnull(WEIGHT_JH,0))/2 as VALUE
,#date# as date,
case when right(a.GROUP_NAME,2) = '一组' then 1
when right(a.GROUP_NAME,2) = '二组' then 2
......@@ -233,7 +233,7 @@
join iplat.TXSOG01 b on a.ORG_ID = b.PARENT_ORG_ID
join iplat.TXSOG01 c on b.ORG_ID = c.PARENT_ORG_ID
where a.ORG_TYPE = 'factory' and b.ORG_TYPE = 'dept' and c.ORG_TYPE = 'prodGroup' and a.IS_DELETED = 0 and b.IS_DELETED =0 and c.IS_DELETED = 0) a
left join hpjx.T_HPXS001 b on b.FACTORY_CODE = a.FACTORY_CODE and b.GROUP_CODE = a.GROUP_CODE and b.COMPANY_CODE = #companyCode# and b.DELETE_FLAG = 0
left join hpjx.t_hpsc009 b on b.FACTORY_CODE = a.FACTORY_CODE and b.GROUP_CODE = a.GROUP_CODE and b.COMPANY_CODE = #companyCode# and b.DELETE_FLAG = 0
and b.REGISTER_DATE = #date# and b.FACTORY_CODE = #factorycode#
group by a.GROUP_NAME
) a
......
package com.baosight.hpjx.hp.sc.domain;
import com.baosight.iplat4j.core.util.NumberUtils;
import java.math.BigDecimal;
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:THpsc009.java <br>
* Description: <br>
*
* Copyrigth:Baosight Software LTD.co Copyright (c) 2019. <br>
*
* @version 1.0
* @history 2024-04-10 17:28:06 create
*/
public class HPSC010A 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_REGISTER_DATE = "registerDate"; /* 登记日期*/
public static final String FIELD_FACTORY_CODE = "factoryCode"; /* 工厂代码*/
public static final String FIELD_GROUP_CODE = "groupCode"; /* 生产组代码*/
public static final String FIELD_USER_ID = "userId"; /* 员工代码*/
public static final String FIELD_GROUP_TYPE = "groupType"; /* 生产类型*/
public static final String FIELD_PRDT_CODE = "prdtCode"; /* 产品代码*/
public static final String FIELD_PRDT_NAME = "prdtName"; /* 产品名称*/
public static final String FIELD_WEIGHT = "weight"; /* 产量*/
public static final String FIELD_WEIGHT_JH = "weightJh"; /* 加焊产量*/
public static final String FIELD_PARENT_ID = "parentId"; /* 父级ID*/
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_REGISTER_DATE = "REGISTER_DATE"; /* 登记日期*/
public static final String COL_FACTORY_CODE = "FACTORY_CODE"; /* 工厂代码*/
public static final String COL_GROUP_CODE = "GROUP_CODE"; /* 生产组代码*/
public static final String COL_USER_ID = "USER_ID"; /* 员工代码*/
public static final String COL_GROUP_TYPE = "GROUP_TYPE"; /* 生产类型*/
public static final String COL_PRDT_CODE = "PRDT_CODE"; /* 产品代码*/
public static final String COL_PRDT_NAME = "PRDT_NAME"; /* 产品名称*/
public static final String COL_WEIGHT = "WEIGHT"; /* 产量*/
public static final String COL_WEIGHT_JH = "WEIGHT_JH"; /* 加焊产量*/
public static final String COL_PARENT_ID = "PARENT_ID"; /* 父级ID*/
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 = "HPSC010A.query";
public static final String COUNT = "HPSC010A.count";
public static final String INSERT = "HPSC010A.insert";
public static final String UPDATE = "HPSC010A.update";
public static final String DELETE = "HPSC010A.delete";
public static final String DELETE_FLAG = "HPSC010A.deleteFlag";
public static final String DELETE_PARENT_ID = "HPSC010A.deleteParentId";
public static final String QUERY_DETAIL = "HPSC010A.queryDetail";
public static final String QUERY_RESULT = "HPSC010A.queryResult";
private Long id = new Long(0); /* ID*/
private String companyCode = " "; /* 企业编码 预留*/
private String depCode = " "; /* 部门编码 预留*/
private String registerDate = " "; /* 登记日期*/
private String factoryCode = " "; /* 工厂代码*/
private String groupCode = " "; /* 生产组代码*/
private String userId = " "; /* 员工代码*/
private String groupType = " "; /* 生产类型*/
private String prdtCode = " "; /* 产品代码*/
private String prdtName = " "; /* 产品名称*/
private BigDecimal weight = new BigDecimal("0"); /* 产量*/
private BigDecimal weightJh = new BigDecimal("0"); /* 加焊产量*/
private Long parentId = new Long(0); /* 父级ID*/
private Integer 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_REGISTER_DATE);
eiColumn.setDescName("登记日期");
eiMetadata.addMeta(eiColumn);
eiColumn = new EiColumn(FIELD_FACTORY_CODE);
eiColumn.setDescName("工厂代码");
eiMetadata.addMeta(eiColumn);
eiColumn = new EiColumn(FIELD_GROUP_CODE);
eiColumn.setDescName("生产组代码");
eiMetadata.addMeta(eiColumn);
eiColumn = new EiColumn(FIELD_USER_ID);
eiColumn.setDescName("员工代码");
eiMetadata.addMeta(eiColumn);
eiColumn = new EiColumn(FIELD_GROUP_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_WEIGHT);
eiColumn.setType("N");
eiColumn.setScaleLength(3);
eiColumn.setFieldLength(20);
eiColumn.setDescName("产量");
eiMetadata.addMeta(eiColumn);
eiColumn = new EiColumn(FIELD_WEIGHT_JH);
eiColumn.setType("N");
eiColumn.setScaleLength(3);
eiColumn.setFieldLength(20);
eiColumn.setDescName("加焊产量");
eiMetadata.addMeta(eiColumn);
eiColumn = new EiColumn(FIELD_PARENT_ID);
eiColumn.setDescName("父级ID");
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 HPSC010A() {
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 registerDate - 登记日期.
* @return the registerDate
*/
public String getRegisterDate() {
return this.registerDate;
}
/**
* set the registerDate - 登记日期.
*
* @param registerDate - 登记日期
*/
public void setRegisterDate(String registerDate) {
this.registerDate = registerDate;
}
/**
* get the factoryCode - 工厂代码.
* @return the factoryCode
*/
public String getFactoryCode() {
return this.factoryCode;
}
/**
* set the factoryCode - 工厂代码.
*
* @param factoryCode - 工厂代码
*/
public void setFactoryCode(String factoryCode) {
this.factoryCode = factoryCode;
}
/**
* get the groupCode - 生产组代码.
* @return the groupCode
*/
public String getGroupCode() {
return this.groupCode;
}
/**
* set the groupCode - 生产组代码.
*
* @param groupCode - 生产组代码
*/
public void setGroupCode(String groupCode) {
this.groupCode = groupCode;
}
/**
* get the userId - 员工代码.
* @return the userId
*/
public String getUserId() {
return this.userId;
}
/**
* set the userId - 员工代码.
*
* @param userId - 员工代码
*/
public void setUserId(String userId) {
this.userId = userId;
}
/**
* get the groupType - 生产类型.
* @return the groupType
*/
public String getGroupType() {
return this.groupType;
}
/**
* set the groupType - 生产类型.
*
* @param groupType - 生产类型
*/
public void setGroupType(String groupType) {
this.groupType = groupType;
}
/**
* 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 weight - 产量.
* @return the weight
*/
public BigDecimal getWeight() {
return this.weight;
}
/**
* set the weight - 产量.
*
* @param weight - 产量
*/
public void setWeight(BigDecimal weight) {
this.weight = weight;
}
/**
* get the weightJh - 加焊产量.
* @return the weightJh
*/
public BigDecimal getWeightJh() {
return this.weightJh;
}
/**
* set the weightJh - 加焊产量.
*
* @param weightJh - 加焊产量
*/
public void setWeightJh(BigDecimal weightJh) {
this.weightJh = weightJh;
}
/**
* get the parentId - 父级ID.
* @return the parentId
*/
public Long getParentId() {
return this.parentId;
}
/**
* set the parentId - 父级ID.
*
* @param parentId - 父级ID
*/
public void setParentId(Long parentId) {
this.parentId = parentId;
}
/**
* get the deleteFlag - 是否删除0:否1.是.
* @return the deleteFlag
*/
public Integer getDeleteFlag() {
return this.deleteFlag;
}
/**
* set the deleteFlag - 是否删除0:否1.是.
*
* @param deleteFlag - 是否删除0:否1.是
*/
public void setDeleteFlag(Integer deleteFlag) {
this.deleteFlag = deleteFlag;
}
/**
* get the 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));
setRegisterDate(StringUtils.defaultIfEmpty(StringUtils.toString(map.get(FIELD_REGISTER_DATE)), registerDate));
setFactoryCode(StringUtils.defaultIfEmpty(StringUtils.toString(map.get(FIELD_FACTORY_CODE)), factoryCode));
setGroupCode(StringUtils.defaultIfEmpty(StringUtils.toString(map.get(FIELD_GROUP_CODE)), groupCode));
setUserId(StringUtils.defaultIfEmpty(StringUtils.toString(map.get(FIELD_USER_ID)), userId));
setGroupType(StringUtils.defaultIfEmpty(StringUtils.toString(map.get(FIELD_GROUP_TYPE)), groupType));
setPrdtCode(StringUtils.defaultIfEmpty(StringUtils.toString(map.get(FIELD_PRDT_CODE)), prdtCode));
setPrdtName(StringUtils.defaultIfEmpty(StringUtils.toString(map.get(FIELD_PRDT_NAME)), prdtName));
setWeight(NumberUtils.toBigDecimal(StringUtils.toString(map.get(FIELD_WEIGHT)), weight));
setWeightJh(NumberUtils.toBigDecimal(StringUtils.toString(map.get(FIELD_WEIGHT_JH)), weightJh));
setParentId(NumberUtils.toLong(StringUtils.toString(map.get(FIELD_PARENT_ID)), parentId));
setDeleteFlag(NumberUtils.toInteger(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_REGISTER_DATE, StringUtils.toString(registerDate, eiMetadata.getMeta(FIELD_REGISTER_DATE)));
map.put(FIELD_FACTORY_CODE, StringUtils.toString(factoryCode, eiMetadata.getMeta(FIELD_FACTORY_CODE)));
map.put(FIELD_GROUP_CODE, StringUtils.toString(groupCode, eiMetadata.getMeta(FIELD_GROUP_CODE)));
map.put(FIELD_USER_ID, StringUtils.toString(userId, eiMetadata.getMeta(FIELD_USER_ID)));
map.put(FIELD_GROUP_TYPE, StringUtils.toString(groupType, eiMetadata.getMeta(FIELD_GROUP_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_WEIGHT, StringUtils.toString(weight, eiMetadata.getMeta(FIELD_WEIGHT)));
map.put(FIELD_WEIGHT_JH, StringUtils.toString(weightJh, eiMetadata.getMeta(FIELD_WEIGHT_JH)));
map.put(FIELD_PARENT_ID, StringUtils.toString(parentId, eiMetadata.getMeta(FIELD_PARENT_ID)));
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;
}
}
......@@ -3,13 +3,11 @@ package com.baosight.hpjx.hp.sc.service;
import com.baosight.hpjx.common.DdynamicEnum;
import com.baosight.hpjx.core.constant.CommonConstant;
import com.baosight.hpjx.core.dao.DaoUtils;
import com.baosight.hpjx.hp.sc.domain.HPSC008;
import com.baosight.hpjx.hp.sc.domain.HPSC009;
import com.baosight.hpjx.hp.sc.domain.HPSC010;
import com.baosight.hpjx.hp.sc.domain.HPSC010A;
import com.baosight.hpjx.util.CommonMethod;
import com.baosight.hpjx.util.ErrorCodeUtils;
import com.baosight.hpjx.util.StringUtil;
import com.baosight.hpjx.util.StringUtils;
import com.baosight.hpjx.util.contants.ACConstants;
import com.baosight.iplat4j.core.ei.EiBlock;
import com.baosight.iplat4j.core.ei.EiConstant;
......@@ -32,7 +30,7 @@ public class ServiceHPSC010 extends ServiceEPBase {
@Override
public EiInfo initLoad(EiInfo inInfo) {
inInfo.setCell(EiConstant.queryBlock, ACConstants.ROW_CODE_0, HPSC009.FIELD_DELETE_FLAG, CommonConstant.YesNo.NO_0);
inInfo.setCell(EiConstant.queryBlock, ACConstants.ROW_CODE_0, HPSC010.FIELD_DELETE_FLAG, CommonConstant.YesNo.NO_0);
final EiInfo outEiInfo = super.query(inInfo, HPSC010.QUERY, new HPSC010().eiMetadata);
CommonMethod.initBlock(outEiInfo,
Arrays.asList(DdynamicEnum.FACTORY_CODE_BLOCK_ID), new HashMap<String,Object>());
......@@ -50,7 +48,7 @@ public class ServiceHPSC010 extends ServiceEPBase {
if (!startDate.isEmpty()) {
inInfo.setCell(EiConstant.queryBlock, ACConstants.ROW_CODE_0,"createdDateFrom",StringUtil.removeHorizontalLine(startDate));
}
inInfo.setCell(EiConstant.queryBlock,ACConstants.ROW_CODE_0,HPSC008.FIELD_DELETE_FLAG,CommonConstant.YesNo.NO_0);
inInfo.setCell(EiConstant.queryBlock,ACConstants.ROW_CODE_0,HPSC010.FIELD_DELETE_FLAG,CommonConstant.YesNo.NO_0);
return super.query(inInfo,HPSC010.QUERY,new HPSC010());
}
......@@ -64,7 +62,7 @@ public class ServiceHPSC010 extends ServiceEPBase {
Map<?, ?> map = eiBlock.getRow(i);
hpxs010.fromMap(map);
hpxs010.setDeleteFlag(CommonConstant.YesNo.YES_1);
delRows(hpxs010.getId().toString());
delRows(hpxs010.getId());
DaoUtils.update(HPSC010.DELETE_FLAG, hpxs010.toMap());
}
inInfo.setStatus(EiConstant.STATUS_SUCCESS);
......@@ -115,9 +113,9 @@ public class ServiceHPSC010 extends ServiceEPBase {
//BigDecimal weight = new BigDecimal("0");
for (i = 0; i < list.size(); i++) {
Map<?, ?> map = list.get(i);
HPSC008 hpsc008 = new HPSC008();
hpsc008.fromMap(map);
weight = weight+hpsc008.getWeight().doubleValue()+hpsc008.getWeightJh().doubleValue();
HPSC010A hpsc010A = new HPSC010A();
hpsc010A.fromMap(map);
weight = weight+hpsc010A.getWeight().doubleValue()+hpsc010A.getWeightJh().doubleValue();
}
String registerDate = inInfo.getCellStr(EiConstant.queryBlock, ACConstants.ROW_CODE_0, HPSC010.FIELD_REGISTER_DATE);
hpxs010.fromMap(eiBlock.getRow(0));
......@@ -138,10 +136,10 @@ public class ServiceHPSC010 extends ServiceEPBase {
return inInfo;
}
public void delRows(String id){
HPSC008 hpxs001 = new HPSC008();
hpxs001.setRemark(id);
hpxs001.setDeleteFlag(CommonConstant.YesNo.YES_1);
DaoUtils.update(HPSC008.DELETE_REMARK, hpxs001);
public void delRows(Long id){
HPSC010A hpsc010A = new HPSC010A();
hpsc010A.setParentId(id);
hpsc010A.setDeleteFlag(CommonConstant.YesNo.YES_1);
DaoUtils.update(HPSC010A.DELETE_PARENT_ID, hpsc010A);
}
}
\ No newline at end of file
......@@ -4,6 +4,7 @@ import com.baosight.hpjx.common.DdynamicEnum;
import com.baosight.hpjx.core.constant.CommonConstant;
import com.baosight.hpjx.core.security.UserSessionUtils;
import com.baosight.hpjx.hp.sc.domain.HPSC008;
import com.baosight.hpjx.hp.sc.domain.HPSC010A;
import com.baosight.hpjx.util.CommonMethod;
import com.baosight.hpjx.util.StringUtil;
import com.baosight.hpjx.util.contants.ACConstants;
......@@ -24,10 +25,10 @@ public class ServiceHPSC010A extends ServiceEPBase {
@Override
public EiInfo initLoad(EiInfo inInfo) {
inInfo.setCell(EiConstant.queryBlock, ACConstants.ROW_CODE_0, HPSC008.FIELD_DELETE_FLAG, CommonConstant.YesNo.NO_0);
final EiInfo outEiInfo = super.query(inInfo, HPSC008.QUERY_RESULT, new HPSC008());
EiInfo detailEiInfo = super.query(inInfo, HPSC008.QUERY_DETAIL, new HPSC008());
final EiInfo outEiInfo = super.query(inInfo, HPSC010A.QUERY_RESULT, new HPSC010A());
EiInfo detailEiInfo = super.query(inInfo, HPSC010A.QUERY_DETAIL, new HPSC010A());
EiBlock detailBlock = new EiBlock(CommonConstant.Field.DETAIL);
detailBlock.setBlockMeta(new HPSC008().eiMetadata);
detailBlock.setBlockMeta(new HPSC010A().eiMetadata);
detailBlock.setRows(detailEiInfo.getBlock(EiConstant.resultBlock).getRows());
outEiInfo.setBlock(detailBlock);
CommonMethod.initBlock(outEiInfo, Arrays.asList(DdynamicEnum.FACTORY_RECORD_BLOCK_ID), null, false);
......@@ -47,7 +48,7 @@ public class ServiceHPSC010A extends ServiceEPBase {
if (!startDate.isEmpty()) {
inInfo.setCell(EiConstant.queryBlock, ACConstants.ROW_CODE_0,"createdDateFrom",StringUtil.removeHorizontalLine(startDate));
}
inInfo.setCell(EiConstant.queryBlock,ACConstants.ROW_CODE_0,HPSC008.FIELD_DELETE_FLAG,CommonConstant.YesNo.NO_0);
return super.query(inInfo, HPSC008.QUERY,new HPSC008());
inInfo.setCell(EiConstant.queryBlock,ACConstants.ROW_CODE_0,HPSC010A.FIELD_DELETE_FLAG,CommonConstant.YesNo.NO_0);
return super.query(inInfo, HPSC010A.QUERY,new HPSC010A());
}
}
......@@ -5,10 +5,7 @@ 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.sc.domain.HPSC008;
import com.baosight.hpjx.hp.sc.domain.HPSC010;
import com.baosight.hpjx.hp.sc.domain.HPSC096;
import com.baosight.hpjx.hp.sc.domain.HPSC098;
import com.baosight.hpjx.hp.sc.domain.*;
import com.baosight.hpjx.util.CommonMethod;
import com.baosight.hpjx.util.ErrorCodeUtils;
import com.baosight.hpjx.util.StringUtil;
......@@ -37,8 +34,8 @@ public class ServiceHPSC096 extends ServiceEPBase {
List<Map> listFactoryCode;
if ("update".equals(methodType)) {
String id = inInfo.getString("inqu_status-0-id");
listFactoryCode = this.dao.query(HPSC008.QUERY,new HashMap<String,Object>(){{
put(HPSC008.FIELD_REMARK,id);
listFactoryCode = this.dao.query(HPSC010A.QUERY,new HashMap<String,Object>(){{
put(HPSC010A.FIELD_PARENT_ID,id);
}},EiConstant.defaultOffset,100);
EiInfo eiInfo = super.query(inInfo,HPSC010.QUERY,new HPSC010());
if (eiInfo.getBlock(EiConstant.resultBlock).getRows().size() >0) {
......@@ -61,16 +58,16 @@ public class ServiceHPSC096 extends ServiceEPBase {
rowNo++;
Map result = new HashMap();
result.putAll(listFactoryCode.get(i));
result.put(HPSC008.FIELD_WEIGHT,0);
result.put(HPSC008.FIELD_WEIGHT_JH,0);
result.put(HPSC008.FIELD_GROUP_TYPE,1);
result.put(HPSC010A.FIELD_WEIGHT,0);
result.put(HPSC010A.FIELD_WEIGHT_JH,0);
result.put(HPSC010A.FIELD_GROUP_TYPE,1);
result.put("rowNo",rowNo);
listResult.add(result);
}else if ("cutGroup".equals(listFactoryCode.get(i).get(HPSC096.FIELD_ORG_TYPE))){
Map detailMap = new HashMap();
detailMap.putAll(listFactoryCode.get(i));
detailMap.put(HPSC008.FIELD_WEIGHT,0);
detailMap.put(HPSC008.FIELD_WEIGHT_JH,0);
detailMap.put(HPSC010A.FIELD_WEIGHT,0);
detailMap.put(HPSC010A.FIELD_WEIGHT_JH,0);
detailMap.put("rowNo",detrowNo);
listdetail.add(detailMap);
detrowNo++;
......@@ -85,7 +82,7 @@ public class ServiceHPSC096 extends ServiceEPBase {
CommonMethod.initBlock(inInfo,
Arrays.asList(DdynamicEnum.GROUP_RECORD1_BLOCK_ID,DdynamicEnum.FACTORY_CODE_BLOCK_ID),
new HashMap<String,Object>(){{
put(HPSC008.FIELD_COMPANY_CODE, UserSessionUtils.getCompanyCode());
put(HPSC010A.FIELD_COMPANY_CODE, UserSessionUtils.getCompanyCode());
}}
);
return inInfo;
......@@ -101,13 +98,13 @@ public class ServiceHPSC096 extends ServiceEPBase {
public EiInfo update(EiInfo inInfo) {
int i = 0;
try {
HPSC008 hpxs002 = new HPSC008();
HPSC010A hpsc010A = new HPSC010A();
EiBlock eiBlock = inInfo.getBlock(EiConstant.resultBlock);
for (i = 0; i < eiBlock.getRowCount(); i++) {
Map<?, ?> map = eiBlock.getRow(i);
hpxs002.fromMap(map);
hpxs002.setDeleteFlag(CommonConstant.YesNo.NO_0);
DaoUtils.update(HPSC008.UPDATE, hpxs002);
hpsc010A.fromMap(map);
hpsc010A.setDeleteFlag(CommonConstant.YesNo.NO_0);
DaoUtils.update(HPSC010A.UPDATE, hpsc010A);
}
inInfo.setStatus(EiConstant.STATUS_SUCCESS);
inInfo.setMsgByKey("ep.1000", new String[]{String.valueOf(i), I18nMessages.getText("label.update", "修改")});
......@@ -135,16 +132,16 @@ public class ServiceHPSC096 extends ServiceEPBase {
List<Map> listResult = eiBlock.getRows();
listResult.addAll(inInfo.getBlock(CommonConstant.Field.DETAIL).getRows());
String registerDate = inInfo.getCellStr(EiConstant.queryBlock, ACConstants.ROW_CODE_0, HPSC010.FIELD_REGISTER_DATE);
HPSC008 hpxs008 = new HPSC008();
HPSC010A hpsc010A = new HPSC010A();
for (i = 0; i < listResult.size(); i++) {
Map<?, ?> map = listResult.get(i);
hpxs008.fromMap(map);
hpxs008.setRegisterDate(StringUtil.removeHorizontalLine(registerDate));
hpxs008.setDeleteFlag(CommonConstant.YesNo.NO_0);
hpsc010A.fromMap(map);
hpsc010A.setRegisterDate(StringUtil.removeHorizontalLine(registerDate));
hpsc010A.setDeleteFlag(CommonConstant.YesNo.NO_0);
for (Map map1:list) {
hpxs008.setRemark(map1.get(HPSC010.FIELD_ID).toString());
hpsc010A.setParentId((Long) map1.get(HPSC010.FIELD_ID));
}
DaoUtils.insert(HPSC008.INSERT, hpxs008);
DaoUtils.insert(HPSC010A.INSERT, hpsc010A);
}
inInfo.setStatus(EiConstant.STATUS_SUCCESS);
inInfo.setMsgByKey("ep.1000", new String[]{String.valueOf(i), I18nMessages.getText("label.insert", "新增")});
......
......@@ -329,6 +329,7 @@
hpjx.t_hpsc002
WHERE
1=1
<include refid="authCondition"/>
<isNotEmpty prepend=" AND " property="pEname">
PARENT_ID = #pEname#
</isNotEmpty>
......@@ -363,6 +364,7 @@
hpjx.t_hpsc002
WHERE
1=1 AND PARENT_ID NOT IN ('root') AND LV != 3
<include refid="authCondition"/>
<isNotEmpty prepend=" AND " property="pEname">
PARENT_ID = #pEname#
</isNotEmpty>
......@@ -398,6 +400,7 @@
hpjx.t_hpsc002
WHERE
1=1
<include refid="authCondition"/>
<isNotEmpty prepend=" AND " property="pEname">
PARENT_ID = #pEname#
</isNotEmpty>
......
<?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-04-10 17:28:06
Version : 1.0
schema : hpjx
tableName : T_HPSC009
ID BIGINT NOT NULL primarykey,
COMPANY_CODE VARCHAR,
DEP_CODE VARCHAR,
REGISTER_DATE VARCHAR,
FACTORY_CODE VARCHAR NOT NULL,
GROUP_CODE VARCHAR,
USER_ID VARCHAR,
GROUP_TYPE VARCHAR,
PRDT_CODE VARCHAR,
PRDT_NAME VARCHAR,
WEIGHT DECIMAL,
WEIGHT_JH DECIMAL,
PARENT_ID BIGINT,
DELETE_FLAG TINYINT,
CREATED_BY VARCHAR,
CREATED_NAME VARCHAR,
CREATED_TIME VARCHAR,
UPDATED_BY VARCHAR,
UPDATED_TIME VARCHAR,
UPDATED_NAME VARCHAR
-->
<sqlMap namespace="HPSC010A">
<sql id="condition">
<include refid="authCondition"/>
<isNotEmpty prepend=" AND " property="id">
ID = #id#
</isNotEmpty>
<isNotEmpty prepend=" AND " property="registerDate">
REGISTER_DATE = #registerDate#
</isNotEmpty>
<isNotEmpty prepend=" AND " property="factoryCode">
FACTORY_CODE = #factoryCode#
</isNotEmpty>
<isNotEmpty prepend=" AND " property="groupCode">
GROUP_CODE = #groupCode#
</isNotEmpty>
<isNotEmpty prepend=" AND " property="userId">
USER_ID = #userId#
</isNotEmpty>
<isNotEmpty prepend=" AND " property="groupType">
GROUP_TYPE = #groupType#
</isNotEmpty>
<isNotEmpty prepend=" AND " property="prdtCode">
PRDT_CODE = #prdtCode#
</isNotEmpty>
<isNotEmpty prepend=" AND " property="prdtName">
PRDT_NAME = #prdtName#
</isNotEmpty>
<isNotEmpty prepend=" AND " property="weight">
WEIGHT = #weight#
</isNotEmpty>
<isNotEmpty prepend=" AND " property="weightJh">
WEIGHT_JH = #weightJh#
</isNotEmpty>
<isNotEmpty prepend=" AND " property="parentId">
PARENT_ID = #parentId#
</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>
<sql id="authCondition">
<isNotEmpty prepend=" AND " property="companyCode">
COMPANY_CODE = #companyCode#
</isNotEmpty>
<isNotEmpty prepend=" AND " property="depCode">
DEP_CODE = #depCode#
</isNotEmpty>
<isNotEmpty prepend=" AND " property="depCodes">
DEP_CODE IN <iterate close=")" open="(" conjunction="," property="depCodes">#depCodes[]#</iterate>
</isNotEmpty>
</sql>
<select id="query" parameterClass="java.util.HashMap"
resultClass="com.baosight.hpjx.hp.sc.domain.HPSC008">
SELECT
ID as "id", <!-- ID -->
COMPANY_CODE as "companyCode", <!-- 企业编码 预留 -->
DEP_CODE as "depCode", <!-- 部门编码 预留 -->
REGISTER_DATE as "registerDate", <!-- 登记日期 -->
FACTORY_CODE as "factoryCode", <!-- 工厂代码 -->
GROUP_CODE as "groupCode", <!-- 生产组代码 -->
USER_ID as "userId", <!-- 员工代码 -->
GROUP_TYPE as "groupType", <!-- 生产类型 -->
PRDT_CODE as "prdtCode", <!-- 产品代码 -->
PRDT_NAME as "prdtName", <!-- 产品名称 -->
WEIGHT as "weight", <!-- 产量 -->
WEIGHT_JH as "weightJh",
PARENT_ID as "parentId", <!-- 备注 -->
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_HPSC009 WHERE 1=1
<include refid="condition" />
<dynamic prepend="ORDER BY">
<isNotEmpty property="orderBy">
$orderBy$
</isNotEmpty>
<isEmpty property="orderBy">
CREATED_TIME desc
</isEmpty>
</dynamic>
</select>
<select id="queryResult" parameterClass="java.util.HashMap"
resultClass="com.baosight.hpjx.hp.sc.domain.HPSC008">
SELECT
ID as "id", <!-- ID -->
COMPANY_CODE as "companyCode", <!-- 企业编码 预留 -->
DEP_CODE as "depCode", <!-- 部门编码 预留 -->
REGISTER_DATE as "registerDate", <!-- 登记日期 -->
FACTORY_CODE as "factoryCode", <!-- 工厂代码 -->
GROUP_CODE as "groupCode", <!-- 生产组代码 -->
USER_ID as "userId", <!-- 员工代码 -->
GROUP_TYPE as "groupType", <!-- 生产类型 -->
PRDT_CODE as "prdtCode", <!-- 产品代码 -->
PRDT_NAME as "prdtName", <!-- 产品名称 -->
WEIGHT as "weight", <!-- 产量 -->
WEIGHT_JH as "weightJh",
PARENT_ID as "parentId", <!-- 备注 -->
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_HPSC009 WHERE 1=1 and GROUP_TYPE in ('1','2')
<include refid="condition" />
<dynamic prepend="ORDER BY">
<isNotEmpty property="orderBy">
$orderBy$
</isNotEmpty>
<isEmpty property="orderBy">
CREATED_TIME desc
</isEmpty>
</dynamic>
</select>
<select id="queryDetail" parameterClass="java.util.HashMap"
resultClass="java.util.HashMap">
SELECT
ID as "id", <!-- ID -->
COMPANY_CODE as "companyCode", <!-- 企业编码 预留 -->
DEP_CODE as "depCode", <!-- 部门编码 预留 -->
REGISTER_DATE as "registerDate", <!-- 登记日期 -->
FACTORY_CODE as "factoryCode", <!-- 工厂代码 -->
GROUP_CODE as "groupCode", <!-- 生产组代码 -->
USER_ID as "userId", <!-- 员工代码 -->
GROUP_TYPE as "groupType", <!-- 生产类型 -->
PRDT_CODE as "prdtCode", <!-- 产品代码 -->
PRDT_NAME as "prdtName", <!-- 产品名称 -->
WEIGHT as "weight", <!-- 产量 -->
WEIGHT_JH as "weightJh",
PARENT_ID as "parentId", <!-- 备注 -->
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_HPSC009 WHERE 1=1 and GROUP_TYPE not in ('1','2')
<include refid="condition" />
<dynamic prepend="ORDER BY">
<isNotEmpty property="orderBy">
$orderBy$
</isNotEmpty>
<isEmpty property="orderBy">
CREATED_TIME desc
</isEmpty>
</dynamic>
</select>
<select id="count" resultClass="int">
SELECT COUNT(*) FROM ${hpjxSchema}.T_HPSC009 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="registerDate">
REGISTER_DATE = #registerDate#
</isNotEmpty>
<isNotEmpty prepend=" AND " property="factoryCode">
FACTORY_CODE = #factoryCode#
</isNotEmpty>
<isNotEmpty prepend=" AND " property="groupCode">
GROUP_CODE = #groupCode#
</isNotEmpty>
<isNotEmpty prepend=" AND " property="userId">
USER_ID = #userId#
</isNotEmpty>
<isNotEmpty prepend=" AND " property="groupType">
GROUP_TYPE = #groupType#
</isNotEmpty>
<isNotEmpty prepend=" AND " property="prdtCode">
PRDT_CODE = #prdtCode#
</isNotEmpty>
<isNotEmpty prepend=" AND " property="prdtName">
PRDT_NAME = #prdtName#
</isNotEmpty>
<isNotEmpty prepend=" AND " property="weight">
WEIGHT = #weight#
</isNotEmpty>
<isNotEmpty prepend=" AND " property="parentId">
PARENT_ID = #parentId#
</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_HPSC009 (ID, <!-- ID -->
COMPANY_CODE, <!-- 企业编码 预留 -->
DEP_CODE, <!-- 部门编码 预留 -->
REGISTER_DATE, <!-- 登记日期 -->
FACTORY_CODE, <!-- 工厂代码 -->
GROUP_CODE, <!-- 生产组代码 -->
USER_ID, <!-- 员工代码 -->
GROUP_TYPE, <!-- 生产类型 -->
PRDT_CODE, <!-- 产品代码 -->
PRDT_NAME, <!-- 产品名称 -->
WEIGHT, <!-- 产量 -->
WEIGHT_JH,
PARENT_ID, <!-- 备注 -->
DELETE_FLAG, <!-- 是否删除0:否1.是 -->
CREATED_BY, <!-- 创建人 -->
CREATED_NAME, <!-- 创建人名称 -->
CREATED_TIME, <!-- 创建时间 -->
UPDATED_BY, <!-- 修改人 -->
UPDATED_TIME, <!-- 修改人名称 -->
UPDATED_NAME <!-- 修改时间 -->
)
VALUES (#id#, #companyCode#, #depCode#, #registerDate#, #factoryCode#, #groupCode#, #userId#, #groupType#, #prdtCode#, #prdtName#, #weight#, #weightJh#, #parentId#, #deleteFlag#, #createdBy#, #createdName#, #createdTime#, #updatedBy#, #updatedTime#, #updatedName#)
</insert>
<delete id="delete">
DELETE FROM ${hpjxSchema}.T_HPSC009 WHERE ID = #id#
</delete>
<update id="deleteFlag">
UPDATE ${hpjxSchema}.T_HPSC009
SET
DELETE_FLAG = #deleteFlag#, <!-- 是否删除0:否1.是 -->
UPDATED_BY = #updatedBy#, <!-- 修改人 -->
UPDATED_TIME = #updatedTime#, <!-- 修改人名称 -->
UPDATED_NAME = #updatedName# <!-- 修改时间 -->
WHERE
ID = #id#
</update>
<update id="deleteParentId">
UPDATE ${hpjxSchema}.T_HPSC009
SET
DELETE_FLAG = #deleteFlag#, <!-- 是否删除0:否1.是 -->
UPDATED_BY = #updatedBy#, <!-- 修改人 -->
UPDATED_TIME = #updatedTime#, <!-- 修改人名称 -->
UPDATED_NAME = #updatedName# <!-- 修改时间 -->
WHERE PARENT_ID = #parentId#
</update>
<update id="update">
UPDATE ${hpjxSchema}.T_HPSC009
SET
COMPANY_CODE = #companyCode#, <!-- 企业编码 预留 -->
DEP_CODE = #depCode#, <!-- 部门编码 预留 -->
REGISTER_DATE = #registerDate#, <!-- 登记日期 -->
FACTORY_CODE = #factoryCode#, <!-- 工厂代码 -->
GROUP_CODE = #groupCode#, <!-- 生产组代码 -->
USER_ID = #userId#, <!-- 员工代码 -->
GROUP_TYPE = #groupType#, <!-- 生产类型 -->
PRDT_CODE = #prdtCode#, <!-- 产品代码 -->
PRDT_NAME = #prdtName#, <!-- 产品名称 -->
WEIGHT = #weight#, <!-- 产量 -->
WEIGHT_JH = #weightJh#,
PARENT_ID = #parentId#, <!-- 备注 -->
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>
......@@ -119,49 +119,61 @@ $(function() {
}
}],
loadComplete: function (grid) {
// 此grid对象
grid.dataSource.bind("change", function(e) {
if (e.field == "inventName") {
console.log();
var tr,index;
// 获取此model元素信息
var item = e.items[0];
for (let i = 0; i < inventNameGlobalData.length; i++) {
if (inventNameGlobalData[i]['textField'] === item.inventName) {
//dataItem['spec'] = inventNameGlobalData[i]['param2Field'];
/* dataItem['material'] = inventNameGlobalData[i]['param3Field'];
dataItem['unit'] = inventNameGlobalData[i]['param4Field'];
dataItem['length'] = inventNameGlobalData[i]['param5Field'];
dataItem['width'] = inventNameGlobalData[i]['param6Field'];
dataItem['thick'] = inventNameGlobalData[i]['param7Field'];
dataItem['coefficient'] = inventNameGlobalData[i]['param8Field'];
dataItem['inventRecordId'] = inventNameGlobalData[i]['param9Field'];*/
resultGrid.setCellValue(item, 'inventName', inventNameGlobalData[i]['param1Field']);
resultGrid.setCellValue(item, 'spec', inventNameGlobalData[i]['param2Field']);
resultGrid.setCellValue(item, 'material', inventNameGlobalData[i]['param3Field']);
resultGrid.setCellValue(item, 'unit', inventNameGlobalData[i]['param4Field']);
resultGrid.setCellValue(item, 'length', inventNameGlobalData[i]['param5Field']);
resultGrid.setCellValue(item, 'width', inventNameGlobalData[i]['param6Field']);
resultGrid.setCellValue(item, 'thick', inventNameGlobalData[i]['param7Field']);
resultGrid.setCellValue(item, 'coefficient', inventNameGlobalData[i]['param8Field']);
resultGrid.refresh();
for (let k = 0; k < resultGrid.getCheckedRowsIndex()+1; k++) {
for (let i = 0; i < inventNameGlobalData.length; i++) {
if (inventNameGlobalData[i]['textField'] === item.inventName) {
//dataItem['spec'] = inventNameGlobalData[i]['param2Field'];
/* dataItem['material'] = inventNameGlobalData[i]['param3Field'];
dataItem['unit'] = inventNameGlobalData[i]['param4Field'];
dataItem['length'] = inventNameGlobalData[i]['param5Field'];
dataItem['width'] = inventNameGlobalData[i]['param6Field'];
dataItem['thick'] = inventNameGlobalData[i]['param7Field'];
dataItem['coefficient'] = inventNameGlobalData[i]['param8Field'];
dataItem['inventRecordId'] = inventNameGlobalData[i]['param9Field'];*/
resultGrid.setCellValue(item, 'inventName', inventNameGlobalData[i]['param1Field']);
resultGrid.setCellValue(item, 'spec', inventNameGlobalData[i]['param2Field']);
resultGrid.setCellValue(item, 'material', inventNameGlobalData[i]['param3Field']);
resultGrid.setCellValue(item, 'unit', inventNameGlobalData[i]['param4Field']);
resultGrid.setCellValue(item, 'length', inventNameGlobalData[i]['param5Field']);
resultGrid.setCellValue(item, 'width', inventNameGlobalData[i]['param6Field']);
resultGrid.setCellValue(item, 'thick', inventNameGlobalData[i]['param7Field']);
resultGrid.setCellValue(item, 'coefficient', inventNameGlobalData[i]['param8Field']);
//resultGrid.refresh();
$("#locked_datacell_0_"+k+" input").attr("checked",true);
break;
}
}
}
}
if (e.field == "spec") {
var tr,index;
// 获取此model元素信息
var item = e.items[0];
for (let i = 0; i < inventAllGlobalData.length; i++) {
if (inventAllGlobalData[i]['textField'] === item.spec) {
resultGrid.setCellValue(item, 'material', inventAllGlobalData[i]['param1Field']);
resultGrid.setCellValue(item, 'unit', inventAllGlobalData[i]['param2Field']);
resultGrid.setCellValue(item, 'length', inventAllGlobalData[i]['param3Field']);
resultGrid.setCellValue(item, 'width', inventAllGlobalData[i]['param4Field']);
resultGrid.setCellValue(item, 'thick', inventAllGlobalData[i]['param5Field']);
resultGrid.setCellValue(item, 'coefficient', inventAllGlobalData[i]['param6Field']);
resultGrid.refresh();
}
}
for (let k = 0; k < resultGrid.getCheckedRowsIndex()+1; k++) {
for (let i = 0; i < inventAllGlobalData.length; i++) {
if (inventAllGlobalData[i]['textField'] === item.spec) {
resultGrid.setCellValue(item, 'material', inventAllGlobalData[i]['param1Field']);
resultGrid.setCellValue(item, 'unit', inventAllGlobalData[i]['param2Field']);
resultGrid.setCellValue(item, 'length', inventAllGlobalData[i]['param3Field']);
resultGrid.setCellValue(item, 'width', inventAllGlobalData[i]['param4Field']);
resultGrid.setCellValue(item, 'thick', inventAllGlobalData[i]['param5Field']);
resultGrid.setCellValue(item, 'coefficient', inventAllGlobalData[i]['param6Field']);
$("#locked_datacell_0_"+k+" input").attr("checked",true);
//resultGrid.refresh();
break;
}
}
}
}
});
},
......
......@@ -127,17 +127,21 @@ $(function() {
var tr,index;
// 获取此model元素信息
var item = e.items[0];
for (let i = 0; i < inventNameGlobalData.length; i++) {
if (inventNameGlobalData[i]['textField'] === item.inventName) {
resultGrid.setCellValue(item, 'inventName', inventNameGlobalData[i]['param1Field']);
resultGrid.setCellValue(item, 'spec', inventNameGlobalData[i]['param2Field']);
resultGrid.setCellValue(item, 'material', inventNameGlobalData[i]['param3Field']);
resultGrid.setCellValue(item, 'unit', inventNameGlobalData[i]['param4Field']);
resultGrid.setCellValue(item, 'length', inventNameGlobalData[i]['param5Field']);
resultGrid.setCellValue(item, 'width', inventNameGlobalData[i]['param6Field']);
resultGrid.setCellValue(item, 'thick', inventNameGlobalData[i]['param7Field']);
resultGrid.setCellValue(item, 'coefficient', inventNameGlobalData[i]['param8Field']);
resultGrid.refresh();
for (let k = 0; k < resultGrid.getCheckedRowsIndex()+1; k++) {
for (let i = 0; i < inventNameGlobalData.length; i++) {
if (inventNameGlobalData[i]['textField'] === item.inventName) {
resultGrid.setCellValue(item, 'inventName', inventNameGlobalData[i]['param1Field']);
resultGrid.setCellValue(item, 'spec', inventNameGlobalData[i]['param2Field']);
resultGrid.setCellValue(item, 'material', inventNameGlobalData[i]['param3Field']);
resultGrid.setCellValue(item, 'unit', inventNameGlobalData[i]['param4Field']);
resultGrid.setCellValue(item, 'length', inventNameGlobalData[i]['param5Field']);
resultGrid.setCellValue(item, 'width', inventNameGlobalData[i]['param6Field']);
resultGrid.setCellValue(item, 'thick', inventNameGlobalData[i]['param7Field']);
resultGrid.setCellValue(item, 'coefficient', inventNameGlobalData[i]['param8Field']);
$("#locked_datacell_0_"+k+" input").attr("checked",true);
//resultGrid.refresh();
break;
}
}
}
}
......@@ -145,15 +149,19 @@ $(function() {
var tr,index;
// 获取此model元素信息
var item = e.items[0];
for (let i = 0; i < inventAllGlobalData.length; i++) {
if (inventAllGlobalData[i]['textField'] === item.spec) {
resultGrid.setCellValue(item, 'material', inventAllGlobalData[i]['param1Field']);
resultGrid.setCellValue(item, 'unit', inventAllGlobalData[i]['param2Field']);
resultGrid.setCellValue(item, 'length', inventAllGlobalData[i]['param3Field']);
resultGrid.setCellValue(item, 'width', inventAllGlobalData[i]['param4Field']);
resultGrid.setCellValue(item, 'thick', inventAllGlobalData[i]['param5Field']);
resultGrid.setCellValue(item, 'coefficient', inventAllGlobalData[i]['param6Field']);
resultGrid.refresh();
for (let k = 0; k < resultGrid.getCheckedRowsIndex()+1; k++) {
for (let i = 0; i < inventAllGlobalData.length; i++) {
if (inventAllGlobalData[i]['textField'] === item.spec) {
resultGrid.setCellValue(item, 'material', inventAllGlobalData[i]['param1Field']);
resultGrid.setCellValue(item, 'unit', inventAllGlobalData[i]['param2Field']);
resultGrid.setCellValue(item, 'length', inventAllGlobalData[i]['param3Field']);
resultGrid.setCellValue(item, 'width', inventAllGlobalData[i]['param4Field']);
resultGrid.setCellValue(item, 'thick', inventAllGlobalData[i]['param5Field']);
resultGrid.setCellValue(item, 'coefficient', inventAllGlobalData[i]['param6Field']);
$("#locked_datacell_0_"+k+" input").attr("checked",true);
//resultGrid.refresh();
break;
}
}
}
}
......
$(function () {
IPLATUI.EFGrid.result = {
copyToAdd:false,
pageable: {
pageSize: 20,
pageSize: 10,
pageSizes: [10, 20, 50, 70, 100],
},
columns: [
{
field: "docIdPc",
title: "PC端log",
template: function (item) {
let docId = item.docIdPc;
let template = '';
if (docId!= null && docId.length>0){
let src = downloadHref(docId);
template = '<a style="cursor: pointer;display: inline-flex;justify-content: center;background-color: #e7e7e7" '
+ 'href="' + src + '" target="_blank">' +
'<img src="'+src+'" style="width:200px;height:50px;background-image: none;" alt="APP端log"/></a>';
}
return template;
}
},
{
field: "docIdApp",
title: "APP端log",
template: function (item) {
let docId = item.docIdApp;
let template = '';
if (docId!= null && docId.length>0){
let src = downloadHref(docId);
template = '<a style="cursor: pointer;display: inline-flex;justify-content: center;background-color: #e7e7e7" '
+ 'href="' + src + '" target="_blank">' +
'<img src="'+src+'" style="width:200px;height:50px;background-image: none;" alt="APP端log"/></a>';
}
return template;
}
}
],
onSuccess: function (e) {
if(e.eiInfo.extAttr.methodName == 'save'||e.eiInfo.extAttr.methodName == 'delete' ){
query();
......@@ -14,6 +47,7 @@ $(function () {
$("#type").val("insert")
$("#companyName").val("");
$("#loginPrefix").val("");
$("#loginPrefix").removeAttr("readonly");
$("#validFlag").val(1);
$("#PCfileDocId").val("");
$("#APPfileDocId").val("");
......@@ -28,7 +62,7 @@ $(function () {
onSave: function (e) {
// 阻止后台保存请求,使用自定义保存
e.preventDefault();
//save();
updateCompany();
},
onDelete: function (e) {
// 阻止后台删除请求,使用自定义删除
......@@ -44,21 +78,7 @@ $(function () {
* e.tr tr, jquery
*/
onRowClick: function (e) {
let app = $("#app-img"),
pc = $("#pc-img");
$("#type").val("update");
$("#companyCode").val(e.model.companyCode);
$("#companyName").val(e.model.companyName);
$("#loginPrefix").val(e.model.loginPrefix);
$("#validFlag").val(e.model.validFlag);
$("#PCfileDocId").val(e.model.docIdPc);
$("#APPfileDocId").val(e.model.docIdApp);
$("#remark").val(e.model.remark);
$("#id").val(e.model.id);
addImgLabel(app,e.model.docIdApp);
addImgLabel(pc,e.model.docIdPc);
$("#insertGroup_wnd_title").text("修改企业管理");
addCompany($("#insertGroup"));
/*WindowUtil({
"title": "",
"content": "<div class='kendo-del-message'>" + e.row + "</div>"
......@@ -86,6 +106,11 @@ $(function () {
localization: {
invalidFileExtension: "文件格式不支持, 上传失败"
},
loadComplete: function(e) {
var uploader = e.sender.uploader;
uploader.clearAllFiles();
// 清空所有历史上传文件
},
success: function(e) {
let docId = e.response.docId;
if (isBlank(docId)) {
......@@ -108,6 +133,11 @@ $(function () {
localization: {
invalidFileExtension: "文件格式不支持, 上传失败"
},
loadComplete: function(e) {
var uploader = e.sender.uploader;
uploader.clearAllFiles();
// 清空所有历史上传文件
},
success: function(e) {
let docId = e.response.docId;
if (isBlank(docId)) {
......@@ -157,6 +187,7 @@ let save = function (){
onSuccess: function (ei) {
btnNode.attr("disabled", false);
$("#insertGroup").data("kendoWindow").close();
// 清除上传队列
resultGrid.dataSource.page(1);
// onFail 表示失败回掉函数
}, onFail: function (ei) {
......@@ -168,52 +199,6 @@ let save = function (){
};
/**
* 保存
*/
/*let save = function () {
let rows = resultGrid.getCheckedRows();
if (rows.length = 1) {
$("#type").val("update")
}
let result = new EiInfo();
let docId = e.response.docId;
let docName = e.response.docName;
let docSize = e.response.docSize;
let docTag = e.response.docTag;
let docUrl = e.response.docUrl;
result.set("result-0-docId",docId);
result.set("result-0-docName",docName);
result.set("result-0-docSize",docSize);
result.set("result-0-docTag",docTag);
result.set("result-0-realPath",docUrl);
EiCommunicator.send("HPXS003", "insert", result, {
onSuccess: function (ei) {
if (ei.getStatus() >= 0) {
if (ei.getStatus() == 0) {
NotificationUtil(ei, 'warning');
} else {
NotificationUtil(ei);
}
} else {
NotificationUtil(ei, "error");
}
resultGrid.dataSource.page(1);
},
onFail: function (ei) {
// 发生异常
NotificationUtil("执行失败,原因[" + ei + "]", "error");
}
}, {
async: false
});
/!*JSUtils.confirm("确定对勾选中的[" + rows.length + "]条数据做\"保存\"操作? ", {
ok: function () {
JSUtils.submitGridsData("result", "HPPZ009", "save", true);
}
});*!/
}*/
/**
* 删除
*/
let deleteFunc = function () {
......@@ -236,11 +221,36 @@ let deleteFunc = function () {
* @param id
*/
function addCompany(id) {
let rows = resultGrid.getCheckedRows();
//打开弹窗
$(".k-upload-status-total").remove();
id.data("kendoWindow").open().center();
}
function updateCompany() {
//获取grid选中数据
let rows = resultGrid.getCheckedRows();
if (rows.length < 1) {
message("请选择数据");
return;
}
let app = $("#app-img"),
pc = $("#pc-img");
$("#type").val("update");
$("#companyCode").val(rows[0]["companyCode"]);
$("#companyName").val(rows[0]["companyName"]);
$("#loginPrefix").val(rows[0]["loginPrefix"]);
$("#loginPrefix").attr("readonly","true");
$("#validFlag").val(rows[0]["validFlag"]);
$("#PCfileDocId").val(rows[0]["docIdPc"]);
$("#APPfileDocId").val(rows[0]["docIdApp"]);
$("#remark").val(rows[0]["remark"]);
$("#id").val(rows[0]["id"]);
addImgLabel(app,rows[0]["docIdApp"]);
addImgLabel(pc,rows[0]["docIdPc"]);
$("#insertGroup_wnd_title").text("修改企业管理");
addCompany($("#insertGroup"));
}
$("#update").click(function () {
var btnNode = $(this);
btnNode.attr("disabled", true);
......@@ -261,6 +271,7 @@ $("#update").click(function () {
}
});
});
/**
* 附件上传回调
*
......
......@@ -15,12 +15,14 @@
<EF:EFRegion id="result" title="记录集">
<EF:EFGrid blockId="result" autoDraw="override" checkMode="single">
<EF:EFColumn ename="id" cname="主键" hidden="true"/>
<EF:EFColumn ename="docIdPc" cname="主键" hidden="true"/>
<EF:EFColumn ename="docIdApp" cname="主键" hidden="true"/>
<EF:EFColumn cname="企业编码" ename="companyCode" enable="false" width="120" align="center"/>
<EF:EFColumn cname="企业名称" ename="companyName" width="140" required="true"/>
<EF:EFColumn cname="登录前缀" ename="loginPrefix" width="100" align="center" readonly="true"/>
<EF:EFComboColumn cname="是否启用" ename="validFlag" width="80" align="center" required="true">
<%--<EF:EFColumn ename="docIdPc" cname="主键" hidden="true"/>
<EF:EFColumn ename="docIdApp" cname="主键" hidden="true"/>--%>
<EF:EFColumn cname="企业编码" ename="companyCode" enable="false" width="120" height="50" align="center"/>
<EF:EFColumn cname="企业名称" ename="companyName" width="140" align="center" required="true"/>
<EF:EFColumn cname="登录前缀" ename="loginPrefix" width="80" align="center" readonly="true"/>
<EF:EFColumn cname="PC端log" ename="docIdPc" align="center" width="200" readonly="true" enable="false"/>
<EF:EFColumn cname="APP端log" ename="docIdApp" align="center" width="200" readonly="true" enable="false"/>
<EF:EFComboColumn cname="是否启用" ename="validFlag" width="70" align="center" required="true">
<EF:EFCodeOption codeName="hpjx.hppz.validFlag"/>
</EF:EFComboColumn>
<EF:EFColumn cname="备注" ename="remark" width="150" editType="textarea"/>
......
......@@ -283,6 +283,7 @@ $(function () {
template: "#:textField#",
filter: "contains"
});
input.data("kendoAutoComplete").search();
}
}, {
field: "parentPrdtName",
......
......@@ -80,6 +80,7 @@ $(function () {
template: "#:textField#",
filter: "contains"
});
input.data("kendoAutoComplete").search();
},
/*afterEdit: function (e) {
for (let i = 0; i < princ2Data.length; i++) {
......@@ -255,6 +256,7 @@ $(function () {
template: "#:textField#",
filter: "contains"
});
input.data("kendoAutoComplete").search();
}
}
]
......
......@@ -288,16 +288,20 @@ $(function () {
}
}, {async: false});
input.kendoAutoComplete({
valuePrimitive: true,
dataSource: dataSource,
minLength: 0,
dataTextField: "textField",
dataValueField: "valueField",
required: "true",
optionLabelTemplate: "#:textField#",
valueTemplate: "#:valueField#",
template: "#:textField#",
filter: "contains"
});
input.data("kendoAutoComplete").search();
//input.trigger("change", {sender: input, open: true});
//enforceMinLength: true,
//suggest: false,
//open: true,
}
}, {
field: "parentPrdtName",
......
......@@ -198,6 +198,7 @@ $(function () {
template: "#:textField#",
filter: "contains"
});
input.data("kendoAutoComplete").search();
}
},
{
......
......@@ -28,7 +28,7 @@
</EF:EFRegion>
<EF:EFRegion id="result" title="明细信息">
<EF:EFGrid blockId="result" autoDraw="override" isFloat="true" checkMode="single">
<EF:EFGrid blockId="result" autoDraw="override" isFloat="true" checkMode="row">
<EF:EFColumn ename="id" primaryKey="true" cname="内码" hidden="true"/>
<EF:EFColumn ename="companyCode" cname="企业编码" hidden="true"/>
<EF:EFColumn ename="operator" cname="操作" locked="true" enable="false" width="120" align="center"/>
......
......@@ -109,45 +109,50 @@ $(function (){
* 确认
*/
$('#confirm').on('click', function () {
let rows = resultGrid.getCheckedRows();
if (rows.length < 1) {
message("请选择数据");
return;
}
let resultRows = resultGrid.getDataItems();
let detailRows = detailGrid.getDataItems();
let methodType = $("#inqu_status-0-methodType").val();
let registerDate = $("#inqu_status-0-registerDate").val();
if (registerDate.length<=0){
registerDate = currShortDate()
}
let flag = true;
$.each(rows, function(index, item) {
$.each(resultRows, function(index, item) {
let prdtName= item.get("prdtName");
if(isBlank(prdtName)){
message("选中的第"+(index+1)+"行\"产品\",不能为空!");
message("选中的生产组第"+(index+1)+"行\"产品\",不能为空!");
flag = false;
return false;
}
let weight= item.get("weight");
if(isBlank(weight)){
message("选中的第"+(index+1)+"行\"组拼产量(T)\",不能为空!");
message("选中的生产组第"+(index+1)+"行\"组拼产量(T)\",不能为空!");
flag = false;
return false;
}
let weightJh= item.get("weightJh");
if(isBlank(weightJh)){
message("选中的第"+(index+1)+"行\"加焊产量(T)\",不能为空!");
message("选中的生产组第"+(index+1)+"行\"加焊产量(T)\",不能为空!");
flag = false;
return false;
}
});
$.each(detailRows, function(index, item) {
let prdtName= item.get("prdtName");
if(isBlank(prdtName)){
message("选中的下料组第"+(index+1)+"行\"产品\",不能为空!");
flag = false;
return false;
}
});
if(flag) {
JSUtils.confirm("确定对勾选中的[" + rows.length + "]条数据做\"保存\"操作? ", {
JSUtils.confirm("确定对数据做\"保存\"操作? ", {
ok: function () {
var info = new EiInfo();
info.set("inqu_status-0-userCount",$("#inqu_status-0-userCount").val());
info.set("inqu_status-0-registerDate",registerDate);
info.addBlock(JSUtils.checkedRows2Block("result"));
info.addBlock(JSUtils.checkedRows2Block("detail"))
info.addBlock(rowsBlock("result"));
info.addBlock(rowsBlock("detail"))
EiCommunicator.send("HPSC010", methodType, info, {
onSuccess: function (ei) {
if (ei.getStatus() >= 0) {
......@@ -286,4 +291,40 @@ let detailRefreshRowNo = function (rowNo) {
detailGrid.refresh();
}
}
}
var rowsBlock = function (grid_id) {
var resultGrid = window[grid_id + 'Grid'];
var columns = resultGrid.columns;
var dateColumns = _.filter(columns,
function (column) {
return column.editType === "date"
|| column.editType === "datetime";
}
);
var eiblock = new EiBlock(grid_id);
var rowsDate = resultGrid.getDataItems();
for (var int = 0; int < rowsDate.length; int++) {
if (int == 0) {
for (var key in rowsDate[0].toJSON()) {
var eColumn = new EiColumn(key);
eiblock.getBlockMeta().addMeta(eColumn);
}
}
var model = rowsDate[int];
$.each(dateColumns, function (index, dateColumn) {
var field = dateColumn.field, dateFormat = dateColumn.dateFormat;
model[field] = kendo.toString(model[field],
dateFormat
);// 日期转String
});
eiblock.addRow(eiblock.getMappedArray(model, true));
}
var showCount = eiblock.get(EiConstant.SHOW_COUNT) || "true";
eiblock.set(EiConstant.SHOW_COUNT, showCount);
eiblock.set(EiConstant.LIMIT, resultGrid.dataSource['_pageSize']);
// eiblock.set(EiConstant.OFFSET, resultGrid.dataSource['_skip']);
// 默认查询第一页
eiblock.set(EiConstant.OFFSET, 0);
return eiblock;
}
\ No newline at end of file
......@@ -208,6 +208,7 @@ function refreshInputSelect(container, inInfo) {
template: "#:textField#",
filter: "contains"
});
input.data("kendoAutoComplete").search();
return dataSource;
}
......
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