Commit 22269ad8 by 宋祥

1.fixBug:拆单导致生产订单串数据问题修复

parent 67b0d320
......@@ -15,12 +15,12 @@ import com.baosight.iplat4j.core.util.StringUtils;
* Copyrigth:Baosight Software LTD.co Copyright (c) 2019. <br>
*
* @version 1.0
* @history 2024-01-22 14:36:36 create
* @history 2024-02-06 15:01:45 create
*/
public class HPPZ004 extends DaoEPBase {
private static final long serialVersionUID = 1L;
public static final String FIELD_ID = "id";
public static final String FIELD_COMPANY_CODE = "companyCode"; /* 企业编码 预留*/
public static final String FIELD_DEP_CODE = "depCode"; /* 部门编码*/
......@@ -34,7 +34,8 @@ public class HPPZ004 extends DaoEPBase {
public static final String FIELD_UPDATED_BY = "updatedBy"; /* 更新人*/
public static final String FIELD_UPDATED_NAME = "updatedName"; /* 更新人名称*/
public static final String FIELD_UPDATED_TIME = "updatedTime"; /* 更新时间*/
public static final String FIELD_DELETE_FLAG = "deleteFlag"; /* 是否删除0.否1.是*/
public static final String COL_ID = "ID";
public static final String COL_COMPANY_CODE = "COMPANY_CODE"; /* 企业编码 预留*/
public static final String COL_DEP_CODE = "DEP_CODE"; /* 部门编码*/
......@@ -48,96 +49,102 @@ public class HPPZ004 extends DaoEPBase {
public static final String COL_UPDATED_BY = "UPDATED_BY"; /* 更新人*/
public static final String COL_UPDATED_NAME = "UPDATED_NAME"; /* 更新人名称*/
public static final String COL_UPDATED_TIME = "UPDATED_TIME"; /* 更新时间*/
public static final String COL_DELETE_FLAG = "DELETE_FLAG"; /* 是否删除0.否1.是*/
public static final String QUERY = "HPPZ004.query";
public static final String COUNT = "HPPZ004.count";
public static final String INSERT = "HPPZ004.insert";
public static final String UPDATE = "HPPZ004.update";
public static final String DELETE = "HPPZ004.delete";
private Long id = null;
private Long id;
private String companyCode = " "; /* 企业编码 预留*/
private String depCode = " "; /* 部门编码*/
private Integer inventType = null; /* 存货类型*/
private Integer inventType; /* 存货类型*/
private String inventCode = " "; /* 存货编码*/
private String inventName = " "; /* 存货名称*/
private Integer status = 1; /* 状态 0未启用 1启用*/
private Integer status; /* 状态 0未启用 1启用*/
private String createdBy = " "; /* 创建人*/
private String createdName = " "; /* 创建人名称*/
private String createdTime = " "; /* 创建时间*/
private String updatedBy = " "; /* 更新人*/
private String updatedName = " "; /* 更新人名称*/
private String updatedTime = " "; /* 更新时间*/
private Integer deleteFlag; /* 是否删除0.否1.是*/
/**
* 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_COMPANY_CODE);
eiColumn.setDescName("企业编码 预留");
eiMetadata.addMeta(eiColumn);
eiColumn = new EiColumn(FIELD_DEP_CODE);
eiColumn.setDescName("部门编码");
eiMetadata.addMeta(eiColumn);
eiColumn = new EiColumn(FIELD_INVENT_TYPE);
eiColumn.setDescName("存货类型");
eiMetadata.addMeta(eiColumn);
eiColumn = new EiColumn(FIELD_INVENT_CODE);
eiColumn.setDescName("存货编码");
eiMetadata.addMeta(eiColumn);
eiColumn = new EiColumn(FIELD_INVENT_NAME);
eiColumn.setDescName("存货名称");
eiMetadata.addMeta(eiColumn);
eiColumn = new EiColumn(FIELD_STATUS);
eiColumn.setDescName("状态 0未启用 1启用");
eiMetadata.addMeta(eiColumn);
eiColumn = new EiColumn(FIELD_CREATED_BY);
eiColumn.setDescName("创建人");
eiMetadata.addMeta(eiColumn);
eiColumn = new EiColumn(FIELD_CREATED_NAME);
eiColumn.setDescName("创建人名称");
eiMetadata.addMeta(eiColumn);
eiColumn = new EiColumn(FIELD_CREATED_TIME);
eiColumn.setDescName("创建时间");
eiMetadata.addMeta(eiColumn);
eiColumn = new EiColumn(FIELD_UPDATED_BY);
eiColumn.setDescName("更新人");
eiMetadata.addMeta(eiColumn);
eiColumn = new EiColumn(FIELD_UPDATED_NAME);
eiColumn.setDescName("更新人名称");
eiMetadata.addMeta(eiColumn);
eiColumn = new EiColumn(FIELD_UPDATED_TIME);
eiColumn.setDescName("更新时间");
eiMetadata.addMeta(eiColumn);
eiColumn = new EiColumn(FIELD_DELETE_FLAG);
eiColumn.setDescName("是否删除0.否1.是");
eiMetadata.addMeta(eiColumn);
}
/**
* the constructor.
*/
public HPPZ004() {
initMetaData();
}
/**
* get the id .
* @return the id
......@@ -145,7 +152,7 @@ public class HPPZ004 extends DaoEPBase {
public Long getId() {
return this.id;
}
/**
* set the id .
*
......@@ -161,7 +168,7 @@ public class HPPZ004 extends DaoEPBase {
public String getCompanyCode() {
return this.companyCode;
}
/**
* set the companyCode - 企业编码 预留.
*
......@@ -177,7 +184,7 @@ public class HPPZ004 extends DaoEPBase {
public String getDepCode() {
return this.depCode;
}
/**
* set the depCode - 部门编码.
*
......@@ -193,7 +200,7 @@ public class HPPZ004 extends DaoEPBase {
public Integer getInventType() {
return this.inventType;
}
/**
* set the inventType - 存货类型.
*
......@@ -209,7 +216,7 @@ public class HPPZ004 extends DaoEPBase {
public String getInventCode() {
return this.inventCode;
}
/**
* set the inventCode - 存货编码.
*
......@@ -225,7 +232,7 @@ public class HPPZ004 extends DaoEPBase {
public String getInventName() {
return this.inventName;
}
/**
* set the inventName - 存货名称.
*
......@@ -241,7 +248,7 @@ public class HPPZ004 extends DaoEPBase {
public Integer getStatus() {
return this.status;
}
/**
* set the status - 状态 0未启用 1启用.
*
......@@ -257,7 +264,7 @@ public class HPPZ004 extends DaoEPBase {
public String getCreatedBy() {
return this.createdBy;
}
/**
* set the createdBy - 创建人.
*
......@@ -273,7 +280,7 @@ public class HPPZ004 extends DaoEPBase {
public String getCreatedName() {
return this.createdName;
}
/**
* set the createdName - 创建人名称.
*
......@@ -289,7 +296,7 @@ public class HPPZ004 extends DaoEPBase {
public String getCreatedTime() {
return this.createdTime;
}
/**
* set the createdTime - 创建时间.
*
......@@ -305,7 +312,7 @@ public class HPPZ004 extends DaoEPBase {
public String getUpdatedBy() {
return this.updatedBy;
}
/**
* set the updatedBy - 更新人.
*
......@@ -321,7 +328,7 @@ public class HPPZ004 extends DaoEPBase {
public String getUpdatedName() {
return this.updatedName;
}
/**
* set the updatedName - 更新人名称.
*
......@@ -337,7 +344,7 @@ public class HPPZ004 extends DaoEPBase {
public String getUpdatedTime() {
return this.updatedTime;
}
/**
* set the updatedTime - 更新时间.
*
......@@ -347,13 +354,29 @@ public class HPPZ004 extends DaoEPBase {
this.updatedTime = updatedTime;
}
/**
* get the deleteFlag - 是否删除0.否1.是.
* @return the deleteFlag
*/
public Integer getDeleteFlag() {
return this.deleteFlag;
}
/**
* set the deleteFlag - 是否删除0.否1.是.
*
* @param deleteFlag - 是否删除0.否1.是
*/
public void setDeleteFlag(Integer deleteFlag) {
this.deleteFlag = deleteFlag;
}
/**
* get the value from Map.
*
* @param map - source data map
*/
@Override
public void fromMap(Map map) {
setId(NumberUtils.toLong(StringUtils.toString(map.get(FIELD_ID)), id));
setCompanyCode(StringUtils.defaultIfEmpty(StringUtils.toString(map.get(FIELD_COMPANY_CODE)), companyCode));
setDepCode(StringUtils.defaultIfEmpty(StringUtils.toString(map.get(FIELD_DEP_CODE)), depCode));
......@@ -367,14 +390,15 @@ public class HPPZ004 extends DaoEPBase {
setUpdatedBy(StringUtils.defaultIfEmpty(StringUtils.toString(map.get(FIELD_UPDATED_BY)), updatedBy));
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));
}
/**
* set the value to Map.
*/
@Override
public Map toMap() {
Map map = new HashMap();
map.put(FIELD_ID, StringUtils.toString(id, eiMetadata.getMeta(FIELD_ID)));
map.put(FIELD_COMPANY_CODE, StringUtils.toString(companyCode, eiMetadata.getMeta(FIELD_COMPANY_CODE)));
......@@ -389,7 +413,8 @@ public class HPPZ004 extends DaoEPBase {
map.put(FIELD_UPDATED_BY, StringUtils.toString(updatedBy, eiMetadata.getMeta(FIELD_UPDATED_BY)));
map.put(FIELD_UPDATED_NAME, StringUtils.toString(updatedName, eiMetadata.getMeta(FIELD_UPDATED_NAME)));
map.put(FIELD_UPDATED_TIME, StringUtils.toString(updatedTime, eiMetadata.getMeta(FIELD_UPDATED_TIME)));
map.put(FIELD_DELETE_FLAG, StringUtils.toString(deleteFlag, eiMetadata.getMeta(FIELD_DELETE_FLAG)));
return map;
}
}
......@@ -15,7 +15,8 @@
CREATED_TIME as "createdTime", <!-- 创建时间 -->
UPDATED_BY as "updatedBy", <!-- 更新人 -->
UPDATED_NAME as "updatedName", <!-- 更新人名称 -->
UPDATED_TIME as "updatedTime" <!-- 更新时间 -->
UPDATED_TIME as "updatedTime", <!-- 更新时间 -->
DELETE_FLAG as "deleteFlag" <!-- 更新时间 -->
</sql>
<sql id="condition">
......@@ -54,10 +55,10 @@
<sql id="order">
<dynamic prepend="ORDER BY">
<isNotEmpty property="orderBy">
<isNotEmpty property="order">
$orderBy$
</isNotEmpty>
<isEmpty property="orderBy">
<isEmpty property="order">
ID DESC
</isEmpty>
</dynamic>
......
......@@ -110,7 +110,7 @@ public class ServiceHPSC005A extends ServiceBase {
}
inInfo = this.query(inInfo);
// 刷新主订单信息
inInfo = this.refreshOrderInfo(inInfo);
inInfo = this.refreshOrderInfo(inInfo, prodOrderNo);
inInfo.setStatus(EiConstant.STATUS_DEFAULT);
inInfo.setMsg("操作成功!本次对[" + resultRows.size() + "]条数据操作成功!");
} catch (Exception e) {
......@@ -167,6 +167,8 @@ public class ServiceHPSC005A extends ServiceBase {
*/
public EiInfo delete(EiInfo inInfo) {
try {
Map detailMap = EiInfoUtils.getFirstRow(inInfo, "detail");
String prodOrderNo = MapUtils.getString(detailMap, "productionOrderNo");
List<Map> resultRows = inInfo.getBlock(EiConstant.resultBlock).getRows();
for (Map resultRow : resultRows) {
HPSC005A fSc005a = new HPSC005A();
......@@ -181,7 +183,7 @@ public class ServiceHPSC005A extends ServiceBase {
}
inInfo = this.query(inInfo);
// 刷新主订单信息
inInfo = this.refreshOrderInfo(inInfo);
inInfo = this.refreshOrderInfo(inInfo, prodOrderNo);
inInfo.setStatus(EiConstant.STATUS_DEFAULT);
inInfo.setMsg("操作成功!本次对[" + resultRows.size() + "]条数据删除成功!");
} catch (Exception e) {
......@@ -196,12 +198,9 @@ public class ServiceHPSC005A extends ServiceBase {
* @param inInfo
* @return
*/
private EiInfo refreshOrderInfo(EiInfo inInfo) {
Map detailMap = EiInfoUtils.getFirstRow(inInfo, "detail");
String prodOrderNo = MapUtils.getString(detailMap, "productionOrderNo");
private EiInfo refreshOrderInfo(EiInfo inInfo, String prodOrderNo) {
HPSC005 dbSc005 = HPSCTools.HpSc005.get(prodOrderNo);
inInfo.getBlock("detail").getRows().clear();
inInfo.getBlock("detail").addRow(dbSc005);
inInfo.addBlock("detail").addRow(dbSc005);
return inInfo;
}
......
......@@ -190,7 +190,7 @@ public class HPSCTools {
* @return
*/
public static HPSC004 get(String prodOrderNo) {
AssertUtils.isNull(prodOrderNo, "生产订单号不能为空");
AssertUtils.isEmpty(prodOrderNo, "生产订单号不能为空");
Map queryMap = new HashMap();
queryMap.put("productionOrderNo", prodOrderNo);
List<HPSC004> results = DaoBase.getInstance().query(HPSC004.QUERY, queryMap);
......@@ -305,7 +305,7 @@ public class HPSCTools {
* @return
*/
public static HPSC005 get(String prodOrderNo) {
AssertUtils.isNull(prodOrderNo, "生产订单号不能为空");
AssertUtils.isEmpty(prodOrderNo, "生产订单号不能为空");
Map queryMap = new HashMap();
queryMap.put("productionOrderNo", prodOrderNo);
List<HPSC005> results = DaoBase.getInstance().query(HPSC005.QUERY, queryMap);
......
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