Commit 4c5cac02 by 宋祥

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

parents 96ca01e1 3b7bd287
...@@ -85,7 +85,7 @@ public class ServiceHPKC003 extends ServiceBase { ...@@ -85,7 +85,7 @@ public class ServiceHPKC003 extends ServiceBase {
// 仓库名称 // 仓库名称
fKc003.setWhName(HPPZTools.getPz007ByCode(fKc003.getWhCode()).getWhName()); fKc003.setWhName(HPPZTools.getPz007ByCode(fKc003.getWhCode()).getWhName());
// 存货名称 // 存货名称
fKc003.setInventName(HPPZTools.getPz004ByCode(fKc003.getInventCode()).getInventName()); // fKc003.setInventName(HPPZTools.getPz004ByCode(fKc003.getInventCode()).getInventName());
// 生成入库单号 // 生成入库单号
fKc003.setProdNo(SequenceGenerator.getNextSequence(HPConstant.SequenceId.HPKC003_PROD_NO)); fKc003.setProdNo(SequenceGenerator.getNextSequence(HPConstant.SequenceId.HPKC003_PROD_NO));
...@@ -96,10 +96,9 @@ public class ServiceHPKC003 extends ServiceBase { ...@@ -96,10 +96,9 @@ public class ServiceHPKC003 extends ServiceBase {
//同步生产计划 //同步生产计划
DaoUtils.update("HPSC004.update",this.synchronousPlan(fKc003)); DaoUtils.update("HPSC004.update",this.synchronousPlan(fKc003));
//产品库存更新接口
HPKCTools.updateProdStock(fKc003.getWhCode(),fKc003.getProdNo(),fKc003.getAmount(),fKc003.getWeight());
// 修改库存
HPKCTools.updateStock(fKc003.getWhCode(), fKc003.getInventRecordId(), fKc003.getAmount(),
fKc003.getWeight());
} }
inInfo = this.query(inInfo); inInfo = this.query(inInfo);
inInfo.setStatus(EiConstant.STATUS_DEFAULT); inInfo.setStatus(EiConstant.STATUS_DEFAULT);
......
...@@ -45,6 +45,9 @@ ...@@ -45,6 +45,9 @@
</sql> </sql>
<sql id="getCondition"> <sql id="getCondition">
<isNotEmpty prepend=" AND " property="id">
ID = #id#
</isNotEmpty>
<isNotEmpty prepend=" AND " property="factoryName"> <isNotEmpty prepend=" AND " property="factoryName">
FACTORY_NAME = #factoryName# FACTORY_NAME = #factoryName#
</isNotEmpty> </isNotEmpty>
......
...@@ -49,6 +49,8 @@ public class HPSC005 extends DaoEPBase { ...@@ -49,6 +49,8 @@ public class HPSC005 extends DaoEPBase {
public static final String FIELD_FILE_PATH4 = "filePath4"; /* 文件地址4*/ public static final String FIELD_FILE_PATH4 = "filePath4"; /* 文件地址4*/
public static final String FIELD_FILE_PATH5 = "filePath5"; /* 文件地址5*/ public static final String FIELD_FILE_PATH5 = "filePath5"; /* 文件地址5*/
public static final String FIELD_INVENT_RECORD_ID = "inventRecordId"; public static final String FIELD_INVENT_RECORD_ID = "inventRecordId";
public static final String FIELD_FACTORY_CODE = "factoryCode"; /* 厂区编码*/
public static final String FIELD_FACTORY_NAME = "factoryName"; /* 厂区名称*/
public static final String COL_ID = "ID"; public static final String COL_ID = "ID";
public static final String COL_COMPANY_CODE = "COMPANY_CODE"; /* 企业编码 预留*/ public static final String COL_COMPANY_CODE = "COMPANY_CODE"; /* 企业编码 预留*/
...@@ -78,6 +80,8 @@ public class HPSC005 extends DaoEPBase { ...@@ -78,6 +80,8 @@ public class HPSC005 extends DaoEPBase {
public static final String COL_FILE_PATH4 = "FILE_PATH4"; /* 文件地址4*/ 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_FILE_PATH5 = "FILE_PATH5"; /* 文件地址5*/
public static final String COL_INVENT_RECORD_ID = "INVENT_RECORD_ID"; public static final String COL_INVENT_RECORD_ID = "INVENT_RECORD_ID";
public static final String COL_FACTORY_CODE = "FACTORY_CODE"; /* 厂区编码*/
public static final String COL_FACTORY_NAME = "FACTORY_NAME"; /* 厂区名称*/
public static final String QUERY = "t_hpsc005.query"; public static final String QUERY = "t_hpsc005.query";
public static final String COUNT = "t_hpsc005.count"; public static final String COUNT = "t_hpsc005.count";
...@@ -127,6 +131,8 @@ public class HPSC005 extends DaoEPBase { ...@@ -127,6 +131,8 @@ public class HPSC005 extends DaoEPBase {
private BigDecimal partWidth = new BigDecimal(0.00); /* 宽*/ private BigDecimal partWidth = new BigDecimal(0.00); /* 宽*/
private BigDecimal partThick = new BigDecimal(0.00); /* 厚*/ private BigDecimal partThick = new BigDecimal(0.00); /* 厚*/
private String remark1; private String remark1;
private String factoryCode = " "; /* 厂区编码*/
private String factoryName = " "; /* 厂区名称*/
/** /**
* initialize the metadata. * initialize the metadata.
...@@ -314,6 +320,14 @@ public class HPSC005 extends DaoEPBase { ...@@ -314,6 +320,14 @@ public class HPSC005 extends DaoEPBase {
eiColumn.setFieldLength(10); eiColumn.setFieldLength(10);
eiColumn.setDescName("产品-厚"); eiColumn.setDescName("产品-厚");
eiMetadata.addMeta(eiColumn); eiMetadata.addMeta(eiColumn);
eiColumn = new EiColumn(FIELD_FACTORY_CODE);
eiColumn.setDescName("厂区编码");
eiMetadata.addMeta(eiColumn);
eiColumn = new EiColumn(FIELD_FACTORY_NAME);
eiColumn.setDescName("厂区名称");
eiMetadata.addMeta(eiColumn);
} }
/** /**
* get the unitWt - 单重. * get the unitWt - 单重.
...@@ -367,7 +381,21 @@ public class HPSC005 extends DaoEPBase { ...@@ -367,7 +381,21 @@ public class HPSC005 extends DaoEPBase {
public void setPrdtSpec(String prdtSpec) { public void setPrdtSpec(String prdtSpec) {
this.prdtSpec = prdtSpec; this.prdtSpec = prdtSpec;
} }
public String getFactoryCode() {
return factoryCode;
}
public void setFactoryCode(String factoryCode) {
this.factoryCode = factoryCode;
}
public String getFactoryName() {
return factoryName;
}
public void setFactoryName(String factoryName) {
this.factoryName = factoryName;
}
/** /**
* the constructor. * the constructor.
*/ */
...@@ -935,6 +963,8 @@ public class HPSC005 extends DaoEPBase { ...@@ -935,6 +963,8 @@ public class HPSC005 extends DaoEPBase {
setPartWidth(NumberUtils.toBigDecimal(StringUtils.toString(map.get("partWidth")), partWidth)); setPartWidth(NumberUtils.toBigDecimal(StringUtils.toString(map.get("partWidth")), partWidth));
setPartThick(NumberUtils.toBigDecimal(StringUtils.toString(map.get("partThick")), partThick)); setPartThick(NumberUtils.toBigDecimal(StringUtils.toString(map.get("partThick")), partThick));
setUnitWt(NumberUtils.toBigDecimal(StringUtils.toString(map.get(FIELD_UNIT_WT)), unitWt)); setUnitWt(NumberUtils.toBigDecimal(StringUtils.toString(map.get(FIELD_UNIT_WT)), unitWt));
setFactoryCode(StringUtils.defaultIfEmpty(StringUtils.toString(map.get(FIELD_FACTORY_CODE)), factoryCode));
setFactoryName(StringUtils.defaultIfEmpty(StringUtils.toString(map.get(FIELD_FACTORY_NAME)), factoryName));
} }
...@@ -984,6 +1014,8 @@ public class HPSC005 extends DaoEPBase { ...@@ -984,6 +1014,8 @@ public class HPSC005 extends DaoEPBase {
map.put("partWidth", StringUtils.toString(partWidth, eiMetadata.getMeta("partWidth"))); map.put("partWidth", StringUtils.toString(partWidth, eiMetadata.getMeta("partWidth")));
map.put("partThick", StringUtils.toString(partThick, eiMetadata.getMeta("partThick"))); map.put("partThick", StringUtils.toString(partThick, eiMetadata.getMeta("partThick")));
map.put(FIELD_UNIT_WT, StringUtils.toString(unitWt, eiMetadata.getMeta(FIELD_UNIT_WT))); map.put(FIELD_UNIT_WT, StringUtils.toString(unitWt, eiMetadata.getMeta(FIELD_UNIT_WT)));
map.put(FIELD_FACTORY_CODE, StringUtils.toString(factoryCode, eiMetadata.getMeta(FIELD_FACTORY_CODE)));
map.put(FIELD_FACTORY_NAME, StringUtils.toString(factoryName, eiMetadata.getMeta(FIELD_FACTORY_NAME)));
return map; return map;
} }
......
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:THpsc005a.java <br>
* Description: <br>
*
* Copyrigth:Baosight Software LTD.co Copyright (c) 2019. <br>
*
* @version 1.0
* @history 2024-02-01 10:19:32 create
*/
public class HPSC005A extends DaoEPBase {
private static final long serialVersionUID = 1L;
public static final String FIELD_ID = "id";
public static final String FIELD_PRODUCTION_ORDER_NO = "productionOrderNo"; /* 生产订单号*/
public static final String FIELD_NUM = "num"; /* 计划数量*/
public static final String FIELD_TOTAL_WT = "totalWt"; /* 计划重量*/
public static final String FIELD_ORG_NO = "orgNo"; /* 生产组编码*/
public static final String FIELD_ORG_NAME = "orgName"; /* 生产组名称*/
public static final String FIELD_FACTORY_CODE = "factoryCode"; /* 厂区编码*/
public static final String FIELD_FACTORY_NAME = "factoryName"; /* 厂区名称*/
public static final String FIELD_CREATED_BY = "createdBy"; /* 创建人*/
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 COL_ID = "ID";
public static final String COL_PRODUCTION_ORDER_NO = "PRODUCTION_ORDER_NO"; /* 生产订单号*/
public static final String COL_NUM = "NUM"; /* 计划数量*/
public static final String COL_TOTAL_WT = "TOTAL_WT"; /* 计划重量*/
public static final String COL_ORG_NO = "ORG_NO"; /* 生产组编码*/
public static final String COL_ORG_NAME = "ORG_NAME"; /* 生产组名称*/
public static final String COL_FACTORY_CODE = "FACTORY_CODE"; /* 厂区编码*/
public static final String COL_FACTORY_NAME = "FACTORY_NAME"; /* 厂区名称*/
public static final String COL_CREATED_BY = "CREATED_BY"; /* 创建人*/
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 QUERY = "t_hpsc005a.query";
public static final String COUNT = "t_hpsc005a.count";
public static final String INSERT = "t_hpsc005a.insert";
public static final String UPDATE = "t_hpsc005a.update";
public static final String DELETE = "t_hpsc005a.delete";
private Long id = new Long(0);
private String productionOrderNo = " "; /* 生产订单号*/
private BigDecimal num = new BigDecimal(0.000); /* 计划数量*/
private BigDecimal totalWt = new BigDecimal(0.000); /* 计划重量*/
private String orgNo = " "; /* 生产组编码*/
private String orgName = " "; /* 生产组名称*/
private String factoryCode = " "; /* 厂区编码*/
private String factoryName = " "; /* 厂区名称*/
private String createdBy = " "; /* 创建人*/
private String createdTime = " "; /* 创建时间*/
private String updatedBy = " "; /* 更新人*/
private String updatedTime = " "; /* 更新时间*/
/**
* 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_PRODUCTION_ORDER_NO);
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_TOTAL_WT);
eiColumn.setType("N");
eiColumn.setScaleLength(3);
eiColumn.setFieldLength(15);
eiColumn.setDescName("计划重量");
eiMetadata.addMeta(eiColumn);
eiColumn = new EiColumn(FIELD_ORG_NO);
eiColumn.setDescName("生产组编码");
eiMetadata.addMeta(eiColumn);
eiColumn = new EiColumn(FIELD_ORG_NAME);
eiColumn.setDescName("生产组名称");
eiMetadata.addMeta(eiColumn);
eiColumn = new EiColumn(FIELD_FACTORY_CODE);
eiColumn.setDescName("厂区编码");
eiMetadata.addMeta(eiColumn);
eiColumn = new EiColumn(FIELD_FACTORY_NAME);
eiColumn.setDescName("厂区名称");
eiMetadata.addMeta(eiColumn);
eiColumn = new EiColumn(FIELD_CREATED_BY);
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);
}
/**
* the constructor.
*/
public HPSC005A() {
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 productionOrderNo - 生产订单号.
* @return the productionOrderNo
*/
public String getProductionOrderNo() {
return this.productionOrderNo;
}
/**
* set the productionOrderNo - 生产订单号.
*
* @param productionOrderNo - 生产订单号
*/
public void setProductionOrderNo(String productionOrderNo) {
this.productionOrderNo = productionOrderNo;
}
/**
* 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 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 orgNo - 生产组编码.
* @return the orgNo
*/
public String getOrgNo() {
return this.orgNo;
}
/**
* set the orgNo - 生产组编码.
*
* @param orgNo - 生产组编码
*/
public void setOrgNo(String orgNo) {
this.orgNo = orgNo;
}
/**
* get the orgName - 生产组名称.
* @return the orgName
*/
public String getOrgName() {
return this.orgName;
}
/**
* set the orgName - 生产组名称.
*
* @param orgName - 生产组名称
*/
public void setOrgName(String orgName) {
this.orgName = orgName;
}
/**
* 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 factoryName - 厂区名称.
* @return the factoryName
*/
public String getFactoryName() {
return this.factoryName;
}
/**
* set the factoryName - 厂区名称.
*
* @param factoryName - 厂区名称
*/
public void setFactoryName(String factoryName) {
this.factoryName = factoryName;
}
/**
* 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 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 value from Map.
*
* @param map - source data map
*/
@Override
public void fromMap(Map map) {
setId(NumberUtils.toLong(StringUtils.toString(map.get(FIELD_ID)), id));
setProductionOrderNo(StringUtils.defaultIfEmpty(StringUtils.toString(map.get(FIELD_PRODUCTION_ORDER_NO)), productionOrderNo));
setNum(NumberUtils.toBigDecimal(StringUtils.toString(map.get(FIELD_NUM)), num));
setTotalWt(NumberUtils.toBigDecimal(StringUtils.toString(map.get(FIELD_TOTAL_WT)), totalWt));
setOrgNo(StringUtils.defaultIfEmpty(StringUtils.toString(map.get(FIELD_ORG_NO)), orgNo));
setOrgName(StringUtils.defaultIfEmpty(StringUtils.toString(map.get(FIELD_ORG_NAME)), orgName));
setFactoryCode(StringUtils.defaultIfEmpty(StringUtils.toString(map.get(FIELD_FACTORY_CODE)), factoryCode));
setFactoryName(StringUtils.defaultIfEmpty(StringUtils.toString(map.get(FIELD_FACTORY_NAME)), factoryName));
setCreatedBy(StringUtils.defaultIfEmpty(StringUtils.toString(map.get(FIELD_CREATED_BY)), createdBy));
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));
}
/**
* 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_PRODUCTION_ORDER_NO, StringUtils.toString(productionOrderNo, eiMetadata.getMeta(FIELD_PRODUCTION_ORDER_NO)));
map.put(FIELD_NUM, StringUtils.toString(num, eiMetadata.getMeta(FIELD_NUM)));
map.put(FIELD_TOTAL_WT, StringUtils.toString(totalWt, eiMetadata.getMeta(FIELD_TOTAL_WT)));
map.put(FIELD_ORG_NO, StringUtils.toString(orgNo, eiMetadata.getMeta(FIELD_ORG_NO)));
map.put(FIELD_ORG_NAME, StringUtils.toString(orgName, eiMetadata.getMeta(FIELD_ORG_NAME)));
map.put(FIELD_FACTORY_CODE, StringUtils.toString(factoryCode, eiMetadata.getMeta(FIELD_FACTORY_CODE)));
map.put(FIELD_FACTORY_NAME, StringUtils.toString(factoryName, eiMetadata.getMeta(FIELD_FACTORY_NAME)));
map.put(FIELD_CREATED_BY, StringUtils.toString(createdBy, eiMetadata.getMeta(FIELD_CREATED_BY)));
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)));
return map;
}
}
/**
* Generate time : 2024-01-10 16:44:48
* Version : 1.0
*/
package com.baosight.hpjx.hp.sc.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;
/**
* THpsc002
*
*/
public class HPSC006 extends DaoEPBase {
private Long id = 0L;
private String companyCode = " "; /* 企业编码 预留*/
private String deptCode = " "; /* 部门编码 预留*/
private String projCode = " "; /* 项目编码*/
private String projName = " "; /* 项目名称*/
private String parentId = ""; /* 父节点-部件编码*/
private String parentPrdtName = " "; /* 父节点-部件名称*/
private String type = " "; /* 类别*/
private String leaf = "1"; /* 是否有叶子节点*/
private String sort = " "; /* 排序字段*/
private String icon = " "; /* 图片地址*/
private Integer prdtType = 0; /*部件类型*/
private String prdtCode = " "; /* 部件编码*/
private String prdtName = " "; /* 部件名称*/
private Long inventRecordId = new Long(0); /* 存货档案ID*/
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; /* 状态 0-未提交,1-已提交*/
private Integer delStatus = 0; /* 状态 1未删除,0已删除*/
private String createdBy = " "; /* 创建人*/
private String createdTime; /* 创建时间*/
private String updatedBy = " "; /* 更新人*/
private String updatedTime; /* 更新时间*/
private String remark = " "; /* 备注*/
private Integer lv = 0; /*层级*/
private String spec = " "; /* 规格*/
private BigDecimal length = new BigDecimal(0.00); /* 长*/
private BigDecimal width = new BigDecimal(0.00); /* 宽*/
private BigDecimal thick = new BigDecimal(0.00); /* 厚*/
/**
* initialize the metadata
*/
public void initMetaData() {
EiColumn eiColumn;
eiColumn = new EiColumn("id");
eiColumn.setPrimaryKey(true);
eiColumn.setDescName(" ");
eiMetadata.addMeta(eiColumn);
eiColumn = new EiColumn("companyCode");
eiColumn.setDescName("企业编码 预留");
eiMetadata.addMeta(eiColumn);
eiColumn = new EiColumn("deptCode");
eiColumn.setDescName("部门编码 预留");
eiMetadata.addMeta(eiColumn);
eiColumn = new EiColumn("projCode");
eiColumn.setDescName("项目编码");
eiMetadata.addMeta(eiColumn);
eiColumn = new EiColumn("projName");
eiColumn.setDescName("项目名称");
eiMetadata.addMeta(eiColumn);
eiColumn = new EiColumn("parentId");
eiColumn.setDescName("父节点-部件编码");
eiMetadata.addMeta(eiColumn);
eiColumn = new EiColumn("parentPrdtName");
eiColumn.setDescName("父节点-部件名称");
eiMetadata.addMeta(eiColumn);
eiColumn = new EiColumn("type");
eiColumn.setDescName("类别");
eiMetadata.addMeta(eiColumn);
eiColumn = new EiColumn("leaf");
eiColumn.setDescName("是否有叶子节点");
eiMetadata.addMeta(eiColumn);
eiColumn = new EiColumn("sort");
eiColumn.setDescName("排序字段");
eiMetadata.addMeta(eiColumn);
eiColumn = new EiColumn("icon");
eiColumn.setDescName("图片地址");
eiMetadata.addMeta(eiColumn);
eiColumn = new EiColumn("prdtType");
eiColumn.setDescName("部件类型");
eiMetadata.addMeta(eiColumn);
eiColumn = new EiColumn("prdtCode");
eiColumn.setDescName("部件编码");
eiMetadata.addMeta(eiColumn);
eiColumn = new EiColumn("prdtName");
eiColumn.setDescName("部件名称");
eiMetadata.addMeta(eiColumn);
eiColumn = new EiColumn("inventRecordId");
eiColumn.setDescName("存货档案ID");
eiMetadata.addMeta(eiColumn);
eiColumn = new EiColumn("num");
eiColumn.setDescName("数量");
eiMetadata.addMeta(eiColumn);
eiColumn = new EiColumn("unitWt");
eiColumn.setType("N");
eiColumn.setScaleLength(3);
eiColumn.setFieldLength(15);
eiColumn.setDescName("单重");
eiMetadata.addMeta(eiColumn);
eiColumn = new EiColumn("totalWt");
eiColumn.setType("N");
eiColumn.setScaleLength(3);
eiColumn.setFieldLength(15);
eiColumn.setDescName("总重");
eiMetadata.addMeta(eiColumn);
eiColumn = new EiColumn("filePath1");
eiColumn.setDescName("文件地址1");
eiMetadata.addMeta(eiColumn);
eiColumn = new EiColumn("filePath2");
eiColumn.setDescName("文件地址2");
eiMetadata.addMeta(eiColumn);
eiColumn = new EiColumn("filePath3");
eiColumn.setDescName("文件地址3");
eiMetadata.addMeta(eiColumn);
eiColumn = new EiColumn("filePath4");
eiColumn.setDescName("文件地址4");
eiMetadata.addMeta(eiColumn);
eiColumn = new EiColumn("filePath5");
eiColumn.setDescName("文件地址5");
eiMetadata.addMeta(eiColumn);
eiColumn = new EiColumn("status");
eiColumn.setDescName("状态 0-未提交,1-已提交");
eiMetadata.addMeta(eiColumn);
eiColumn = new EiColumn("delStatus");
eiColumn.setDescName("状态 1未删除,0已删除");
eiMetadata.addMeta(eiColumn);
eiColumn = new EiColumn("createdBy");
eiColumn.setDescName("创建人");
eiMetadata.addMeta(eiColumn);
eiColumn = new EiColumn("createdTime");
eiColumn.setDescName("创建时间");
eiMetadata.addMeta(eiColumn);
eiColumn = new EiColumn("updatedBy");
eiColumn.setDescName("更新人");
eiMetadata.addMeta(eiColumn);
eiColumn = new EiColumn("updatedTime");
eiColumn.setDescName("更新时间");
eiMetadata.addMeta(eiColumn);
eiColumn = new EiColumn("remark");
eiColumn.setDescName("备注");
eiMetadata.addMeta(eiColumn);
eiColumn = new EiColumn("lv");
eiColumn.setDescName("层级");
eiMetadata.addMeta(eiColumn);
eiColumn = new EiColumn("spec");
eiColumn.setDescName("规格");
eiMetadata.addMeta(eiColumn);
eiColumn = new EiColumn("length");
eiColumn.setType("N");
eiColumn.setScaleLength(2);
eiColumn.setFieldLength(10);
eiColumn.setDescName("长");
eiMetadata.addMeta(eiColumn);
eiColumn = new EiColumn("width");
eiColumn.setType("N");
eiColumn.setScaleLength(2);
eiColumn.setFieldLength(10);
eiColumn.setDescName("宽");
eiMetadata.addMeta(eiColumn);
eiColumn = new EiColumn("thick");
eiColumn.setType("N");
eiColumn.setScaleLength(2);
eiColumn.setFieldLength(10);
eiColumn.setDescName("厚");
eiMetadata.addMeta(eiColumn);
}
/**
* the constructor
*/
public HPSC006() {
initMetaData();
}
/**
* get the id
* @return the id
*/
public Long getId() {
return this.id;
}
/**
* set the id
*/
public void setId(Long id) {
this.id = id;
}
/**
* get the companyCode - 企业编码 预留
* @return the companyCode
*/
public String getCompanyCode() {
return this.companyCode;
}
/**
* set the companyCode - 企业编码 预留
*/
public void setCompanyCode(String companyCode) {
this.companyCode = companyCode;
}
/**
* get the deptCode - 部门编码 预留
* @return the deptCode
*/
public String getDeptCode() {
return this.deptCode;
}
/**
* set the deptCode - 部门编码 预留
*/
public void setDeptCode(String deptCode) {
this.deptCode = deptCode;
}
/**
* get the projCode - 项目编码
* @return the projCode
*/
public String getProjCode() {
return this.projCode;
}
/**
* set the projCode - 项目编码
*/
public void setProjCode(String projCode) {
this.projCode = projCode;
}
/**
* get the projName - 项目名称
* @return the projName
*/
public String getProjName() {
return this.projName;
}
/**
* set the projName - 项目名称
*/
public void setProjName(String projName) {
this.projName = projName;
}
/**
* get the parentId - 父节点-部件编码
* @return the parentId
*/
public String getParentId() {
return this.parentId;
}
/**
* set the parentId - 父节点-部件编码
*/
public void setParentId(String parentId) {
this.parentId = parentId;
}
/**
* get the parentPrdtName - 父节点-部件名称
* @return the parentPrdtName
*/
public String getParentPrdtName() {
return this.parentPrdtName;
}
/**
* set the parentPrdtName - 父节点-部件名称
*/
public void setParentPrdtName(String parentPrdtName) {
this.parentPrdtName = parentPrdtName;
}
/**
* get the type - 类别
* @return the type
*/
public String getType() {
return this.type;
}
/**
* set the type - 类别
*/
public void setType(String type) {
this.type = type;
}
/**
* get the leaf - 是否有叶子节点
* @return the leaf
*/
public String getLeaf() {
return this.leaf;
}
/**
* set the leaf - 是否有叶子节点
*/
public void setLeaf(String leaf) {
this.leaf = leaf;
}
/**
* get the sort - 排序字段
* @return the sort
*/
public String getSort() {
return this.sort;
}
/**
* set the sort - 排序字段
*/
public void setSort(String sort) {
this.sort = sort;
}
/**
* get the icon - 图片地址
* @return the icon
*/
public String getIcon() {
return this.icon;
}
/**
* set the icon - 图片地址
*/
public void setIcon(String icon) {
this.icon = icon;
}
/**
* get the prdtType - 部件类型
* @return the prdtType
*/
public Integer getPrdtType() {
return this.prdtType;
}
/**
* set the prdtType - 部件类型
*/
public void setPrdtType(Integer prdtType) {
this.prdtType = prdtType;
}
/**
* get the prdtCode - 部件编码
* @return the prdtCode
*/
public String getPrdtCode() {
return this.prdtCode;
}
/**
* set the prdtCode - 部件编码
*/
public void setPrdtCode(String prdtCode) {
this.prdtCode = prdtCode;
}
/**
* get the prdtName - 部件名称
* @return the prdtName
*/
public String getPrdtName() {
return this.prdtName;
}
/**
* set the prdtName - 部件名称
*/
public void setPrdtName(String prdtName) {
this.prdtName = prdtName;
}
/**
* 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 num - 数量
* @return the num
*/
public BigDecimal getNum() {
return this.num;
}
/**
* set the num - 数量
*/
public void setNum(BigDecimal num) {
this.num = num;
}
/**
* get the unitWt - 单重
* @return the unitWt
*/
public BigDecimal getUnitWt() {
return this.unitWt;
}
/**
* set the unitWt - 单重
*/
public void setUnitWt(BigDecimal unitWt) {
this.unitWt = unitWt;
}
/**
* get the totalWt - 总重
* @return the totalWt
*/
public BigDecimal getTotalWt() {
return this.totalWt;
}
/**
* set the 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
*/
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
*/
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
*/
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
*/
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
*/
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-已提交
*/
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已删除
*/
public void setDelStatus(Integer delStatus) {
this.delStatus = delStatus;
}
/**
* get the createdBy - 创建人
* @return the createdBy
*/
public String getCreatedBy() {
return this.createdBy;
}
/**
* set the createdBy - 创建人
*/
public void setCreatedBy(String createdBy) {
this.createdBy = createdBy;
}
/**
* get the createdTime - 创建时间
* @return the createdTime
*/
public String getCreatedTime() {
return this.createdTime;
}
/**
* set the createdTime - 创建时间
*/
public void setCreatedTime(String createdTime) {
this.createdTime = createdTime;
}
/**
* get the updatedBy - 更新人
* @return the updatedBy
*/
public String getUpdatedBy() {
return this.updatedBy;
}
/**
* set the updatedBy - 更新人
*/
public void setUpdatedBy(String updatedBy) {
this.updatedBy = updatedBy;
}
/**
* get the updatedTime - 更新时间
* @return the updatedTime
*/
public String getUpdatedTime() {
return this.updatedTime;
}
/**
* set the updatedTime - 更新时间
*/
public void setUpdatedTime(String updatedTime) {
this.updatedTime = updatedTime;
}
/**
* get the remark - 备注
* @return the remark
*/
public String getRemark() {
return this.remark;
}
/**
* set the remark - 备注
*/
public void setRemark(String remark) {
this.remark = remark;
}
public Integer getLv() {
return lv;
}
public void setLv(Integer lv) {
this.lv = lv;
}
/**
* get the sort - 规格
* @return the sort
*/
public String getSpec() {
return this.spec;
}
/**
* set the sort - 规格
*/
public void setSpec(String spec) {
this.spec = spec;
}
/**
* 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 value from Map
*/
public void fromMap(Map map) {
setId(NumberUtils.toLong(StringUtils.toString(map.get("id")), id));
setCompanyCode(StringUtils.defaultIfEmpty(StringUtils.toString(map.get("companyCode")), companyCode));
setDeptCode(StringUtils.defaultIfEmpty(StringUtils.toString(map.get("deptCode")), deptCode));
setProjCode(StringUtils.defaultIfEmpty(StringUtils.toString(map.get("projCode")), projCode));
setProjName(StringUtils.defaultIfEmpty(StringUtils.toString(map.get("projName")), projName));
setParentId(StringUtils.defaultIfEmpty(StringUtils.toString(map.get("parentId")), parentId));
setParentPrdtName(StringUtils.defaultIfEmpty(StringUtils.toString(map.get("parentPrdtName")), parentPrdtName));
setType(StringUtils.defaultIfEmpty(StringUtils.toString(map.get("type")), type));
setLeaf(StringUtils.defaultIfEmpty(StringUtils.toString(map.get("leaf")), leaf));
setSort(StringUtils.defaultIfEmpty(StringUtils.toString(map.get("sort")), sort));
setIcon(StringUtils.defaultIfEmpty(StringUtils.toString(map.get("icon")), icon));
setPrdtType(NumberUtils.toInteger(StringUtils.toString(map.get("prdtType")), prdtType));
setPrdtCode(StringUtils.defaultIfEmpty(StringUtils.toString(map.get("prdtCode")), prdtCode));
setPrdtName(StringUtils.defaultIfEmpty(StringUtils.toString(map.get("prdtName")), prdtName));
setInventRecordId(NumberUtils.toLong(StringUtils.toString(map.get("inventRecordId")), inventRecordId));
setNum(NumberUtils.toBigDecimal(StringUtils.toString(map.get("num")), num));
setUnitWt(NumberUtils.toBigDecimal(StringUtils.toString(map.get("unitWt")), unitWt));
setTotalWt(NumberUtils.toBigDecimal(StringUtils.toString(map.get("totalWt")), totalWt));
setFilePath1(StringUtils.defaultIfEmpty(StringUtils.toString(map.get("filePath1")), filePath1));
setFilePath2(StringUtils.defaultIfEmpty(StringUtils.toString(map.get("filePath2")), filePath2));
setFilePath3(StringUtils.defaultIfEmpty(StringUtils.toString(map.get("filePath3")), filePath3));
setFilePath4(StringUtils.defaultIfEmpty(StringUtils.toString(map.get("filePath4")), filePath4));
setFilePath5(StringUtils.defaultIfEmpty(StringUtils.toString(map.get("filePath5")), filePath5));
setStatus(NumberUtils.toInteger(StringUtils.toString(map.get("status")), status));
setDelStatus(NumberUtils.toInteger(StringUtils.toString(map.get("delStatus")), delStatus));
setCreatedBy(StringUtils.defaultIfEmpty(StringUtils.toString(map.get("createdBy")), createdBy));
setCreatedTime(StringUtils.defaultIfEmpty(StringUtils.toString(map.get("createdTime")),createdTime));
setUpdatedBy(StringUtils.defaultIfEmpty(StringUtils.toString(map.get("updatedBy")), updatedBy));
setUpdatedTime(StringUtils.defaultIfEmpty(StringUtils.toString(map.get("updatedTime")),updatedTime));
setRemark(StringUtils.defaultIfEmpty(StringUtils.toString(map.get("remark")), remark));
setLv(NumberUtils.toInteger(StringUtils.toString(map.get("lv")), lv));
setSpec(StringUtils.defaultIfEmpty(StringUtils.toString(map.get("spec")), spec));
setLength(NumberUtils.toBigDecimal(StringUtils.toString(map.get("length")), length));
setWidth(NumberUtils.toBigDecimal(StringUtils.toString(map.get("width")), width));
setThick(NumberUtils.toBigDecimal(StringUtils.toString(map.get("thick")), thick));
}
/**
* set the value to Map
*/
public Map toMap() {
Map map = new HashMap();
map.put("id", StringUtils.toString(id, eiMetadata.getMeta("id")));
map.put("companyCode", StringUtils.toString(companyCode, eiMetadata.getMeta("companyCode")));
map.put("deptCode", StringUtils.toString(deptCode, eiMetadata.getMeta("deptCode")));
map.put("projCode", StringUtils.toString(projCode, eiMetadata.getMeta("projCode")));
map.put("projName", StringUtils.toString(projName, eiMetadata.getMeta("projName")));
map.put("parentId", StringUtils.toString(parentId, eiMetadata.getMeta("parentId")));
map.put("parentPrdtName", StringUtils.toString(parentPrdtName, eiMetadata.getMeta("parentPrdtName")));
map.put("type", StringUtils.toString(type, eiMetadata.getMeta("type")));
map.put("leaf", StringUtils.toString(leaf, eiMetadata.getMeta("leaf")));
map.put("sort", StringUtils.toString(sort, eiMetadata.getMeta("sort")));
map.put("icon", StringUtils.toString(icon, eiMetadata.getMeta("icon")));
map.put("prdtType", StringUtils.toString(prdtType, eiMetadata.getMeta("prdtType")));
map.put("prdtCode", StringUtils.toString(prdtCode, eiMetadata.getMeta("prdtCode")));
map.put("prdtName", StringUtils.toString(prdtName, eiMetadata.getMeta("prdtName")));
map.put("inventRecordId", StringUtils.toString(inventRecordId, eiMetadata.getMeta("inventRecordId")));
map.put("num", StringUtils.toString(num, eiMetadata.getMeta("num")));
map.put("unitWt", StringUtils.toString(unitWt, eiMetadata.getMeta("unitWt")));
map.put("totalWt", StringUtils.toString(totalWt, eiMetadata.getMeta("totalWt")));
map.put("filePath1", StringUtils.toString(filePath1, eiMetadata.getMeta("filePath1")));
map.put("filePath2", StringUtils.toString(filePath2, eiMetadata.getMeta("filePath2")));
map.put("filePath3", StringUtils.toString(filePath3, eiMetadata.getMeta("filePath3")));
map.put("filePath4", StringUtils.toString(filePath4, eiMetadata.getMeta("filePath4")));
map.put("filePath5", StringUtils.toString(filePath5, eiMetadata.getMeta("filePath5")));
map.put("status", StringUtils.toString(status, eiMetadata.getMeta("status")));
map.put("delStatus", StringUtils.toString(delStatus, eiMetadata.getMeta("delStatus")));
map.put("createdBy", StringUtils.toString(createdBy, eiMetadata.getMeta("createdBy")));
map.put("createdTime", StringUtils.toString(createdTime, eiMetadata.getMeta("createdTime")));
map.put("updatedBy", StringUtils.toString(updatedBy, eiMetadata.getMeta("updatedBy")));
map.put("updatedTime", StringUtils.toString(updatedTime, eiMetadata.getMeta("updatedTime")));
map.put("remark", StringUtils.toString(remark, eiMetadata.getMeta("remark")));
map.put("lv", StringUtils.toString(lv, eiMetadata.getMeta("lv")));
map.put("spec", StringUtils.toString(spec, eiMetadata.getMeta("spec")));
map.put("length", StringUtils.toString(length, eiMetadata.getMeta("length")));
map.put("width", StringUtils.toString(width, eiMetadata.getMeta("width")));
map.put("thick", StringUtils.toString(thick, eiMetadata.getMeta("thick")));
return map;
}
}
\ No newline at end of file
...@@ -195,4 +195,5 @@ public class ServiceHPSC001 extends ServiceBase { ...@@ -195,4 +195,5 @@ public class ServiceHPSC001 extends ServiceBase {
throw new PlatException(outInfo.getMsg()); throw new PlatException(outInfo.getMsg());
} }
} }
} }
...@@ -96,6 +96,9 @@ public class ServiceHPSC002 extends ServiceBase { ...@@ -96,6 +96,9 @@ public class ServiceHPSC002 extends ServiceBase {
hppz002.setLv(lv.intValue()+1); hppz002.setLv(lv.intValue()+1);
} }
DaoUtils.insert("HPSC002.insert", hppz002.toMap()); DaoUtils.insert("HPSC002.insert", hppz002.toMap());
DaoUtils.insert("HPSC006.insert", hppz002.toMap());
if (!hppz002.getParentId().equals("root")) { if (!hppz002.getParentId().equals("root")) {
this.checkTreeNodeLeaf(new Long(hppz002.getParentId())); this.checkTreeNodeLeaf(new Long(hppz002.getParentId()));
} }
...@@ -241,7 +244,6 @@ public class ServiceHPSC002 extends ServiceBase { ...@@ -241,7 +244,6 @@ public class ServiceHPSC002 extends ServiceBase {
DaoUtils.update("HPSC002.updateTreeNodeLeaf", queryMap); DaoUtils.update("HPSC002.updateTreeNodeLeaf", queryMap);
} }
/** /**
* 提交 撤回. * 提交 撤回.
*/ */
......
package com.baosight.hpjx.hp.sc.service; package com.baosight.hpjx.hp.sc.service;
import com.baosight.hpjx.core.dao.DaoUtils; import com.baosight.hpjx.core.dao.DaoUtils;
import com.baosight.hpjx.hp.pz.domain.HPPZ011;
import com.baosight.hpjx.hp.sc.domain.HPSC004; import com.baosight.hpjx.hp.sc.domain.HPSC004;
import com.baosight.hpjx.hp.sc.domain.HPSC005; import com.baosight.hpjx.hp.sc.domain.HPSC005;
import com.baosight.iplat4j.core.ei.EiBlock; import com.baosight.iplat4j.core.ei.EiBlock;
...@@ -129,9 +130,9 @@ public class ServiceHPSC005 extends ServiceBase { ...@@ -129,9 +130,9 @@ public class ServiceHPSC005 extends ServiceBase {
public EiInfo assign(EiInfo eiInfo) { public EiInfo assign(EiInfo eiInfo) {
try { try {
String ids = eiInfo.get("ids").toString(); String ids = eiInfo.get("ids").toString();
String orgId = eiInfo.get("orgId").toString(); String orgId = eiInfo.get("id").toString();
//先找到分派的组织 //先找到分派的组织
Map map =(Map) dao.get("XSOG0801.queryByOrgId","orgId", orgId); HPPZ011 HPPZ011 =(HPPZ011) dao.get("HPPZ011.get","id", orgId);
String [] id = ids.split(","); String [] id = ids.split(",");
for (int i = 0; i < id.length; i++) { for (int i = 0; i < id.length; i++) {
...@@ -139,8 +140,9 @@ public class ServiceHPSC005 extends ServiceBase { ...@@ -139,8 +140,9 @@ public class ServiceHPSC005 extends ServiceBase {
HPSC005 HPSC005 = new HPSC005(); HPSC005 HPSC005 = new HPSC005();
HPSC005.setId(NumberUtils.toLong(id[i])); HPSC005.setId(NumberUtils.toLong(id[i]));
HPSC005.setStatus(1); HPSC005.setStatus(1);
HPSC005.setOrgNo(map.get("orgId").toString()); HPSC005.setOrgNo(HPPZ011.getGroupCode());
HPSC005.setOrgName(map.get("orgCname").toString()); HPSC005.setFactoryCode(HPPZ011.getFactoryCode());
HPSC005.setFactoryName(HPPZ011.getFactoryName());
DaoUtils.update("HPSC005.updateAssign", HPSC005.toMap()); DaoUtils.update("HPSC005.updateAssign", HPSC005.toMap());
} }
......
package com.baosight.hpjx.hp.sc.service;
import com.baosight.hpjx.core.dao.DaoUtils;
import com.baosight.hpjx.hp.pz.domain.HPPZ011;
import com.baosight.hpjx.hp.sc.domain.HPSC005A;
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 java.util.Map;
/**
*
*/
public class ServiceHPSC005A extends ServiceBase {
/**
* 画面初始化.
*/
public EiInfo initLoad(EiInfo inInfo) {
HPSC005A HPSC005A = new HPSC005A();
EiInfo outInfo = super.initLoad(inInfo, HPSC005A);
outInfo.addBlock(EiConstant.resultBlock).addBlockMeta(HPSC005A.eiMetadata);
return inInfo;
}
/**
* 查询操作.
*/
@Override
public EiInfo query(EiInfo inInfo) {
/* 调用EI查询方法.*/
EiInfo outInfo = super.query(inInfo, "HPSC005A.query", new HPSC005A());
return outInfo;
}
/**
* 新增操作.
*/
@Override
public EiInfo insert(EiInfo inInfo) {
try {
HPSC005A HPSC005A = new HPSC005A();
EiBlock eiBlock = inInfo.getBlock(EiConstant.resultBlock);
for (int i = 0; i < eiBlock.getRowCount(); i++) {
Map<?, ?> map = eiBlock.getRow(i);
HPSC005A.fromMap(map);
DaoUtils.insert("HPSC005A.insert", HPSC005A.toMap());
}
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);
}
/**
* 修改操作.
*/
public EiInfo update(EiInfo inInfo) {
try {
HPSC005A HPSC005A = new HPSC005A();
EiBlock eiBlock = inInfo.getBlock(EiConstant.resultBlock);
for (int i = 0; i < eiBlock.getRowCount(); i++) {
Map<?, ?> map = eiBlock.getRow(i);
HPSC005A.fromMap(map);
DaoUtils.update("HPSC005A.update", HPSC005A.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);
}
/**
* 删除操作.
*/
public EiInfo delete(EiInfo eiInfo) {
HPSC005A HPSC005A = new HPSC005A();
EiBlock eiBlock = eiInfo.getBlock(EiConstant.resultBlock);
try {
for (int i = 0; i < eiBlock.getRowCount(); i++) {
Map<?, ?> map = eiBlock.getRow(i);
HPSC005A.fromMap(map);
this.dao.delete("HPPZ001.delete", HPSC005A.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;
}
/**
* 分派
* @param eiInfo
* @return
*/
public EiInfo assign(EiInfo eiInfo) {
try {
String ids = eiInfo.get("ids").toString();
String orgId = eiInfo.get("id").toString();
//先找到分派的组织
HPPZ011 HPPZ011 =(HPPZ011) dao.get("HPPZ011.get","id", orgId);
String [] id = ids.split(",");
for (int i = 0; i < id.length; i++) {
// 更新HPSC005A的数据
HPSC005A HPSC005A = new HPSC005A();
HPSC005A.setId(NumberUtils.toLong(id[i]));
HPSC005A.setOrgNo(HPPZ011.getGroupCode());
HPSC005A.setFactoryCode(HPPZ011.getFactoryCode());
HPSC005A.setFactoryName(HPPZ011.getFactoryName());
DaoUtils.update("HPSC005A.updateAssign", HPSC005A.toMap());
}
eiInfo.setStatus(EiConstant.STATUS_SUCCESS);
eiInfo.setMsg("分派成功!");
} catch (PlatException e) {
eiInfo.setStatus(EiConstant.STATUS_FAILURE);
eiInfo.setMsg("分派失败!原因参见详细错误描述!");
eiInfo.setDetailMsg(e.getMessage());
logError("分派失败", e.getMessage());
return eiInfo;
}
return query(eiInfo);
}
}
package com.baosight.hpjx.hp.sc.service;
import cn.hutool.core.bean.BeanUtil;
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.constant.HPConstant;
import com.baosight.hpjx.hp.pz.tools.HPPZTools;
import com.baosight.hpjx.hp.sc.domain.HPSC001;
import com.baosight.hpjx.hp.sc.domain.HPSC006;
import com.baosight.hpjx.hp.sc.domain.HPSC003;
import com.baosight.hpjx.hp.sc.domain.HPSC004;
import com.baosight.hpjx.util.CommonMethod;
import com.baosight.hpjx.util.LogUtils;
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.lang.StringUtils;
import java.math.BigDecimal;
import java.text.DecimalFormat;
import java.text.SimpleDateFormat;
import java.util.Arrays;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
/**
*
*/
public class ServiceHPSC006 extends ServiceBase {
/**
* 画面初始化.
*/
public EiInfo initLoad(EiInfo inInfo) {
try {
CommonMethod.initBlock(inInfo, Arrays.asList(DdynamicEnum.INVENT_NAME_BLOCK_ID), null);
inInfo.addBlock(EiConstant.resultBlock).addBlockMeta(new HPSC006().eiMetadata);
} catch (Exception e) {
LogUtils.setDetailMsg(inInfo, e, "初始化失败");
}
return inInfo;
}
/**
* 查询操作.
*/
@Override
public EiInfo query(EiInfo inInfo) {
/* 调用EI查询方法.*/
EiInfo outInfo = super.query(inInfo, "HPSC006.query", new HPSC006());
//调用本地服务
// EiInfo eiInfo_update = new EiInfo();
// eiInfo_update.set(EiConstant.serviceName, "HPSC006");
// eiInfo_update.set(EiConstant.methodName, "delete");
// EiBlock eiBlock_update = new EiBlock(EiConstant.resultBlock);
// EiInfo outInfo_update = XLocalManager.call(eiInfo_update);
return outInfo;
}
/**
* 新增操作.
*/
@Override
public EiInfo insert(EiInfo inInfo) {
try {
HPSC006 hppz002 = new HPSC006();
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");
// 计算总重
BigDecimal num = hppz002.getNum();
BigDecimal unitWt = hppz002.getUnitWt();
DecimalFormat decimalFormat = new DecimalFormat("#.000");
BigDecimal totalWt = new BigDecimal(decimalFormat.format(Math.round(num.multiply(unitWt).floatValue())));
hppz002.setDelStatus(CommonConstant.YesNo.NO_0.intValue());
hppz002.setTotalWt(totalWt);
// if (StringUtils.isNotEmpty(hppz002.getPrdtCode()) && !hppz002.getParentId().equals("root")) {
// hppz002.setPrdtName(HPPZTools.getPz004ByCode(hppz002.getPrdtCode()).getInventName());
// }
hppz002.setSpec(HPPZTools.jointSpec(hppz002.getLength(),hppz002.getWidth(),hppz002.getThick()));
if(hppz002.getParentId().equals("root")){
hppz002.setLv(new Integer(1));
}else{
hppz002.setPrdtCode(HPPZTools.checkAndSavePZ04(hppz002.getPrdtType(),hppz002.getPrdtName()));
Integer lv = (Integer) this.dao.get("HPSC006.queryLv","id",hppz002.getParentId());
hppz002.setLv(lv.intValue()+1);
}
DaoUtils.insert("HPSC006.insert", hppz002.toMap());
if (!hppz002.getParentId().equals("root")) {
this.checkTreeNodeLeaf(new Long(hppz002.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 query(inInfo);
}
/**
* 修改操作.
*/
public EiInfo update(EiInfo inInfo) {
try {
HPSC006 hppz002 = new HPSC006();
EiBlock eiBlock = inInfo.getBlock(EiConstant.resultBlock);
for (int i = 0; i < eiBlock.getRowCount(); i++) {
Map<?, ?> map = eiBlock.getRow(i);
hppz002.fromMap(map);
BigDecimal num = hppz002.getNum();
BigDecimal unitWt = hppz002.getUnitWt();
DecimalFormat decimalFormat = new DecimalFormat("#.000");
BigDecimal totalWt = new BigDecimal(decimalFormat.format(Math.round(num.multiply(unitWt).floatValue())));
hppz002.setDelStatus(CommonConstant.YesNo.NO_0.intValue());
hppz002.setTotalWt(totalWt);
if (StringUtils.isNotEmpty(hppz002.getPrdtCode()) && !hppz002.getParentId().equals("root")) {
hppz002.setPrdtName(HPPZTools.getPz004ByCode(hppz002.getPrdtCode()).getInventName());
}
DaoUtils.update("HPSC006.update", hppz002.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);
}
/**
* 删除操作.
*/
public EiInfo delete(EiInfo eiInfo) {
HPSC006 hppz002 = new HPSC006();
EiBlock eiBlock = eiInfo.getBlock(EiConstant.resultBlock);
try {
for (int i = 0; i < eiBlock.getRowCount(); i++) {
Map<?, ?> map = eiBlock.getRow(i);
hppz002.fromMap(map);
this.dao.delete("HPSC006.delete", hppz002.toMap());
this.checkTreeNodeLeaf(new Long(hppz002.getParentId()));
//TODO 删除时 修改树结构
this.checkTreeNodeLeaf(new Long(hppz002.getId()));
}
} 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
*/
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;
}
//树查询服务
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("HPSC006.queryTree", queryMap);
//3 增加节点block块
EiInfo outInfo = new EiInfo();
EiBlock outBlock = outInfo.addBlock(BeanUtil.isEmpty(pEname) ? "" : pEname);
outBlock.addRows(rows);
return outInfo;
}
/**
* 修改父级节点的LEAF状态为1
*
* @param id
*/
public void checkTreeNodeLeaf(Long id) {
EiInfo eiInfo = new EiInfo();
//1 获取参数
Map queryMap = new HashMap();
queryMap.put("id", id);
List rows = this.dao.query("HPSC006.queryTreeNodeByParentPrtdCode", queryMap);
if(rows.size() > 0){
queryMap.put("leaf", "0");
}else{
queryMap.put("leaf", "1");
}
DaoUtils.update("HPSC006.updateTreeNodeLeaf", queryMap);
}
/**
* 提交 撤回.
*/
public EiInfo check(EiInfo eiInfo) {
HPSC006 hppz002 = new HPSC006();
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")) {
//找到二级是否已经提交
HPSC006 THPSC006 = (HPSC006) dao.get("HPSC006.query","id",hppz002.getId());
if (THPSC006.getStatus() == 1) {
// 二级如果已经提交了则需要去看看计划是否已经更新
}
}
DaoUtils.update("HPSC006.check", hppz002.toMap());
}
// 处理三级提交之后判断是否都提交完成,如果都提交完成则二级直接提交通过
for (int i = 0; i < eiBlock.getRowCount(); i++) {
Map<?, ?> map = eiBlock.getRow(i);
hppz002.fromMap(map);
HPSC006 THPSC006 = (HPSC006) dao.get("HPSC006.query","id",hppz002.getId());
Map map1 = new HashMap();
map1.put("parentId",THPSC006.getParentId());
List list = dao.query("HPSC006.checkExamineNum", map1);
int num = NumberUtils.toint(list.get(0));
Map map2 = new HashMap();
if (num == 0) {
map2.put("status",1);
map2.put("id",THPSC006.getParentId());
// 自动生成生产计划
this.autoPlanInfo(THPSC006.getParentId());
} else {
map2.put("status",0);
map2.put("id",THPSC006.getParentId());
}
DaoUtils.update("HPSC006.check",map2);
//处理项目管理中物料状态
Map map3 = new HashMap();
map3.put("projCode",THPSC006.getProjCode());
List list1 = dao.query("HPSC006.checkExamineNum1", map3);
List list2 = dao.query("HPSC006.checkExamineNum1Count", map3);
//未提交数量
int num1 = NumberUtils.toint(list1.get(0));
//总量
int num2 = NumberUtils.toint(list2.get(0));
if (num1 == 0) {
//都已经提交
Map map4 = new HashMap();
map4.put("projCode",THPSC006.getProjCode());
map4.put("materialStatus",2);
DaoUtils.update("HPSC001.checkByProjCode",map4);
} else if (num1 > 0 && num1 < num2) {
// 部分提交
Map map4 = new HashMap();
map4.put("projCode",THPSC006.getProjCode());
map4.put("materialStatus",1);
DaoUtils.update("HPSC001.checkByProjCode",map4);
}
}
} 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;
}
/**
* 绑定附件
*/
public EiInfo bindDocIdById(EiInfo eiInfo) {
HPSC006 hppz002 = new HPSC006();
EiBlock eiBlock = eiInfo.getBlock(EiConstant.resultBlock);
try {
for (int i = 0; i < eiBlock.getRowCount(); i++) {
Map<?, ?> map = eiBlock.getRow(i);
hppz002.fromMap(map);
Map sqlMap = new HashMap();
sqlMap.put("id",hppz002.getId());
sqlMap.put("filePath1",hppz002.getFilePath1());
DaoUtils.update("HPSC006.bindDocIdById", hppz002.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;
}
/**
* 生产生产计划
* @param id
*/
public void autoPlanInfo(String id) {
SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss");
HPSC006 THPSC006 = (HPSC006) dao.get("HPSC006.queryEntityByParentPrtdCode","id",id);
String SCJHD = SequenceGenerator.getNextSequence(HPConstant.SequenceId.HPSC003_PROD_NO);
//生成生产计划t_hpsc003
HPSC003 HPSC003 = new HPSC003();
HPSC003.setCompanyCode("");
HPSC003.setProjType(null);
HPSC003.setProjCode(THPSC006.getProjCode());
HPSC003.setProjName(THPSC006.getProjName());
HPSC003.setPlanInfoNo(SCJHD);
HPSC003.setInventRecordId(THPSC006.getInventRecordId());
HPSC003.setPrdtType(THPSC006.getPrdtType());
HPSC003.setPrdtCode(THPSC006.getPrdtCode());
HPSC003.setPrdtName(THPSC006.getPrdtName());
HPSC003.setSpec(THPSC006.getSpec());
HPSC003.setLength(THPSC006.getLength());
HPSC003.setWidth(THPSC006.getWidth());
HPSC003.setThick(THPSC006.getThick());
HPSC003.setRemark(THPSC006.getRemark());
HPSC003.setPlanCompletionDate("");
HPSC003.setStatus(0);
DaoUtils.insert("HPSC003.insert", HPSC003.toMap());
//生产计划详情
Map queryMap = new HashMap();
queryMap.put("parentId", id);
List<HPSC006> rows = this.dao.query("HPSC006.queryEntityByParentPrtdCode", queryMap);
for (int i = 0; i < rows.size(); i++) {
HPSC006 HPSC006 = rows.get(i);
HPSC004 HPSC004 = new HPSC004();
HPSC004.setCompanyCode("");
HPSC004.setDeptCode("");
HPSC004.setProjCode(HPSC006.getProjCode());
HPSC004.setProjName(HPSC006.getProjName());
HPSC004.setParentId(SCJHD);
HPSC004.setParentPrdtName(HPSC006.getParentPrdtName());
HPSC004.setInventRecordId(HPSC006.getInventRecordId());
HPSC004.setPrdtType(HPSC006.getPrdtType());
HPSC004.setPrdtCode(HPSC006.getPrdtCode());
HPSC004.setPrdtName(HPSC006.getPrdtName());
HPSC004.setSpec(HPSC006.getSpec());
HPSC004.setLength(HPSC006.getLength());
HPSC004.setWidth(HPSC006.getWidth());
HPSC004.setThick(HPSC006.getThick());
HPSC004.setRemark(HPSC006.getRemark());
HPSC004.setNum(HPSC006.getNum());
HPSC004.setUnitWt(HPSC006.getUnitWt());
HPSC004.setTotalWt(HPSC006.getTotalWt());
HPSC004.setFilePath1(HPSC006.getId().toString());
HPSC004.setPlanCommentDate("");
HPSC004.setPlanCompletionDate("");
HPSC004.setActualCompletionNum(NumberUtils.toBigDecimal(0.00));
HPSC004.setActualCompletionUnitWt(NumberUtils.toBigDecimal(0.00));
HPSC004.setActualCompletionDate("");
HPSC004.setDelStatus(1);
DaoUtils.insert("HPSC004.insert", HPSC004.toMap());
}
}
}
package com.baosight.hpjx.hp.sc.service; package com.baosight.hpjx.hp.sc.service;
import com.baosight.hpjx.common.DdynamicEnum;
import com.baosight.hpjx.core.security.UserSessionUtils; import com.baosight.hpjx.core.security.UserSessionUtils;
import com.baosight.hpjx.hp.pz.domain.HPPZ011;
import com.baosight.hpjx.hp.sc.domain.HPSC004; import com.baosight.hpjx.hp.sc.domain.HPSC004;
import com.baosight.hpjx.hp.sc.domain.HPSC005; import com.baosight.hpjx.hp.sc.domain.HPSC005;
import com.baosight.hpjx.util.CommonMethod;
import com.baosight.hpjx.util.LogUtils;
import com.baosight.iplat4j.core.ei.EiBlock; import com.baosight.iplat4j.core.ei.EiBlock;
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.exception.PlatException;
import com.baosight.iplat4j.core.service.impl.ServiceBase; import com.baosight.iplat4j.core.service.impl.ServiceBase;
import com.baosight.xservices.xs.og.domain.XSOG01; import com.baosight.xservices.xs.og.domain.XSOG01;
import java.util.Arrays;
import java.util.HashMap; import java.util.HashMap;
import java.util.List; import java.util.List;
import java.util.Map; import java.util.Map;
...@@ -23,30 +29,26 @@ public class ServiceHPSC098 extends ServiceBase { ...@@ -23,30 +29,26 @@ public class ServiceHPSC098 extends ServiceBase {
* 画面初始化. * 画面初始化.
*/ */
public EiInfo initLoad(EiInfo inInfo) { public EiInfo initLoad(EiInfo inInfo) {
EiInfo outInfo = new EiInfo(); try {
outInfo.set("inqu_status-0-companyCode", UserSessionUtils.getCompanyCode()); Map queryMap = new HashMap();
outInfo.set("inqu_status-0-orgCname", inInfo.get("inqu_status-0-orgCname")); queryMap.put("orgType", "dept");
outInfo = super.query(outInfo, "HPPZ011.query", new XSOG01()); CommonMethod.initBlock(inInfo, Arrays.asList(DdynamicEnum.ORG_RECORD_BLOCK_ID), queryMap);
EiBlock r3Block = new EiBlock("result"); CommonMethod.initBlock(inInfo, Arrays.asList(DdynamicEnum.GROUP_RECORD_BLOCK_ID), null);
r3Block.setRows(outInfo.getBlock(EiConstant.resultBlock).getRows()); inInfo.addBlock(EiConstant.resultBlock).addBlockMeta(new HPPZ011().eiMetadata);
outInfo.addBlock(r3Block); } catch (PlatException e) {
return outInfo; LogUtils.setDetailMsg(inInfo, e, "初始化失败");
}
return inInfo;
} }
@Override @Override
public EiInfo query(EiInfo inInfo) { public EiInfo query(EiInfo inInfo) {
XSOG01 XSOG01 = new XSOG01(); try {
EiInfo outInfo = new EiInfo(); inInfo = super.query(inInfo, HPPZ011.QUERY, new HPPZ011());
//添加返回到前台的块,块名和前台的对应 } catch (Exception e) {
EiBlock eiBlock = outInfo.addBlock("result"); LogUtils.setDetailMsg(inInfo, e, "查询失败");
HashMap params = new HashMap(); }
params.put("orgCname",inInfo.get("inqu_status-0-orgCname")); return inInfo;
params.put("companyCode", UserSessionUtils.getCompanyCode());
List list = dao.query("query.query",params,0,-999999);
outInfo.addBlock(EiConstant.resultBlock).addBlockMeta(XSOG01.eiMetadata);
outInfo.addBlock(EiConstant.resultBlock).addRows(list);
outInfo.getBlock(EiConstant.resultBlock).set("limit", list.size());
return outInfo;
} }
} }
...@@ -150,7 +150,9 @@ ...@@ -150,7 +150,9 @@
PRDT_THICK as "prdtThick", <!-- 厚 --> PRDT_THICK as "prdtThick", <!-- 厚 -->
PART_LENGTH as "partLength", <!-- 长 --> PART_LENGTH as "partLength", <!-- 长 -->
PART_WIDTH as "partWidth", <!-- 宽 --> PART_WIDTH as "partWidth", <!-- 宽 -->
PART_THICK as "partThick" <!-- 厚 --> PART_THICK as "partThick", <!-- 厚 -->
FACTORY_CODE as "factoryCode", <!-- 厂区编码 -->
FACTORY_NAME as "factoryName" <!-- 厂区名称 -->
FROM ${hpjxSchema}.T_HPSC005 WHERE 1=1 FROM ${hpjxSchema}.T_HPSC005 WHERE 1=1
<include refid="condition" /> <include refid="condition" />
<dynamic prepend="ORDER BY"> <dynamic prepend="ORDER BY">
...@@ -268,13 +270,14 @@ ...@@ -268,13 +270,14 @@
PRDT_THICK, <!-- 厚 --> PRDT_THICK, <!-- 厚 -->
PART_LENGTH, <!-- 长 --> PART_LENGTH, <!-- 长 -->
PART_WIDTH, <!-- 宽 --> PART_WIDTH, <!-- 宽 -->
PART_THICK <!-- 厚 --> PART_THICK, <!-- 厚 -->
) FACTORY_CODE, <!-- 厂区编码 -->
FACTORY_NAME <!-- 厂区名称 --> )
VALUES (#id#, #companyCode#, #projCode#, #projName#, #productionOrderNo#,#inventRecordId#, #prdtType#, #prdtCode#, VALUES (#id#, #companyCode#, #projCode#, #projName#, #productionOrderNo#,#inventRecordId#, #prdtType#, #prdtCode#,
#prdtName#, #planCompletionDate#, #num#,#unitWt#, #totalWt#, #status#, #orgNo#, #orgName#, #createdBy#, #createdTime#, #prdtName#, #planCompletionDate#, #num#,#unitWt#, #totalWt#, #status#, #orgNo#, #orgName#, #createdBy#, #createdTime#,
#updatedBy#, #updatedTime#, #depCode#, #remark#, #filePath1#, #filePath2#, #filePath3#, #filePath4#, #filePath5#, #updatedBy#, #updatedTime#, #depCode#, #remark#, #filePath1#, #filePath2#, #filePath3#, #filePath4#, #filePath5#,
#prdtSpec#,#partType#,#partCode#,#partName#,#partSpec#,#remark1#, #prdtSpec#,#partType#,#partCode#,#partName#,#partSpec#,#remark1#,
#prdtLength#,#prdtWidth#,#prdtThick#,#partLength#,#partWidth#,#partThick#) #prdtLength#,#prdtWidth#,#prdtThick#,#partLength#,#partWidth#,#partThick#, #factoryCode#, #factoryName#)
</insert> </insert>
<delete id="delete"> <delete id="delete">
...@@ -309,7 +312,9 @@ ...@@ -309,7 +312,9 @@
FILE_PATH2 = #filePath2#, <!-- 文件地址2 --> FILE_PATH2 = #filePath2#, <!-- 文件地址2 -->
FILE_PATH3 = #filePath3#, <!-- 文件地址3 --> FILE_PATH3 = #filePath3#, <!-- 文件地址3 -->
FILE_PATH4 = #filePath4#, <!-- 文件地址4 --> FILE_PATH4 = #filePath4#, <!-- 文件地址4 -->
FILE_PATH5 = #filePath5# <!-- 文件地址5 --> FILE_PATH5 = #filePath5#, <!-- 文件地址5 -->
FACTORY_CODE = #factoryCode#, <!-- 厂区编码 -->
FACTORY_NAME = #factoryName# <!-- 厂区名称 -->
WHERE WHERE
ID = #id# ID = #id#
</update> </update>
...@@ -320,7 +325,8 @@ ...@@ -320,7 +325,8 @@
SET SET
STATUS = #status#, <!-- 状态 0-未派工,1-已派工 --> STATUS = #status#, <!-- 状态 0-未派工,1-已派工 -->
ORG_NO = #orgNo#, <!-- 生产组编码 --> ORG_NO = #orgNo#, <!-- 生产组编码 -->
ORG_NAME = #orgName#, <!-- 生产组名称 --> FACTORY_CODE = #factoryCode#, <!-- 厂区编码 -->
FACTORY_NAME = #factoryName#, <!-- 厂区名称 -->
UPDATED_BY = #updatedBy#, <!-- 更新人 --> UPDATED_BY = #updatedBy#, <!-- 更新人 -->
UPDATED_TIME = #updatedTime# <!-- 更新时间 --> UPDATED_TIME = #updatedTime# <!-- 更新时间 -->
WHERE WHERE
......
<?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-02-01 10:19:32
Version : 1.0
schema : hpjx
tableName : T_HPSC005A
ID BIGINT NOT NULL primarykey,
PRODUCTION_ORDER_NO VARCHAR,
NUM DECIMAL,
TOTAL_WT DECIMAL,
ORG_NO VARCHAR,
ORG_NAME VARCHAR,
FACTORY_CODE VARCHAR,
FACTORY_NAME VARCHAR,
CREATED_BY VARCHAR,
CREATED_TIME VARCHAR,
UPDATED_BY VARCHAR,
UPDATED_TIME VARCHAR
-->
<sqlMap namespace="HPSC005A">
<sql id="condition">
<isNotEmpty prepend=" AND " property="id">
ID = #id#
</isNotEmpty>
<isNotEmpty prepend=" AND " property="productionOrderNo">
PRODUCTION_ORDER_NO = #productionOrderNo#
</isNotEmpty>
<isNotEmpty prepend=" AND " property="num">
NUM = #num#
</isNotEmpty>
<isNotEmpty prepend=" AND " property="totalWt">
TOTAL_WT = #totalWt#
</isNotEmpty>
<isNotEmpty prepend=" AND " property="orgNo">
ORG_NO = #orgNo#
</isNotEmpty>
<isNotEmpty prepend=" AND " property="orgName">
ORG_NAME = #orgName#
</isNotEmpty>
<isNotEmpty prepend=" AND " property="factoryCode">
FACTORY_CODE = #factoryCode#
</isNotEmpty>
<isNotEmpty prepend=" AND " property="factoryName">
FACTORY_NAME = #factoryName#
</isNotEmpty>
<isNotEmpty prepend=" AND " property="createdBy">
CREATED_BY = #createdBy#
</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>
</sql>
<select id="query" parameterClass="java.util.HashMap"
resultClass="com.baosight.hpjx.hp.sc.domain.HPSC005A">
SELECT
ID as "id",
PRODUCTION_ORDER_NO as "productionOrderNo", <!-- 生产订单号 -->
NUM as "num", <!-- 计划数量 -->
TOTAL_WT as "totalWt", <!-- 计划重量 -->
ORG_NO as "orgNo", <!-- 生产组编码 -->
ORG_NAME as "orgName", <!-- 生产组名称 -->
FACTORY_CODE as "factoryCode", <!-- 厂区编码 -->
FACTORY_NAME as "factoryName", <!-- 厂区名称 -->
CREATED_BY as "createdBy", <!-- 创建人 -->
CREATED_TIME as "createdTime", <!-- 创建时间 -->
UPDATED_BY as "updatedBy", <!-- 更新人 -->
UPDATED_TIME as "updatedTime" <!-- 更新时间 -->
FROM ${hpjxSchema}.T_HPSC005A 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_HPSC005A WHERE 1=1
<include refid="condition" />
</select>
<!--
<isNotEmpty prepend=" AND " property="id">
ID = #id#
</isNotEmpty>
<isNotEmpty prepend=" AND " property="productionOrderNo">
PRODUCTION_ORDER_NO = #productionOrderNo#
</isNotEmpty>
<isNotEmpty prepend=" AND " property="num">
NUM = #num#
</isNotEmpty>
<isNotEmpty prepend=" AND " property="totalWt">
TOTAL_WT = #totalWt#
</isNotEmpty>
<isNotEmpty prepend=" AND " property="orgNo">
ORG_NO = #orgNo#
</isNotEmpty>
<isNotEmpty prepend=" AND " property="orgName">
ORG_NAME = #orgName#
</isNotEmpty>
<isNotEmpty prepend=" AND " property="factoryCode">
FACTORY_CODE = #factoryCode#
</isNotEmpty>
<isNotEmpty prepend=" AND " property="factoryName">
FACTORY_NAME = #factoryName#
</isNotEmpty>
<isNotEmpty prepend=" AND " property="createdBy">
CREATED_BY = #createdBy#
</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>
-->
<insert id="insert">
INSERT INTO ${hpjxSchema}.T_HPSC005A (ID,
PRODUCTION_ORDER_NO, <!-- 生产订单号 -->
NUM, <!-- 计划数量 -->
TOTAL_WT, <!-- 计划重量 -->
ORG_NO, <!-- 生产组编码 -->
ORG_NAME, <!-- 生产组名称 -->
FACTORY_CODE, <!-- 厂区编码 -->
FACTORY_NAME, <!-- 厂区名称 -->
CREATED_BY, <!-- 创建人 -->
CREATED_TIME, <!-- 创建时间 -->
UPDATED_BY, <!-- 更新人 -->
UPDATED_TIME <!-- 更新时间 -->
)
VALUES (#id#, #productionOrderNo#, #num#, #totalWt#, #orgNo#, #orgName#, #factoryCode#, #factoryName#, #createdBy#, #createdTime#, #updatedBy#, #updatedTime#)
</insert>
<delete id="delete">
DELETE FROM ${hpjxSchema}.T_HPSC005A WHERE
ID = #id#
</delete>
<update id="update">
UPDATE ${hpjxSchema}.T_HPSC005A
SET
PRODUCTION_ORDER_NO = #productionOrderNo#, <!-- 生产订单号 -->
NUM = #num#, <!-- 计划数量 -->
TOTAL_WT = #totalWt#, <!-- 计划重量 -->
ORG_NO = #orgNo#, <!-- 生产组编码 -->
ORG_NAME = #orgName#, <!-- 生产组名称 -->
FACTORY_CODE = #factoryCode#, <!-- 厂区编码 -->
FACTORY_NAME = #factoryName#, <!-- 厂区名称 -->
CREATED_BY = #createdBy#, <!-- 创建人 -->
CREATED_TIME = #createdTime#, <!-- 创建时间 -->
UPDATED_BY = #updatedBy#, <!-- 更新人 -->
UPDATED_TIME = #updatedTime# <!-- 更新时间 -->
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">
<!-- table information
Generate time : 2024-01-11 11:34:26
Version : 1.0
tableName :hpjx.t_HPSC006
ID BIGINT NOT NULL primarykey,
COMPANY_CODE VARCHAR NOT NULL,
DEPT_CODE VARCHAR NOT NULL,
PROJ_CODE VARCHAR,
PROJ_NAME VARCHAR,
PARENT_ID VARCHAR,
PARENT_PRDT_NAME VARCHAR,
TYPE VARCHAR NOT NULL,
LEAF VARCHAR NOT NULL,
SORT VARCHAR NOT NULL,
ICON VARCHAR NOT NULL,
PRDT_CODE VARCHAR,
PRDT_NAME VARCHAR,
NUM INTEGER NOT NULL,
UNIT_WT DECIMAL NOT NULL,
TOTAL_WT DECIMAL NOT NULL,
FILE_PATH1 VARCHAR,
FILE_PATH2 VARCHAR,
FILE_PATH3 VARCHAR,
FILE_PATH4 VARCHAR,
FILE_PATH5 VARCHAR,
STATUS TINYINT,
DEL_STATUS TINYINT,
CREATED_BY VARCHAR,
CREATED_TIME DATETIME,
UPDATED_BY VARCHAR,
UPDATED_TIME DATETIME,
REMARK VARCHAR
-->
<sqlMap namespace="HPSC006">
<select id="query" parameterClass="java.util.HashMap"
resultClass="com.baosight.hpjx.hp.sc.domain.HPSC006">
SELECT
ID as "id",
COMPANY_CODE as "companyCode", <!-- 企业编码 预留 -->
DEPT_CODE as "deptCode", <!-- 部门编码 预留 -->
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" <!-- 厚 -->
FROM hpjx.t_HPSC006 WHERE 1=1
AND PARENT_ID NOT IN ('root')
AND DEL_STATUS = 0
<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 ('%$#prdtName#$%')
</isNotEmpty>
<isNotEmpty prepend=" AND " property="inventRecordId">
INVENT_RECORD_ID = #inventRecordId#
</isNotEmpty>
<isNotEmpty prepend=" AND " property="projName">
PROJ_NAME LIKE ('%$projName$%')
</isNotEmpty>
<isNotEmpty prepend=" AND " property="status">
STATUS = #status#
</isNotEmpty>
<isNotEmpty prepend=" AND " property="lv">
LV = #lv#
</isNotEmpty>
ORDER BY ID DESC
<!-- <dynamic prepend="ORDER BY">-->
<!-- <isEmpty property="orderBy">-->
<!-- CREATED_TIME DESC-->
<!-- </isEmpty>-->
<!-- </dynamic>-->
</select>
<select id="count" resultClass="int">
SELECT COUNT(*) FROM hpjx.t_HPSC006 WHERE 1=1
AND PARENT_ID NOT IN ('root')
AND DEL_STATUS = 0
<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 ('%$#prdtName#$%')
</isNotEmpty>
<isNotEmpty prepend=" AND " property="projName">
PROJ_NAME LIKE ('%$projName$%')
</isNotEmpty>
<isNotEmpty prepend=" AND " property="inventRecordId">
INVENT_RECORD_ID = #inventRecordId#
</isNotEmpty>
<isNotEmpty prepend=" AND " property="status">
STATUS = #status#
</isNotEmpty>
<isNotEmpty prepend=" AND " property="lv">
LV = #lv#
</isNotEmpty>
</select>
<!--
<isNotEmpty prepend=" AND " property="id">
ID = #id#
</isNotEmpty>
<isNotEmpty prepend=" AND " property="companyCode">
COMPANY_CODE = #companyCode#
</isNotEmpty>
<isNotEmpty prepend=" AND " property="deptCode">
DEPT_CODE = #deptCode#
</isNotEmpty>
<isNotEmpty prepend=" AND " property="projCode">
PROJ_CODE = #projCode#
</isNotEmpty>
<isNotEmpty prepend=" AND " property="projName">
PROJ_NAME = #projName#
</isNotEmpty>
<isNotEmpty prepend=" AND " property="parentId">
PARENT_ID = #parentId#
</isNotEmpty>
<isNotEmpty prepend=" AND " property="parentPrdtName">
PARENT_PRDT_NAME = #parentPrdtName#
</isNotEmpty>
<isNotEmpty prepend=" AND " property="type">
TYPE = #type#
</isNotEmpty>
<isNotEmpty prepend=" AND " property="leaf">
LEAF = #leaf#
</isNotEmpty>
<isNotEmpty prepend=" AND " property="sort">
SORT = #sort#
</isNotEmpty>
<isNotEmpty prepend=" AND " property="icon">
ICON = #icon#
</isNotEmpty>
<isNotEmpty prepend=" AND " property="prdtCode">
PRDT_CODE = #prdtCode#
</isNotEmpty>
<isNotEmpty prepend=" AND " property="prdtName">
PRDT_NAME = #prdtName#
</isNotEmpty>
<isNotEmpty prepend=" AND " property="num">
NUM = #num#
</isNotEmpty>
<isNotEmpty prepend=" AND " property="unitWt">
UNIT_WT = #unitWt#
</isNotEmpty>
<isNotEmpty prepend=" AND " property="totalWt">
TOTAL_WT = #totalWt#
</isNotEmpty>
<isNotEmpty prepend=" AND " property="filePath1">
FILE_PATH1 = #filePath1#
</isNotEmpty>
<isNotEmpty prepend=" AND " property="filePath2">
FILE_PATH2 = #filePath2#
</isNotEmpty>
<isNotEmpty prepend=" AND " property="filePath3">
FILE_PATH3 = #filePath3#
</isNotEmpty>
<isNotEmpty prepend=" AND " property="filePath4">
FILE_PATH4 = #filePath4#
</isNotEmpty>
<isNotEmpty prepend=" AND " property="filePath5">
FILE_PATH5 = #filePath5#
</isNotEmpty>
<isNotEmpty prepend=" AND " property="status">
STATUS = #status#
</isNotEmpty>
<isNotEmpty prepend=" AND " property="delStatus">
DEL_STATUS = #delStatus#
</isNotEmpty>
<isNotEmpty prepend=" AND " property="createdBy">
CREATED_BY = #createdBy#
</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="remark">
REMARK = #remark#
</isNotEmpty>
-->
<insert id="insert">
INSERT INTO hpjx.t_HPSC006 (ID,
COMPANY_CODE, <!-- 企业编码 预留 -->
DEPT_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#, #deptCode#, #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>
<delete id="delete">
DELETE FROM hpjx.t_HPSC006 WHERE
ID = #id#
</delete>
<update id="update">
UPDATE hpjx.t_HPSC006
SET
COMPANY_CODE = #companyCode#, <!-- 企业编码 预留 -->
DEPT_CODE = #deptCode#, <!-- 部门编码 预留 -->
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_HPSC006
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>
<select id="queryTreeNodeByParentPrtdCode" resultClass="java.util.HashMap">
SELECT
ID as "id",
COMPANY_CODE as "companyCode", <!-- 企业编码 预留 -->
DEPT_CODE as "deptCode", <!-- 部门编码 预留 -->
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" <!-- 厚 -->
FROM hpjx.t_HPSC006
WHERE 1 = 1
<isNotEmpty prepend=" AND " property="id">
PARENT_ID = #id#
</isNotEmpty>
<isNotEmpty prepend=" AND " property="projCode">
PROJ_CODE = #projCode#
</isNotEmpty>
</select>
<select id="queryEntityByParentPrtdCode" parameterClass="java.util.HashMap"
resultClass="com.baosight.hpjx.hp.sc.domain.HPSC006">
SELECT
ID as "id",
COMPANY_CODE as "companyCode", <!-- 企业编码 预留 -->
DEPT_CODE as "deptCode", <!-- 部门编码 预留 -->
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" <!-- 厚 -->
FROM hpjx.t_HPSC006 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_HPSC006 SET LEAF = #leaf# WHERE ID = #id#
</update>
<update id="check">
UPDATE hpjx.t_HPSC006 SET status = #status# WHERE ID = #id#
</update>
<update id="bindDocIdById">
UPDATE hpjx.t_HPSC006 SET FILE_PATH1 = #filePath1# WHERE ID = #id#
</update>
<select id="checkExamineNum1" resultClass="int">
SELECT COUNT(1) from hpjx.t_HPSC006
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_HPSC006
WHERE ID = #id#
</select>
<select id="checkExamineNum1Count" resultClass="int">
SELECT COUNT(1) from hpjx.t_HPSC006
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_HPSC006
WHERE LEAF = '1'
AND STATUS = 0 AND DEL_STATUS = 0
<isNotEmpty prepend=" AND " property="parentId">
PARENT_ID = #parentId#
</isNotEmpty>
</select>
</sqlMap>
\ No newline at end of file
...@@ -32,12 +32,11 @@ public class ServiceHPZL001 extends ServiceBase { ...@@ -32,12 +32,11 @@ public class ServiceHPZL001 extends ServiceBase {
*/ */
public EiInfo initLoad(EiInfo inInfo) { public EiInfo initLoad(EiInfo inInfo) {
HPZL001 HPZL001 = new HPZL001(); HPZL001 HPZL001 = new HPZL001();
Map map = new HashMap();
map.put("status","1");
EiInfo outInfo = super.initLoad(inInfo, HPZL001); EiInfo outInfo = super.initLoad(inInfo, HPZL001);
outInfo.getBlock(EiConstant.resultBlock).getRows().clear(); outInfo.getBlock(EiConstant.resultBlock).getRows().clear();
CommonMethod.initBlock(outInfo, Arrays.asList(DdynamicEnum.PROJ_RECORD_BLOCK_ID), CommonMethod.initBlock(outInfo, Arrays.asList(DdynamicEnum.PROJ_RECORD_BLOCK_ID), map);
new HashMap<String, Object>(1) {{
put("status", "1");
}});
return outInfo; return outInfo;
} }
......
...@@ -56,6 +56,7 @@ ...@@ -56,6 +56,7 @@
<EF:EFColumn enable="false" ename="planCompletionDate" cname="计划完成日期"/> <EF:EFColumn enable="false" ename="planCompletionDate" cname="计划完成日期"/>
<EF:EFColumn enable="false" ename="num" cname="计划数量"/> <EF:EFColumn enable="false" ename="num" cname="计划数量"/>
<EF:EFColumn enable="false" ename="unitWt" cname="计划单量"/>
<EF:EFColumn enable="false" ename="totalWt" cname="计划重量"/> <EF:EFColumn enable="false" ename="totalWt" cname="计划重量"/>
<EF:EFColumn enable="false" ename="orgName" cname="生产组"/> <EF:EFColumn enable="false" ename="orgName" cname="生产组"/>
</EF:EFGrid> </EF:EFGrid>
......
...@@ -5,15 +5,26 @@ $(function () { ...@@ -5,15 +5,26 @@ $(function () {
resultGrid.dataSource.page(1); resultGrid.dataSource.page(1);
}); });
$("#inqu_status-0-orgNo").on("click", function () {
$("#TEAR_ASSIGN").on("click", function () {
//重置全局变量
ids = [];
let rows = resultGrid.getCheckedRows()
if (rows.length != 1) {
message("只能选择一条需要拆单分派的数据");
return;
}
JSColorbox.open({ JSColorbox.open({
href: "HPSC098?methodName=initLoad&isInput", href: "HPSC006?methodName=initLoad",
title: "<div style='text-align: center;'>选择组织</div>", title: "<div style='text-align: center;'>拆单派工</div>",
width: "40%", width: "40%",
height: "70%", height: "70%",
callbackName: getOrgCallback callbackName: assignCallback
});
}); });
})
$("#ASSIGN").on("click", function () { $("#ASSIGN").on("click", function () {
//重置全局变量 //重置全局变量
...@@ -77,10 +88,10 @@ function showUploadFile(id) { ...@@ -77,10 +88,10 @@ function showUploadFile(id) {
height: "80%", height: "80%",
}); });
} }
let assignCallback = function (orgId) { let assignCallback = function (id) {
var info = new EiInfo() var info = new EiInfo()
info.set("ids",ids.join(',')); info.set("ids",ids.join(','));
info.set("orgId",orgId); info.set("id",id);
EiCommunicator.send("HPSC005","assign",info,{ EiCommunicator.send("HPSC005","assign",info,{
onSuccess:function(ei){//返回结果集 onSuccess:function(ei){//返回结果集
if (ei["status"] == -1) { if (ei["status"] == -1) {
...@@ -101,7 +112,3 @@ let assignCallback = function (orgId) { ...@@ -101,7 +112,3 @@ let assignCallback = function (orgId) {
} }
let getOrgCallback = function (orgId) {
$("#inqu_status-0-orgNo").val(orgId);
JSColorbox.close();
}
\ No newline at end of file
...@@ -59,6 +59,7 @@ ...@@ -59,6 +59,7 @@
<EF:EFOption label="未派工" value="0"/> <EF:EFOption label="未派工" value="0"/>
<EF:EFOption label="已派工" value="1"/> <EF:EFOption label="已派工" value="1"/>
</EF:EFComboColumn> </EF:EFComboColumn>
<EF:EFColumn enable="false" ename="factoryName" cname="厂区名称"/>
<EF:EFColumn enable="false" ename="orgName" cname="生产组"/> <EF:EFColumn enable="false" ename="orgName" cname="生产组"/>
<EF:EFColumn ename="operator" cname="操作" width="100" enable="false" readonly="false"/> <EF:EFColumn ename="operator" cname="操作" width="100" enable="false" readonly="false"/>
</EF:EFGrid> </EF:EFGrid>
......
$(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) {
console.log(item)
let auditStatus = item.status;
let template = '';
if (auditStatus == 0) {
template += '<a style="cursor: pointer;display: inline-flex;justify-content: center;" ' +
'onclick="check(' + item.id + ',1)" >提交</a>';
}
else {
template += '<a hidden="hidden" style="cursor: pointer;display: inline-flex;justify-content: center;" ' +
'onclick="check(' + item.id + ',0)" >撤回</a>';
}
return template;
}
},
{
field: "planCompletionDate",
template: function (item){
let auditStatus = item.status;
let template = '';
if (auditStatus == 1){
template += 'this.blur();';
}
return template;
}
}
],
onSuccess: function (e) {
if(e.eiInfo.extAttr.methodName == 'update'
||e.eiInfo.extAttr.methodName == 'insert'){
query();
}
},
onRowClick : function(e) {
var block = detailGrid.getEiBlock();
if (block != null) {
block.setRows([]);
detailGrid.setEiBlock(block);
}
var info = new EiInfo()
var parentId = e.model['planInfoNo'];
info.set("parentId",parentId);
EiCommunicator.send("HPSC004","queryDetail",info,{
onSuccess:function(ei){//返回结果集
detailGrid.setEiInfo(ei);
},onFail:function(ei){}
},{async:false});
},
},
"detail":{
toolbarConfig: {
// hidden: false, // true时,不显示功能按钮,但保留setting导出按钮
// add: false, // 不显示新增按钮
cancel: true, // 不显示取消按钮
// save: true, // 不显示保存按钮
// delete: true, // 显示删除按钮
},
onSave: function (e) {
var rowCount = detailGrid.getCheckedRows();
// 检验是否选中数据
if (rowCount == null || rowCount == "") {
NotificationUtil({
msg: '请选择一条或多条数据'
}, "warning");
return false;
}
var btnNode = $(this);
//禁用按钮
btnNode.attr("disabled", true);
IPLAT.submitNode($("#HPSC003"), "HPSC003", "updateHPSC0004", {
onSuccess: function (ei) {
if (ei["status"] == -1) {
NotificationUtil(ei, "error");
} else {
NotificationUtil({
msg: '修改成功'
});
// 绑定grid
detailGrid.setEiInfo(ei);
}
//释放禁用按钮
btnNode.attr("disabled", false);
},
onFail: function (ei) { // onFail 表示失败回调函数
// 发生异常
console.log(ei);
//释放禁用按钮
btnNode.attr("disabled", false);
}
});
},
columns: [
{
field: "operator",
template: function (item) {
let filePath1 = item.filePath1;
let template = '';
if (filePath1) {
template += '<a style="cursor: pointer;display: inline-flex;justify-content: center;margin:auto 5px" '
+ 'onclick="showUploadFile(' + filePath1 + ')" >附件清单</a>';
}
return template
}
}
],
}
}
//部件类型下拉联动
$('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});
});
});
function showUploadFile(id) {
JSColorbox.open({
href: "HPSC002B?methodName=initLoad&inqu_status-0-id=" + id,
title: "<div style='text-align: center;'>附件清单</div>",
width: "80%",
height: "80%",
});
}
function check(id, auditStatus) {
const inEiInfo = new EiInfo();
inEiInfo.set("id", id);
//先判断本身是否填写
EiCommunicator.send('HPSC003', 'getInfo', inEiInfo, {
onSuccess(ei) {
var model=ei.get("model");
if(!model.planCompletionDate) {
NotificationUtil("提交失败!原因:基本信息中计划完成日期未填写", "error");
return;
} else {
//提交
//提交前先判断明细信息中的计划开始和计划结束时间是否都已经填写,只有填写了之后才能进行提交
if (auditStatus == 1) {
EiCommunicator.send('HPSC004', 'inspectDetail', inEiInfo, {
onSuccess(ei) {
var list=ei.get("list");
if(list) {
var count = list[0];
if (count > 0) {
NotificationUtil("提交失败!原因:明细信息中有未填写的计划开始时间或计划结束时间", "error");
} else {
EiCommunicator.send('HPSC004','queryDetail',inEiInfo,{
onSuccess(ei){
var rows = ei.blocks.detail.rows;
var res = check_time(model,rows);
if (!res){
NotificationUtil("计划结束时间应该大于计划开始时间!", "error");
}
else {
// 提交通过,生成
EiCommunicator.send('HPSC003', 'checkHPSC0003', inEiInfo, {
onSuccess(response) {
NotificationUtil(response.msg);
resultGrid.dataSource.page(1);
},
onFail(errorMessage, status, e) {
NotificationUtil("执行失败!", "error");
}
},
{
async: false
}
);
}
}
})
}
} else {
NotificationUtil("提交失败!未找到明细信息", "error");
}
},
onFail(errorMessage, status, e) {
NotificationUtil("执行失败!", "error");
}
},
{
async: false
}
);
} else {
// 撤回
}
}
},
onFail(errorMessage, status, e) {
NotificationUtil("执行失败!", "error");
}
},
{
async: false
}
);
}
function check_time(model,rows){
for (var i=0;i<rows.length;i++){
if (model.planInfoNo == rows[i][5]) {
var start_time = rows[i][22];
var end_time = rows[i][23];
if (end_time < start_time) {
return false;
}
}
}
return true;
}
\ 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}"/>
<head>
<%-- <link rel="stylesheet" href="${ctx}/css/simulatedOperation.css"/>--%>
</head>
<EF:EFPage title="拆单派工">
<EF:EFRegion id="detail" title="订单详情">
<EF:EFGrid blockId="result" autoDraw="no">
<EF:EFColumn ename="id" cname="主键" hidden="true"/>
<EF:EFColumn enable="false" ename="projCode" cname="项目号" readonly="true"/>
<EF:EFColumn enable="false" ename="projName" cname="项目名称" readonly="true"/>
<EF:EFColumn enable="false" ename="planInfoNo" cname="生产计划单号" readonly="true"/>
<EF:EFComboColumn ename="prdtType" cname="部件类型" width="90" align="center" enable="false">
<EF:EFCodeOption codeName="hpjx.hpkc.inventType" />
</EF:EFComboColumn>
<EF:EFColumn enable="false" ename="prdtCode" cname="部件编码" readonly="true"/>
<EF:EFColumn enable="false" ename="prdtName" cname="部件名称" readonly="true"/>
<EF:EFColumn hidden="true" enable="false" ename="spec" cname="规格" readonly="true"/>
<EF:EFColumn enable="false" ename="remark" cname="备注" readonly="true"/>
<EF:EFColumn ename="planCompletionDate" cname="计划完成日期" editType="date" dateFormat="yyyy/MM/dd" width="150"
required='true' readonly="true"/>
<EF:EFColumn enable="false" ename="schedule" cname="生产完工进度" format="{0:N2}" readonly="true"/>
<EF:EFComboColumn enable="false" ename="status" cname="状态">
<EF:EFOption label="未提交" value="0"/>
<EF:EFOption label="已提交" value="1"/>
</EF:EFComboColumn>
<EF:EFColumn ename="operator" cname="操作" width="100" enable="false" readonly="false"/>
</EF:EFGrid>
</EF:EFRegion>
<EF:EFRegion id="result" title="明细信息">
<EF:EFGrid blockId="detail" autoDraw="no">
<EF:EFColumn ename="id" cname="主键" hidden="true"/>
<EF:EFColumn ename="parentId" cname="父ID" hidden="true"/>
<EF:EFComboColumn ename="prdtType" cname="零件类型" width="90" align="center" readonly="true">
<EF:EFCodeOption codeName="hpjx.hpkc.inventType" />
</EF:EFComboColumn>
<EF:EFColumn enable="false" ename="prdtCode" cname="零件编码"/>
<EF:EFColumn enable="false" ename="prdtName" readonly="true" cname="零件名称"/>
<EF:EFColumn enable="false" ename="spec" cname="规格" readonly="true"/>
<EF:EFColumn enable="false" ename="remark" cname="备注" readonly="true"/>
<EF:EFColumn enable="false" ename="num" readonly="true" cname="计划数量"/>
<EF:EFColumn enable="false" ename="unitWt" readonly="true" cname="计划重量"/>
<EF:EFColumn ename="planCommentDate" required='true' cname="计划开始时间" editType="date" dateFormat="yyyy/MM/dd" width="150"/>
<EF:EFColumn ename="planCompletionDate" required='true' cname="计划结束时间" editType="date" dateFormat="yyyy/MM/dd" width="150"/>
<EF:EFColumn ename="actualCompletionDate" cname="实际完成时间" editType="date" dateFormat="yyyy/MM/dd" width="150"
enable="false"/>
<EF:EFColumn enable="false" ename="actualCompletionNum" cname="实际完工数量" readonly="true"/>
<EF:EFColumn enable="false" ename="actualCompletionUnitWt" cname="实际完工重量" readonly="true"/>
<EF:EFColumn ename="operator" cname="操作" width="100" enable="false" readonly="false"/>
</EF:EFGrid>
</EF:EFRegion>
</EF:EFPage>
<script>
var ctx = "${ctx}";
</script>
<script src="${ctx}/HP/SC/HPSC005A.js"></script>
var inventNameGlobalData = [];
// 传递参数 将附件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();
eiInfo.set("inqu_status-0-inventTypes", [3, 4]);
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;
// 重新查询EFGrid
parentId = nodeData.nodeId;
query();
},
selectTreeNode: {}
}
};
$("#QUERY").on("click", function () {
query();
});
IPLATUI.EFGrid = {
result: {
pageable: {
pageSize: 10,
pageSizes: [10, 20, 50, 100,200],
},
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 == 'update'
||e.eiInfo.extAttr.methodName == 'insert'){
query();
}
},
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;
$.each(e.items, function (index, item) {
item['projCode'] = selectTreeNode.projCode;
item['projName'] = selectTreeNode.projName;
item['parentId'] = selectTreeNode.nodeId;
item['parentPrdtName'] = selectTreeNode.prdtName;
});
},
/**
* 点击Grid保存按钮时触发的事件
* @param e 事件对象
* e.sender Grid对象
*/
onSave: function (e) {
// 不向后台保存
var tree = $("#materialTree").data("kendoTreeView");
var inInfo = new EiInfo();
EiCommunicator.send("HPSC006", "queryTreeNode", inInfo, {//传入参数
onSuccess: function (inInfo) {
tree.reload("root");//更新树
}
});
},
/**
* 点击Grid删除按钮时触发的事件
* @param e 事件对象
* e.sender Grid对象
*/
onDelete: function (e) {
// 不向后台保存
console.log(e)
var tree = $("#materialTree").data("kendoTreeView");
var inInfo = new EiInfo();
EiCommunicator.send("HPSC006", "queryTreeNode", inInfo, {//传入参数
onSuccess: function (inInfo) {
tree.reload("root");//更新树
}
});
},
toolbarConfig: {
hidden: false, // true时,不显示功能按钮,但保留setting导出按钮
// add: false, // 不显示新增按钮
// cancel: false, // 不显示取消按钮
// save: false, // 不显示保存按钮
delete: true, // 显示删除按钮
},
columns: [
{
field: "operator",
template: function (item) {
console.log(item)
let auditStatus = item.status;
let lv = item.lv
let template = '';
// template += '<a style="cursor: pointer;display: inline-flex;justify-content: center;margin:auto 5px" '
// + 'onclick="openUploadFile(' + item.id + ',1)" >附件上传</a>';
template += '<a style="cursor: pointer;display: inline-flex;justify-content: center;margin:auto 5px" '
+ 'onclick="showUploadFile(' + item.id + ')" >附件清单</a>';
if (lv === '3') {
if (auditStatus == 0) {
template += '<a style="cursor: pointer;display: inline-flex;justify-content: center;margin:auto 5px" ' +
'onclick="check(' + item.id + ',1)" >提交</a>';
} else {
template += '<a style="cursor: pointer;display: inline-flex;justify-content: center;margin:auto 5px" ' +
'onclick="check(' + item.id + ',0)" >撤回</a>';
}
}
return template;
}
},{
field: "prdtName",
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;
}
}, {
field: "parentPrdtName",
template: function (dataItem) {
if(dataItem.lv > 2){
return dataItem['parentPrdtName'];
}
return "";
}
}
// {
// field: "inventRecordId",
// template: function (dataItem) {
// for (let i = 0; i < inventNameGlobalData.length; i++) {
// if (inventNameGlobalData[i]['valueField'] === dataItem['inventRecordId']) {
// return inventNameGlobalData[i]['textField']+'-'+inventNameGlobalData[i]['param1Field'];
// }
// }
// return "";
// },
// 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();
// eiInfo.set("inqu_status-0-inventTypes", [3, 4]);
// eiInfo.set("inqu_status-0-inventType", options.model["prdtType"]);
// 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});
// input.kendoDropDownList({
// valuePrimitive: true,
// dataTextField: "textField",
// dataParam1Field: "param1Field",
// dataValueField: "valueField",
// dataSource: dataSource,
// template: "#=textField#-#=param1Field#"
// });
// }
// }
],
loadComplete: function (grid) {
// 此grid对象
// grid.dataSource.bind("change", function(e) {
// if (e.field == "inventRecordId") {
// var tr,index;
// // 获取此model元素信息
// var item = e.items[0];
// for (let i = 0; i < inventNameGlobalData.length; i++) {
// if (inventNameGlobalData[i]['valueField'] === item.inventRecordId) {
// resultGrid.setCellValue(item, 'prdtCode', inventNameGlobalData[i]['textField'])
// }
// }
// }
// });
}
},
};
// 关闭事件
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('HPSC006', '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);
}
function openUploadFile(id) {
uploadFileWindow.open().center();
// rowId = id;
}
/**
* 显示附件清单
*
* @param id
*/
function showUploadFile(id) {
JSColorbox.open({
href: "HPSC006A?methodName=initLoad&inqu_status-0-id=" + id,
title: "<div style='text-align: center;'>附件清单</div>",
width: "80%",
height: "80%",
});
}
function check(id, auditStatus) {
const inEiInfo = new EiInfo();
inEiInfo.set("result-0-id", id);
inEiInfo.set("result-0-status", auditStatus);
EiCommunicator.send('HPSC006', 'check', inEiInfo, {
onSuccess(response) {
NotificationUtil(response.msg);
query();
},
onFail(errorMessage, status, e) {
NotificationUtil("执行失败!", "error");
}
},
{
async: false
}
);
}
<!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 ename="inqu_status-0-prdtType" cname="部件类型" colWidth="3" filter="contains"
template="#=textField#" valueTemplate="#=textField#">
<EF:EFOption label="全部" value=""/>
<EF:EFCodeOption codeName="hpjx.hpkc.inventType" condition="ITEM_CODE IN ('3','4')"/>
</EF:EFSelect>
<EF:EFSelect cname="部件名称" ename="inqu_status-0-prdtCode" filter="contains" defultValue="">
<EF:EFOption label="全部" value=""/>
<EF:EFOptions blockId="invent_name_block_id" textField="textField" valueField="valueField"/>
</EF:EFSelect>
<EF:EFSelect cname="状态" optionLabel="全部" ename="inqu_status-0-status" colWidth="3">
<EF:EFOption label="未提交" value="0"/>
<EF:EFOption label="已提交" value="1"/>
</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="HPSC006"
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="no" checkMode="single">
<EF:EFColumn ename="id" cname="主键" hidden="true"/>
<EF:EFColumn ename="level" cname="层级" hidden="true"/>
<EF:EFColumn enable="false" ename="projCode" cname="项目编码"/>
<EF:EFColumn enable="false" ename="projName" cname="项目名称"/>
<EF:EFComboColumn cname="部件类型" ename="prdtType" width="90" align="center" required="true">
<EF:EFCodeOption codeName="hpjx.hpkc.inventType" condition="ITEM_CODE IN ('3','4')"/>
</EF:EFComboColumn>
<EF:EFPopupColumn ename="prdtName" cname="部件名称" width="200" popupType="ServiceGrid"
popupTitle="部件信息" serviceName="HPPZ006" methodName="queryPrdtComboBox" resultId="invent_prdt_name_block_id"
columnEnames="param1Field,textField"
columnCnames="部件名称,部件编码"
backFillColumnIds="param1Field,textField"
backFillFieldIds="prdtName,prdtCode"
valueField="param1Field" textField="param1Field"/>
<EF:EFColumn ename="prdtCode" cname="部件编码"/>
<EF:EFColumn ename="length" cname="长" format="{0:N3}"/>
<EF:EFColumn ename="width" cname="宽" format="{0:N3}"/>
<EF:EFColumn ename="thick" cname="厚" format="{0:N3}"/>
<EF:EFColumn ename="remark" cname="备注" />
<EF:EFColumn enable="false" ename="parentId" hidden="true" cname="上级部件名称"/>
<EF:EFColumn enable="false" ename="parentPrdtName" cname="上级部件名称"/>
<EF:EFColumn ename="num" required="true" cname="数量"/>
<EF:EFColumn ename="unitWt" required="true" format="{0:N3}" cname="单重"/>
<EF:EFColumn enable="false" format="{0:N3}" ename="totalWt" cname="总重"/>
<EF:EFComboColumn enable="false" ename="status" align="center"
columnTemplate="#=textField#" optionLabel=" "
itemTemplate="#=textField#" textField="textField"
valueField="valueField" cname="提交状态">
<EF:EFOption label="未提交" value="0"></EF:EFOption>
<EF:EFOption label="已提交" value="1"></EF:EFOption>
</EF:EFComboColumn>
<EF:EFColumn ename="operator" cname="操作" width="200" enable="false" readonly="false"/>
</EF:EFGrid>
</EF:EFRegion>
</div>
</div>
<%-- EEDM8010页面加载时,不会加载EEDM6000 (lazyload="true") --%>
<EF:EFWindow id="uploadFile" url="${ctx}/web/HPSC099" lazyload="true" refresh="true">
</EF:EFWindow>
</EF:EFPage>
<script>
let ctx="${ctx}";
</script>
<script src="${ctx}/HP/SC/HPSC006.js"></script>
\ No newline at end of file
...@@ -15,8 +15,10 @@ $(function () { ...@@ -15,8 +15,10 @@ $(function () {
{ {
field: "operator", field: "operator",
template: function (item) { template: function (item) {
let template = '<a style="cursor: pointer;display: inline-flex;justify-content: center;" ' + let template = '<a style="cursor: pointer;display: inline-flex;justify-content: center;margin:auto 5px" ' +
'onclick="jump(' + item.id + ')" >物料清单</a>'; 'onclick="jump(' + item.id + ')" >物料清单</a>';
template += '<a style="cursor: pointer;display: inline-flex;justify-content: center;margin:auto 5px" ' +
'onclick="jump2(' + item.id + ')" >下料清单</a>';
return template; return template;
} }
} }
...@@ -28,3 +30,8 @@ function jump(id) { ...@@ -28,3 +30,8 @@ function jump(id) {
var herf= ctx + "\\web\\"+ "HPSC002?inqu_status-0-projId=" + id; var herf= ctx + "\\web\\"+ "HPSC002?inqu_status-0-projId=" + id;
window.open(herf); window.open(herf);
} }
function jump2(id) {
var herf= ctx + "\\web\\"+ "HPSC006?inqu_status-0-projId=" + id;
window.open(herf);
}
$(function () { $(function () {
$("#QUERY").on("click", function () { // 查询
resultGrid.dataSource.page(1); $("#QUERY").on("click", query);
});
IPLATUI.EFGrid = { IPLATUI.EFGrid = {
"result": { "result": {
pageable: { pageable: {
...@@ -24,13 +23,21 @@ $(function () { ...@@ -24,13 +23,21 @@ $(function () {
let row = rows[0]; let row = rows[0];
let isInput= decodeURI(window.location.href.split("&")[1]); let isInput= decodeURI(window.location.href.split("&")[1]);
if(isInput==="isInput"){ if(isInput==="isInput"){
parent.JSColorbox.setValueCallback(row.orgId); parent.JSColorbox.setValueCallback(row.id);
return; return;
}; };
JSUtils.confirm("确定分派? ", { JSUtils.confirm("确定分派? ", {
ok: function () { ok: function () {
parent.JSColorbox.setValueCallback(row.orgId); parent.JSColorbox.setValueCallback(row.id);
} }
}); });
}); });
}); });
$(window).load(function () {
// 查询
query();
});
let query = function () {
resultGrid.dataSource.page(1);
}
\ No newline at end of file
...@@ -8,16 +8,24 @@ ...@@ -8,16 +8,24 @@
<EF:EFPage title="组织机构"> <EF:EFPage title="组织机构">
<EF:EFRegion id="inqu" title="查询条件"> <EF:EFRegion id="inqu" title="查询条件">
<div class="row"> <div class="row">
<EF:EFInput ename="factoryCname" cname="厂区名称" blockId="inqu_status" row="0"/> <EF:EFInput cname="厂区名称:" ename="factoryName" blockId="inqu_status" row="0" colWidth="3"/>
<EF:EFInput ename="groupName" cname="组织名称" blockId="inqu_status" row="0"/> <EF:EFSelect cname="生产组名称" ename="groupCode" blockId="inqu_status" row="0" colWidth="3" filter="contains">
<EF:EFOption label="全部" value=""/>
<EF:EFOptions blockId="group_record_block_id" textField="textField" valueField="valueField"/>
</EF:EFSelect>
</div> </div>
</EF:EFRegion> </EF:EFRegion>
<EF:EFRegion id="result" title="明细信息"> <EF:EFRegion id="result" title="明细信息">
<EF:EFGrid blockId="result" autoDraw="override" isFloat="true" checkMode="single,row"> <EF:EFGrid blockId="result" autoDraw="override" isFloat="true" checkMode="single,row">
<EF:EFColumn ename="orgId" cname="内码" hidden="true"/> <EF:EFColumn ename="id" cname="内码" hidden="true"/>
<EF:EFColumn ename="orgEname" cname="组织编码" enable="false" width="130" align="center"/> <EF:EFColumn ename="factoryCode" cname="厂区编码" enable="false" width="120" align="center"/>
<EF:EFColumn ename="orgCname" cname="组织名称" enable="false" width="130" align="center"/> <EF:EFPopupColumn ename="factoryName" cname="厂区名称" enable="false" width="120" align="center"/>
<EF:EFComboColumn ename="groupCode" cname="生产组名称" width="120" align="center"
blockName="org_record_block_id" textField="textField" valueField="valueField"
columnTemplate="#=textField#" itemTemplate="#=textField#"
required="true">
</EF:EFComboColumn>
</EF:EFGrid> </EF:EFGrid>
</EF:EFRegion> </EF:EFRegion>
</EF:EFPage> </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