Commit b291ee03 by wuwenlong

工序质检单bugfix

parent 682fc1de
...@@ -84,6 +84,11 @@ public class ServiceHGZL002 extends ServiceBase { ...@@ -84,6 +84,11 @@ public class ServiceHGZL002 extends ServiceBase {
public EiInfo save(EiInfo inInfo) { public EiInfo save(EiInfo inInfo) {
try { try {
List<HGZL002> hgzl002List = MapUtils.toDaoEPBase(inInfo,HGZL002.class); List<HGZL002> hgzl002List = MapUtils.toDaoEPBase(inInfo,HGZL002.class);
List<Long> ids = Optional.ofNullable(hgzl002List).orElse(new ArrayList<>()).stream().map(HGZL002::getId).collect(Collectors.toList());
List<HGZL002> dbList = HGZLTools.THGZL002.list(ids);
Optional.ofNullable(dbList).orElse(new ArrayList<>()).stream().forEach( o -> {
AssertUtils.isTrue(o.getCheckStatus().compareTo(CheckStatusEnum.CHECKED.getCode())==0,String.format("质检单号[%s]已经质检完成不能修改!",o.getCheckCode()));
});
hgzl002List.forEach( o -> { hgzl002List.forEach( o -> {
o.setCheckStatus(CheckStatusEnum.CHECKED.getCode()); o.setCheckStatus(CheckStatusEnum.CHECKED.getCode());
DaoUtils.update(HGZL002.UPDATE,o); DaoUtils.update(HGZL002.UPDATE,o);
......
...@@ -99,6 +99,17 @@ public class HGZLTools { ...@@ -99,6 +99,17 @@ public class HGZLTools {
return CollectionUtils.isEmpty(results) ? null : results.get(0); return CollectionUtils.isEmpty(results) ? null : results.get(0);
} }
/**
* @param ids
*/
public static List<HGZL002> list(List<Long> ids) {
AssertUtils.isEmpty(ids, "ID不能为空");
Map paramMap = new HashMap();
paramMap.put("ids", ids);
List<HGZL002> results = DaoBase.getInstance().query(HGZL002.QUERY, paramMap);
return results;
}
public static HGZL002 add(HGSC008 hgsc008) { public static HGZL002 add(HGSC008 hgsc008) {
HGZL002 hgzl002 = new HGZL002(); HGZL002 hgzl002 = new HGZL002();
BeanUtils.copyProperties(hgsc008, hgzl002); BeanUtils.copyProperties(hgsc008, hgzl002);
...@@ -144,6 +155,18 @@ public class HGZLTools { ...@@ -144,6 +155,18 @@ public class HGZLTools {
} }
public static class THGZL003 { public static class THGZL003 {
/**
* @param ids
*/
public static List<HGZL002> list(List<Long> ids) {
AssertUtils.isEmpty(ids, "ID不能为空");
Map paramMap = new HashMap();
paramMap.put("ids", ids);
List<HGZL002> results = DaoBase.getInstance().query(HGZL002.QUERY, paramMap);
return results;
}
public static HGZL003 add(HGZL003 hgzl003) { public static HGZL003 add(HGZL003 hgzl003) {
HGSC007 hgsc007 = HGSCTools.THGSC007.getById(hgzl003.getTaskId()); HGSC007 hgsc007 = HGSCTools.THGSC007.getById(hgzl003.getTaskId());
BeanUtils.copyProperties(hgsc007, hgzl003); BeanUtils.copyProperties(hgsc007, hgzl003);
......
...@@ -9,7 +9,7 @@ $(function () { ...@@ -9,7 +9,7 @@ $(function () {
pageSize: 20, pageSize: 20,
pageSizes: [10, 20, 30, 50, 100, 200] pageSizes: [10, 20, 30, 50, 100, 200]
}, },
columns: [{ columns: [/*{
field: "unpassQuantity", field: "unpassQuantity",
template: function (item) { template: function (item) {
let template = ""; let template = "";
...@@ -27,7 +27,7 @@ $(function () { ...@@ -27,7 +27,7 @@ $(function () {
} }
return item.passQuantity; return item.passQuantity;
} }
}], }*/],
onSuccess: function (e) { onSuccess: function (e) {
if(e.eiInfo.extAttr.methodName == 'save'||e.eiInfo.extAttr.methodName == 'delete' ){ if(e.eiInfo.extAttr.methodName == 'save'||e.eiInfo.extAttr.methodName == 'delete' ){
query(); query();
...@@ -38,11 +38,16 @@ $(function () { ...@@ -38,11 +38,16 @@ $(function () {
grid.dataSource.bind("change", function(e) { grid.dataSource.bind("change", function(e) {
// 判断父级节点是否发生变化 // 判断父级节点是否发生变化
if (e.field == "unpassQuantity") { if (e.field == "unpassQuantity") {
loadChange(grid,e,"passQuantity"); // loadChange(grid,e,"passQuantity");
var passQuantity = e.items[0]['quantity'] - e.items[0]['unpassQuantity'];
resultGrid.setCellValue(e.items[0],"passQuantity",passQuantity);
} }
// 判断父级节点是否发生变化 // 判断父级节点是否发生变化
if (e.field == "passQuantity") { if (e.field == "passQuantity") {
loadChange(grid,e,"unpassQuantity"); // loadChange(grid,e,"unpassQuantity");
var unpassQuantity = e.items[0]['quantity'] - e.items[0]['passQuantity'];
resultGrid.setCellValue(e.items[0],"unpassQuantity",unpassQuantity);
} }
}); });
}, },
...@@ -110,7 +115,7 @@ let save = function () { ...@@ -110,7 +115,7 @@ let save = function () {
let quantity = rows[i]['quantity']; let quantity = rows[i]['quantity'];
let checkBy = rows[i]['checkBy']; let checkBy = rows[i]['checkBy'];
let checkCode = rows[i]['checkCode']; let checkCode = rows[i]['checkCode'];
let checkStatus = rows[i]['checkStatus'];
if (!isNumber(passQuantity)||!isNumber(unpassQuantity)) { if (!isNumber(passQuantity)||!isNumber(unpassQuantity)) {
message("质检单号[" + checkCode + "]合格数量与不合格数量必须是大于等于0的数字!"); message("质检单号[" + checkCode + "]合格数量与不合格数量必须是大于等于0的数字!");
...@@ -128,7 +133,10 @@ let save = function () { ...@@ -128,7 +133,10 @@ let save = function () {
message("质检单号[" + checkCode + "]质检人员不能为空!"); message("质检单号[" + checkCode + "]质检人员不能为空!");
return; return;
} }
if(checkStatus === '1'){
message("质检单号[" + checkCode + "]已经质检完成不能修改!");
return;
}
} }
JSUtils.confirm("确定对勾选中的[" + rows.length + "]条数据做质检完成操作吗? ", { JSUtils.confirm("确定对勾选中的[" + rows.length + "]条数据做质检完成操作吗? ", {
ok: function () { ok: function () {
......
...@@ -11,7 +11,7 @@ $(function () { ...@@ -11,7 +11,7 @@ $(function () {
pageSize: 20, pageSize: 20,
pageSizes: [10, 20, 30, 50, 100, 200] pageSizes: [10, 20, 30, 50, 100, 200]
}, },
columns: [{ columns: [/*{
field: "unpassQuantity", field: "unpassQuantity",
template: function (item) { template: function (item) {
let template = ""; let template = "";
...@@ -29,7 +29,7 @@ $(function () { ...@@ -29,7 +29,7 @@ $(function () {
} }
return item.passQuantity; return item.passQuantity;
} }
},{ },*/{
field:"workBy", field:"workBy",
template: function (item) { template: function (item) {
let template = ""; let template = "";
...@@ -86,11 +86,12 @@ $(function () { ...@@ -86,11 +86,12 @@ $(function () {
$("#BNT_SELECT").on("click", selectTask); $("#BNT_SELECT").on("click", selectTask);
// 此 grid 对象 // 此 grid 对象
grid.dataSource.bind("change", function(e) { grid.dataSource.bind("change", function(e) {
// 判断父级节点是否发生变化
if (e.field == "unpassQuantity") { if (e.field == "unpassQuantity") {
loadChange(grid,e,"passQuantity"); // loadChange(grid,e,"passQuantity");
} var passQuantity = e.items[0]['quantity'] - e.items[0]['unpassQuantity'];
if (e.field == "passQuantity") { resultGrid.setCellValue(e.items[0],"passQuantity",passQuantity);
loadChange(grid,e,"unpassQuantity");
} }
if (e.field == "workBy") { if (e.field == "workBy") {
loadChange(grid,e,"workName"); loadChange(grid,e,"workName");
...@@ -158,6 +159,7 @@ let save = function () { ...@@ -158,6 +159,7 @@ let save = function () {
let quantity = rows[i]['quantity']; let quantity = rows[i]['quantity'];
let checkDate = rows[i]['checkDate']; let checkDate = rows[i]['checkDate'];
let workBy = rows[i]['workBy']; let workBy = rows[i]['workBy'];
let checkStatus = rows[i]['checkStatus'];
if(!workBy){ if(!workBy){
message("第" + (i + 1) + "行请选择生产人员!"); message("第" + (i + 1) + "行请选择生产人员!");
...@@ -183,6 +185,10 @@ let save = function () { ...@@ -183,6 +185,10 @@ let save = function () {
message("第" + (i + 1) + "行请选择质检日期!"); message("第" + (i + 1) + "行请选择质检日期!");
return; return;
} }
if(checkStatus === '1'){
message("第" + (i + 1) + "行已经质检完成不能修改!");
return;
}
} }
JSUtils.confirm("确定对勾选中的[" + rows.length + "]条数据做保存操作吗? ", { JSUtils.confirm("确定对勾选中的[" + rows.length + "]条数据做保存操作吗? ", {
ok: function () { ok: function () {
......
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