Commit 46077ddc by 江和松

物料数据库新增、修改增加类型大类

parent 283c28b5
...@@ -146,6 +146,8 @@ public class ServiceHGPZ005 extends ServiceBase { ...@@ -146,6 +146,8 @@ public class ServiceHGPZ005 extends ServiceBase {
params.put(HGPZ005.FIELD_INVENT_CODE, hgpz005.getInventCode()); params.put(HGPZ005.FIELD_INVENT_CODE, hgpz005.getInventCode());
List list = DaoBase.getInstance().query(HGPZ005.QUERY, params); List list = DaoBase.getInstance().query(HGPZ005.QUERY, params);
AssertUtils.isNotEmpty(list, String.format("存货编码[%s]已存在", hgpz005.getInventCode())); AssertUtils.isNotEmpty(list, String.format("存货编码[%s]已存在", hgpz005.getInventCode()));
HGPZ004 hgpz004 = HGPZTools.hgpz004.getByCode(hgpz005.getInventType());
hgpz005.setInventTypeDetail(Integer.valueOf(hgpz004.getInventTypeDetail()));
DaoUtils.insert(HGPZ005.INSERT, hgpz005); DaoUtils.insert(HGPZ005.INSERT, hgpz005);
} }
...@@ -155,6 +157,8 @@ public class ServiceHGPZ005 extends ServiceBase { ...@@ -155,6 +157,8 @@ public class ServiceHGPZ005 extends ServiceBase {
* @param hgpz005 * @param hgpz005
*/ */
private void modify(HGPZ005 hgpz005) { private void modify(HGPZ005 hgpz005) {
HGPZ004 hgpz004 = HGPZTools.hgpz004.getByCode(hgpz005.getInventType());
hgpz005.setInventTypeDetail(Integer.valueOf(hgpz004.getInventTypeDetail()));
DaoUtils.update(HGPZ005.UPDATE, hgpz005); DaoUtils.update(HGPZ005.UPDATE, hgpz005);
} }
......
...@@ -89,20 +89,20 @@ public class HGPZTools { ...@@ -89,20 +89,20 @@ public class HGPZTools {
public static class hgpz004 { public static class hgpz004 {
/** /**
* 查询存货 * 查询存货类型
* *
* @param inventCode * @param inventType
* @return * @return
*/ */
public static HGPZ004 getByCode(String inventCode) { public static HGPZ004 getByCode(String inventType) {
AssertUtils.isEmpty(inventCode, "存货编码不能为空"); AssertUtils.isEmpty(inventType, "存货类型编码不能为空");
Map queryMap = new HashMap(); Map queryMap = new HashMap();
queryMap.put("inventCode", inventCode); queryMap.put("inventType", inventType);
List<HGPZ004> pz004s = DaoBase.getInstance().query(HGPZ004.QUERY, queryMap); List<HGPZ004> pz004s = DaoBase.getInstance().query(HGPZ004.QUERY, queryMap);
if(pz004s!=null&&pz004s.size()==0){ if(pz004s!=null&&pz004s.size()==0){
pz004s = null; pz004s = null;
} }
AssertUtils.isEmpty(pz004s, String.format("存货编码[%s]不存在", inventCode)); AssertUtils.isEmpty(pz004s, String.format("存货类型编码[%s]不存在", inventType));
return pz004s.get(0); return pz004s.get(0);
} }
......
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