diff --git a/mes/hd/nladmin-system/src/main/java/org/nl/wms/pcs/service/impl/PcsIfPurchaseorderprocServiceImpl.java b/mes/hd/nladmin-system/src/main/java/org/nl/wms/pcs/service/impl/PcsIfPurchaseorderprocServiceImpl.java index 6d9937d8..52f1d606 100644 --- a/mes/hd/nladmin-system/src/main/java/org/nl/wms/pcs/service/impl/PcsIfPurchaseorderprocServiceImpl.java +++ b/mes/hd/nladmin-system/src/main/java/org/nl/wms/pcs/service/impl/PcsIfPurchaseorderprocServiceImpl.java @@ -423,7 +423,7 @@ public class PcsIfPurchaseorderprocServiceImpl implements PcsIfPurchaseorderproc // 未到货重量 erp.put("qty_zt", erp.getString("qty_zt")); // 处理状态: 合同未到货重量 = 0则为【完成】; 合同未到货重量 = 合同重量则为【生成】;否则为【采购中】 - if (erp.getString("qty_zt").equals("0")) { + if (erp.getDoubleValue("qty_zt") == 0) { erp.put("proc_status","完成"); } else if (erp.getDoubleValue("qty_zt") == erp.getDoubleValue("qty_ht")) { erp.put("proc_status","生成"); @@ -454,6 +454,14 @@ public class PcsIfPurchaseorderprocServiceImpl implements PcsIfPurchaseorderproc // 合计金额:合计重量 * 含税单价 erp.put("allqty", allqty); erp.put("all_valmoney", NumberUtil.mul(allqty, erp.getDoubleValue("norigtaxprice"))); + // 备注:取随机一条采购订单备注 + JSONObject jsonProc = procList.stream() + .filter(row -> row.getString("contract_no").equals(erp.getString("vbillcode")) + && row.getString("item_id").equals(erp.getString("item_id")) + ) + .findFirst().orElse(null); + erp.put("remark", ObjectUtil.isNotEmpty(jsonProc) ? jsonProc.getString("remark") : ""); + resultList.add(erp); } @@ -553,9 +561,17 @@ public class PcsIfPurchaseorderprocServiceImpl implements PcsIfPurchaseorderproc @Override public void saveRemark(JSONObject whereJson) { WQLObject tab = WQLObject.getWQLObject("PCS_IF_PurchaseOrderProc"); - JSONObject jsonObject = tab.query("id = '" + whereJson.getString("id") + "'").uniqueResult(0); - jsonObject.put("remark", whereJson.getString("remark")); - tab.update(jsonObject); + // 查询是否有采购订单 + JSONArray resultJSONArray = tab.query("contract_no = '" + whereJson.getString("contract_no") + "' and item_id = '" + whereJson.getString("item_id") + "'") + .getResultJSONArray(0); + if (ObjectUtil.isEmpty(resultJSONArray)) { + throw new BadRequestException("当前合同没有采购订单不可备注!"); + } + + // 根据合同号 和 物料ID 查询修改对应的数据 + JSONObject param = new JSONObject(); + param.put("remark", whereJson.getString("remark1")); + tab.update(param,"contract_no = '"+whereJson.getString("contract_no")+"' and item_id = '"+whereJson.getString("item_id")+"'"); } @Override @@ -628,7 +644,7 @@ public class PcsIfPurchaseorderprocServiceImpl implements PcsIfPurchaseorderproc // 未到货重量 erp.put("qty_zt", erp.getString("qty_zt")); // 处理状态: 合同未到货重量 = 0则为【完成】; 合同未到货重量 = 合同重量则为【生成】;否则为【采购中】 - if (erp.getString("qty_zt").equals("0")) { + if (erp.getDoubleValue("qty_zt") == 0) { erp.put("proc_status","完成"); } else if (erp.getDoubleValue("qty_zt") == erp.getDoubleValue("qty_ht")) { erp.put("proc_status","生成"); @@ -659,6 +675,13 @@ public class PcsIfPurchaseorderprocServiceImpl implements PcsIfPurchaseorderproc // 合计金额:合计重量 * 含税单价 erp.put("allqty", allqty); erp.put("all_valmoney", NumberUtil.mul(allqty, erp.getDoubleValue("norigtaxprice"))); + // 备注:取随机一条采购订单备注 + JSONObject jsonProc = procList.stream() + .filter(row -> row.getString("contract_no").equals(erp.getString("vbillcode")) + && row.getString("item_id").equals(erp.getString("item_id")) + ) + .findFirst().orElse(null); + erp.put("remark", ObjectUtil.isNotEmpty(jsonProc) ? jsonProc.getString("remark") : ""); resultList.add(erp); } @@ -695,6 +718,7 @@ public class PcsIfPurchaseorderprocServiceImpl implements PcsIfPurchaseorderproc dtl_map.put("账龄", jo.getString("honour_days")); dtl_map.put("合计重量", NumberUtil.round(jo.getDoubleValue("allqty"), 3)); dtl_map.put("合计金额", NumberUtil.round(jo.getDoubleValue("all_valmoney"), 3)); + dtl_map.put("内容", jo.getString("remark")); list.add(dtl_map); } FileUtil.downloadExcel(list, response); diff --git a/mes/qd/src/views/wms/statistics/ledgerQuery/index.vue b/mes/qd/src/views/wms/statistics/ledgerQuery/index.vue index 6d0bcab0..3de20c69 100644 --- a/mes/qd/src/views/wms/statistics/ledgerQuery/index.vue +++ b/mes/qd/src/views/wms/statistics/ledgerQuery/index.vue @@ -236,7 +236,7 @@ export default { this.receiveDialog = true }, openRemarkDaing(row) { - this.openParam = row.id + this.openParam = row this.remarkDaing = true }, downdtl() { diff --git a/mes/qd/src/views/wms/statistics/ledgerQuery/remarkDaing.vue b/mes/qd/src/views/wms/statistics/ledgerQuery/remarkDaing.vue index 2e8195c9..0e0df806 100644 --- a/mes/qd/src/views/wms/statistics/ledgerQuery/remarkDaing.vue +++ b/mes/qd/src/views/wms/statistics/ledgerQuery/remarkDaing.vue @@ -14,16 +14,16 @@ - + { + crudOrderproc.saveRemark(this.form1).then(res => { this.crud.notify('操作成功', CRUD.NOTIFICATION_TYPE.SUCCESS) this.close() this.crud.toQuery()