Commit 658fd30d by wuwenlong

生产计划dev;

parent aed10bc9
...@@ -128,6 +128,7 @@ public class HGSCTools { ...@@ -128,6 +128,7 @@ public class HGSCTools {
private static void checkSaveData(HGSC005 hgsc005) { private static void checkSaveData(HGSC005 hgsc005) {
AssertUtils.isEmpty(UserSessionUtils.getAccountCode(), "当前用户未绑定公司,无法操作数据,请联系管理员!"); AssertUtils.isEmpty(UserSessionUtils.getAccountCode(), "当前用户未绑定公司,无法操作数据,请联系管理员!");
AssertUtils.isEmpty(UserSessionUtils.getOrgId(), "当前用户未绑定部门,无法操作数据,请联系管理员!"); AssertUtils.isEmpty(UserSessionUtils.getOrgId(), "当前用户未绑定部门,无法操作数据,请联系管理员!");
AssertUtils.isTrue(Objects.isNull(hgsc005.getMatId())||hgsc005.getMatId()<=0, "物料清单ID不能为空!");
AssertUtils.isEmpty(hgsc005.getCompanyCode(), "公司编码不能为空!"); AssertUtils.isEmpty(hgsc005.getCompanyCode(), "公司编码不能为空!");
AssertUtils.isEmpty(hgsc005.getCompanyName(), "公司名称不能为空!"); AssertUtils.isEmpty(hgsc005.getCompanyName(), "公司名称不能为空!");
// AssertUtils.isEmpty(hgsc005.getDepCode(), "部门不能为空!"); // AssertUtils.isEmpty(hgsc005.getDepCode(), "部门不能为空!");
...@@ -155,9 +156,18 @@ public class HGSCTools { ...@@ -155,9 +156,18 @@ public class HGSCTools {
return CollectionUtils.isEmpty(results) ? null : results; return CollectionUtils.isEmpty(results) ? null : results;
} }
public static HGSC005A save(HGSC005A hgsc005a, Long matId){
AssertUtils.isTrue(Objects.isNull(matId)||matId<=0, "物料清单ID不能为空!");
checkUpdateData(hgsc005a);
HGSC005 hgsc005 = (HGSC005) DaoBase.getInstance().get(HGSC005.QUERY,HGSC005.FIELD_mat_id, matId);
DaoUtils.insert(HGSC005A.INSERT,THGSC005A.constructObj(hgsc005a,hgsc005));
return hgsc005a;
}
public static HGSC005A update(HGSC005A hgsc005a){ public static HGSC005A update(HGSC005A hgsc005a){
checkUpdateData(hgsc005a); checkUpdateData(hgsc005a);
HGSC005A result = (HGSC005A) DaoBase.getInstance().get(HGSC001A.QUERY,HGSC005A.FIELD_mat_detail_id, hgsc005a.getMatDetailId()); HGSC005A result = (HGSC005A) DaoBase.getInstance().get(HGSC005A.QUERY,HGSC005A.FIELD_mat_detail_id, hgsc005a.getMatDetailId());
result.setProductCode(hgsc005a.getProductCode()); result.setProductCode(hgsc005a.getProductCode());
result.setProductName(hgsc005a.getProductName()); result.setProductName(hgsc005a.getProductName());
result.setQuantity(hgsc005a.getQuantity()); result.setQuantity(hgsc005a.getQuantity());
...@@ -195,7 +205,7 @@ public class HGSCTools { ...@@ -195,7 +205,7 @@ public class HGSCTools {
hgsc005a.setProjName(hgsc005.getProjName()); hgsc005a.setProjName(hgsc005.getProjName());
hgsc005a.setFinishDate(hgsc005.getFinishDate()); hgsc005a.setFinishDate(hgsc005.getFinishDate());
hgsc005a.setUnfinishQuantity(hgsc005a.getQuantity()); hgsc005a.setUnfinishQuantity(hgsc005a.getQuantity());
hgsc005a.setFinishQuantity(hgsc005a.getQuantity()- hgsc005a.getUnfinishQuantity()); hgsc005a.setFinishQuantity(0);
return hgsc005a; return hgsc005a;
} }
} }
......
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