Commit c30ee06b by liuyang

Merge branch 'dev' of http://git.pseer.com:8800/platform/hg-smart into dev-ly

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