Commit 81a56784 by liuyang

2024-08-14 物料清单导入模板添加项目字母缩写、项目名称缩写和功能调整调整

parent 283c28b5
......@@ -261,7 +261,7 @@
</delete>
<update id="deleteFlag">
UPDATE ${hggpSchema}.HGSB005
UPDATE ${hggpSchema}.HGSB005A
SET
UPDATED_BY = #updatedBy#, <!-- 修改人 -->
UPDATED_NAME = #updatedName#, <!-- 修改人名称 -->
......
......@@ -61,6 +61,8 @@ public class HGSC004A extends DaoEPBase {
public static final String FIELD_MATERIAL = "material"; /* 材质*/
public static final String FIELD_COEFFICIENT = "coefficient"; /* 系数*/
public static final String FIELD_UNIT = "unit"; /* 单位*/
public static final String FIELD_proj_code_prefix = "projCodePrefix"; /* 项目编码前缀*/
public static final String FIELD_proj_name_prefix = "projNamePrefix"; /* 项目名称前缀*/
public static final String COL_id = "id"; /* 主键*/
public static final String COL_company_code = "company_code"; /* 公司编码(预留)*/
......@@ -167,6 +169,10 @@ public class HGSC004A extends DaoEPBase {
private Long techFlowId = new Long(0); /* 工艺流程id*/
private String finishDate = " "; /* 完工日期*/
@ExcelAnno(index = 14)
private String projCodePrefix = " "; /*项目前缀*/
@ExcelAnno(index = 15)
private String projNamePrefix = " ";
/**
* initialize the metadata.
*/
......@@ -382,6 +388,18 @@ public class HGSC004A extends DaoEPBase {
eiColumn = new EiColumn(FIELD_UNIT);
eiColumn.setDescName("单位");
eiMetadata.addMeta(eiColumn);
eiColumn = new EiColumn(FIELD_proj_code_prefix);
eiColumn.setDescName("项目前缀");
eiMetadata.addMeta(eiColumn);
eiColumn = new EiColumn(FIELD_proj_code_prefix);
eiColumn.setDescName("项目字母缩写");
eiMetadata.addMeta(eiColumn);
eiColumn = new EiColumn(FIELD_proj_name_prefix);
eiColumn.setDescName("项目名称缩写");
eiMetadata.addMeta(eiColumn);
}
/**
......@@ -911,6 +929,35 @@ public class HGSC004A extends DaoEPBase {
public void setUnit(String unit) {
this.unit = unit;
}
/**
* get the projCodePrefix - 项目字母前缀.
* @return the projCodePrefix
*/
public String getProjCodePrefix() {
return projCodePrefix;
}
/**
* set the projCodePrefix - 项目字母前缀.
*
* @param projCodePrefix - 项目字母前缀
*/
public void setProjCodePrefix(String projCodePrefix) {
this.projCodePrefix = projCodePrefix;
}
/**
* get the projCodePrefix - 项目名称前缀.
* @return the projCodePrefix
*/
public String getProjNamePrefix() {
return projNamePrefix;
}
/**
* set the projNamePrefix - 项目名称前缀.
* @return the projNamePrefix
*/
public void setProjNamePrefix(String projNamePrefix) {
this.projNamePrefix = projNamePrefix;
}
/**
* get the value from Map.
......@@ -958,6 +1005,8 @@ public class HGSC004A extends DaoEPBase {
setMaterial(StringUtils.defaultIfEmpty(StringUtils.toString(map.get(FIELD_MATERIAL)), material));
setCoefficient(NumberUtils.toBigDecimal(StringUtils.toString(map.get(FIELD_COEFFICIENT)), coefficient));
setUnit(StringUtils.defaultIfEmpty(StringUtils.toString(map.get(FIELD_UNIT)), unit));
setProjCodePrefix(StringUtils.defaultIfEmpty(StringUtils.toString(map.get(FIELD_proj_code_prefix)), projCodePrefix));
setProjNamePrefix(StringUtils.defaultIfEmpty(StringUtils.toString(map.get(FIELD_proj_name_prefix)), projNamePrefix));
}
/**
......@@ -1005,6 +1054,8 @@ public class HGSC004A extends DaoEPBase {
map.put(FIELD_MATERIAL, StringUtils.toString(material, eiMetadata.getMeta(FIELD_MATERIAL)));
map.put(FIELD_COEFFICIENT, StringUtils.toString(coefficient, eiMetadata.getMeta(FIELD_COEFFICIENT)));
map.put(FIELD_UNIT, StringUtils.toString(unit, eiMetadata.getMeta(FIELD_UNIT)));
map.put(FIELD_proj_code_prefix, StringUtils.toString(projCodePrefix, eiMetadata.getMeta(FIELD_proj_code_prefix)));
map.put(FIELD_proj_name_prefix, StringUtils.toString(projNamePrefix, eiMetadata.getMeta(FIELD_proj_name_prefix)));
return map;
}
}
......@@ -331,6 +331,8 @@ public class HGSCTools {
hgsc004a.setCompanyName(results.get(0).getCompanyName());
hgsc004a.setDepCode(results.get(0).getDepCode());
hgsc004a.setDepName(results.get(0).getDepName());
hgsc004a.setProductCode(hgsc004a.getProjCodePrefix().trim().concat(hgsc004a.getProductCode()));
hgsc004a.setProductName(hgsc004a.getProjNamePrefix().trim().concat(hgsc004a.getProductName()));
if (hgsc004a.getParentProdCode().trim().isEmpty()){
hgsc004a.setParentProdCode(results.get(0).getProjCode());
hgsc004a.setParentProdName(results.get(0).getProjName());
......@@ -341,11 +343,13 @@ public class HGSCTools {
paramMap.put("companyCode", hgsc004a.getCompanyCode());
paramMap.put("projCode", hgsc004a.getProjCode());
paramMap.put("lv", 3);
paramMap.put("productCode", hgsc004a.getParentProdCode());
paramMap.put("productCode", hgsc004a.getProjCodePrefix().trim().concat(hgsc004a.getParentProdCode()));
List<HGSC004A> hgsc004aList = list(paramMap);
AssertUtils.isEmpty(hgsc004aList, String.format("父节点-产品编号[%s]数据不存在,导入失败!",hgsc004a.getParentProdCode()));
AssertUtils.isEmpty(hgsc004aList, String.format("父节点-产品编号[%s]数据不存在,导入失败!",hgsc004a.getProjCodePrefix().trim().concat(hgsc004a.getParentProdCode())));
hgsc004a.setMaterialId(results.get(0).getId());
hgsc004a.setLv(4);
hgsc004a.setParentProdCode(hgsc004a.getProjCodePrefix().trim().concat(hgsc004a.getParentProdCode()));
hgsc004a.setParentProdName(hgsc004a.getProjNamePrefix().trim().concat(hgsc004a.getParentProdName()));
}
checkSaveData(hgsc004a);
addEntity(hgsc004a);
......
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