Commit b291ee03 by wuwenlong

工序质检单bugfix

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