Commit c047f37a by 宋祥

1.fixBug:厂区名称修改时重新新增一条记录

parent d423d2ab
...@@ -81,16 +81,17 @@ public class ServiceHPPZ011 extends ServiceBase { ...@@ -81,16 +81,17 @@ public class ServiceHPPZ011 extends ServiceBase {
for (Map resultRow : resultRows) { for (Map resultRow : resultRows) {
HPPZ011 fPz011 = new HPPZ011(); HPPZ011 fPz011 = new HPPZ011();
fPz011.fromMap(resultRow); fPz011.fromMap(resultRow);
// 设置生产组名称
fPz011.setGroupName(HPXSTools.XsOrg.get(fPz011.getGroupCode()).getOrgCname());
// 校验厂区名是否存在 // 校验厂区名是否存在
HPPZ011 dbPz011 = HPPZTools.HpPz011.getByName(fPz011.getFactoryName()); HPPZ011 dbPz011 = HPPZTools.HpPz011.getByName(fPz011.getFactoryName());
if (dbPz011 != null) { if (dbPz011 != null) {
fPz011.setFactoryCode(dbPz011.getFactoryCode()); fPz011.setFactoryCode(dbPz011.getFactoryCode());
} else { } else {
// 生成厂区编码 // 生成厂区编码,同时新增记录
fPz011.setFactoryCode(SequenceGenerator.getNextSequence(HPConstant.SequenceId.FACTORY_CODE)); fPz011.setFactoryCode(SequenceGenerator.getNextSequence(HPConstant.SequenceId.FACTORY_CODE));
fPz011.setId(null);
} }
// 设置生产组名称
fPz011.setGroupName(HPXSTools.XsOrg.get(fPz011.getGroupCode()).getOrgCname());
if (fPz011.getId() == null || fPz011.getId() == 0) { if (fPz011.getId() == null || fPz011.getId() == 0) {
this.add(fPz011); this.add(fPz011);
} else { } else {
......
...@@ -63,7 +63,7 @@ ...@@ -63,7 +63,7 @@
<sql id="order"> <sql id="order">
<dynamic prepend="ORDER BY"> <dynamic prepend="ORDER BY">
<isNotEmpty property="order"> <isNotEmpty property="order">
$orderBy$ $order$
</isNotEmpty> </isNotEmpty>
<isEmpty property="order"> <isEmpty property="order">
A.ID ASC A.ID ASC
......
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