Commit 7e930d83 by liuyang

2024-05-23 优化存货类型改完手动编辑

parent cef2cc71
......@@ -76,7 +76,7 @@ public class HGPZ004 extends DaoEPBase {
private String updatedName = " "; /* 更新人名称*/
private String updatedTime = " "; /* 更新时间*/
private Integer deleteFlag = 0; /* 是否删除0.否1.是*/
private Integer inventTypeDetail = 0; /*存货类型明细 1:构建 2:零件*/
private String inventTypeDetail; /*存货类型明细 1:构建 2:零件*/
/**
* initialize the metadata.
......@@ -400,11 +400,11 @@ public class HGPZ004 extends DaoEPBase {
this.deleteFlag = deleteFlag;
}
public Integer getInventTypeDetail() {
public String getInventTypeDetail() {
return inventTypeDetail;
}
public void setInventTypeDetail(Integer inventTypeDetail) {
public void setInventTypeDetail(String inventTypeDetail) {
this.inventTypeDetail = inventTypeDetail;
}
......@@ -431,7 +431,7 @@ public class HGPZ004 extends DaoEPBase {
setUpdatedName(StringUtils.defaultIfEmpty(StringUtils.toString(map.get(FIELD_UPDATED_NAME)), updatedName));
setUpdatedTime(StringUtils.defaultIfEmpty(StringUtils.toString(map.get(FIELD_UPDATED_TIME)), updatedTime));
setDeleteFlag(NumberUtils.toInteger(StringUtils.toString(map.get(FIELD_DELETE_FLAG)), deleteFlag));
setInventTypeDetail(NumberUtils.toInteger(StringUtils.toString(map.get(FIELD_INVENT_TYPE_DETAIL)), inventTypeDetail));
setInventTypeDetail(StringUtils.defaultIfEmpty(StringUtils.toString(map.get(FIELD_INVENT_TYPE_DETAIL)), inventTypeDetail));
}
/**
......
......@@ -78,16 +78,16 @@ public class ServiceHGPZ004 extends ServiceBase {
// 数据校验
this.checkSaveData(resultRows);
// 写入数据
for (int i = 0; i < resultRows.size(); i++) {
for (Map resultRow : resultRows) {
HGPZ004 hgpz004 = new HGPZ004();
hgpz004.fromMap(resultRows.get(i));
hgpz004.fromMap(resultRow);
if (hgpz004.getId() == null || hgpz004.getId() == 0) {
dataValida(hgpz004);
this.add(hgpz004);
} else {
this.modify(hgpz004);
}
}
inInfo = this.query(inInfo);
inInfo.setStatus(EiConstant.STATUS_DEFAULT);
inInfo.setMsg("操作成功!本次对[" + resultRows.size() + "]条数据保存成功!");
} catch (Exception e) {
......@@ -117,7 +117,8 @@ public class ServiceHGPZ004 extends ServiceBase {
* @throws Exception
*/
private void add(HGPZ004 hgpz004) throws Exception {
hgpz004.setInventType(SequenceGenerator.getNextSequence(HGConstant.SequenceId.INVENT_TYPE));
//hgpz004.setInventType(SequenceGenerator.getNextSequence(HGConstant.SequenceId.INVENT_TYPE));
DaoUtils.insert(HGPZ004.INSERT, hgpz004);
}
......@@ -233,5 +234,11 @@ public class ServiceHGPZ004 extends ServiceBase {
}
public void dataValida(HGPZ004 hgpz004){
Map map = new HashMap();
map.put(HGPZ004.FIELD_INVENT_TYPE,hgpz004.getInventType());
List list = this.dao.query(HGPZ004.QUERY,map);
AssertUtils.isNotEmpty(list, String.format("存货类型[%s]已经存在,添加失败",hgpz004.getInventType()));
}
}
......@@ -30,7 +30,7 @@ $(function() {
inInfo.set("field", options.field);
refreshSelect(container, inInfo);
}
},{
}, {
field: "createdName",
template: function (options) {
return showUserName(options.createdBy, options.createdName);
......@@ -103,6 +103,7 @@ let save = function () {
let flag = true;
$.each(rows, function(index, item) {
let parInventType= item.get("parInventType");
let inventType= item.get("inventType");
let inventTypeName= item.get("inventTypeName");
let status= item.get("status");
if(isBlank(parInventType)){
......@@ -110,6 +111,11 @@ let save = function () {
flag = false;
return false;
}
if(isBlank(inventType)){
message("选中的第"+(index+1)+"行\"存货类型\",不能为空!");
flag = false;
return false;
}
if(isBlank(inventTypeName)){
message("选中的第"+(index+1)+"行\"存货类型\",不能为空!");
flag = false;
......
......@@ -18,9 +18,9 @@
<EF:EFRegion id="result" title="记录集">
<EF:EFGrid blockId="result" autoDraw="override" isFloat="true">
<EF:EFColumn ename="id" cname="主键" hidden="true"/>
<EF:EFColumn cname="类型编码" ename="inventType" enable="false" width="120" align="center"/>
<EF:EFColumn cname="类型编码" ename="inventType" enable="true" width="120" readonly="true" align="center"/>
<EF:EFColumn cname="存货类型" ename="inventTypeName" width="140" align="center" required="true"/>
<EF:EFComboColumn ename="inventTypeDetail" cname="存货类型明细" width="80" align="center" readonly="false" required="true">
<EF:EFComboColumn ename="inventTypeDetail" cname="存货类型明细" width="80" align="center" readonly="false">
<EF:EFCodeOption codeName="hggp.hgpz.inventTypeDetail"/>
</EF:EFComboColumn>
<EF:EFColumn cname="上级名称" ename="parInventType" width="80" align="center" required="true"/>
......
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