From fd3f5a70940272bec5a31c46087f95fbc6dc5eb5 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E6=9D=A8=E4=B8=96=E5=BC=BA?= Date: Mon, 10 Apr 2023 14:27:48 +0800 Subject: [PATCH] =?UTF-8?q?=E9=97=AE=E9=A2=98=E4=BF=AE=E6=94=B9?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../controller/Jg_naturalController.java | 8 ++ .../controller/SaleorderitemController.java | 27 ++++++- .../vehicle/controller/VehicleController.java | 8 ++ .../basicInformation/purchaseorder/index.vue | 2 +- .../purchaseorder/receiptinForm.vue | 4 +- .../scm/basicInformation/receiptin/Form.vue | 6 +- .../scm/basicInformation/receiptout/Form.vue | 14 ++++ .../saleorder/arinvoicesForm.vue | 78 +++++++++---------- .../saleorder/receiptoutForm.vue | 14 ++++ 9 files changed, 115 insertions(+), 46 deletions(-) diff --git a/SC-boot/linkage-scm/src/main/java/jnpf/Jg_natural/controller/Jg_naturalController.java b/SC-boot/linkage-scm/src/main/java/jnpf/Jg_natural/controller/Jg_naturalController.java index 2a278869..0d494941 100644 --- a/SC-boot/linkage-scm/src/main/java/jnpf/Jg_natural/controller/Jg_naturalController.java +++ b/SC-boot/linkage-scm/src/main/java/jnpf/Jg_natural/controller/Jg_naturalController.java @@ -225,6 +225,14 @@ public class Jg_naturalController { public ActionResult batchRemove(@PathVariable("ids") String ids) { String[] idList = ids.split(","); int i = 0; + for (String allId : idList) { + QueryWrapper queryWrapper = new QueryWrapper<>(); + queryWrapper.lambda().eq(PoundlistEntity::getVehicleId, allId); + List poundlistEntityList = poundlistService.list(queryWrapper); + if (poundlistEntityList.size() > 0) { + return ActionResult.fail("该业务员已被使用,无法删除"); + } + } for (String allId : idList) { this.delete(allId); i++; diff --git a/SC-boot/linkage-scm/src/main/java/jnpf/saleorder/controller/SaleorderitemController.java b/SC-boot/linkage-scm/src/main/java/jnpf/saleorder/controller/SaleorderitemController.java index 5fa76304..ef54d8a8 100644 --- a/SC-boot/linkage-scm/src/main/java/jnpf/saleorder/controller/SaleorderitemController.java +++ b/SC-boot/linkage-scm/src/main/java/jnpf/saleorder/controller/SaleorderitemController.java @@ -728,6 +728,19 @@ public class SaleorderitemController { poundlistEntity.setSalesStatus("99"); } poundlistService.updateBatchById(poundlistList); + SaleorderitemEntity saleorderitemEntity = saleorderitemService.getById(allId); + if (StringUtils.isNotEmpty(saleorderitemEntity.getSourcePoId())){ + JSONArray array = JSON.parseArray(saleorderitemEntity.getSourcePoId()); + for (Object purchaseId : array) { + if (StringUtils.isNotEmpty(String.valueOf(purchaseId))) { + PurchaseorderitemEntity purchaseorderitemEntity = purchaseorderitemService.getInfo(String.valueOf(purchaseId)); + if (ObjectUtils.isNotEmpty(purchaseorderitemEntity)) { + purchaseorderitemEntity.setIsTransfer("0"); + purchaseorderitemService.updateById(purchaseorderitemEntity); + } + } + } + } this.delete(allId); i++; } @@ -1088,7 +1101,6 @@ public class SaleorderitemController { public ActionResult delete(@PathVariable("id") String id){ SaleorderitemEntity entity= saleorderitemService.getInfo(id); if(entity!=null){ - saleorderitemService.delete(entity); QueryWrapper queryWrapper = new QueryWrapper<>(); queryWrapper.lambda().eq(Salesorder_item0Entity::getSalesOrderId,entity.getId()); queryWrapper.lambda().select(Salesorder_item0Entity::getPoundlistId); @@ -1098,6 +1110,19 @@ public class SaleorderitemController { poundlistEntity.setSalesStatus("99"); } poundlistService.updateBatchById(poundlistList); + if (StringUtils.isNotEmpty(entity.getSourcePoId())){ + JSONArray array = JSON.parseArray(entity.getSourcePoId()); + for (Object purchaseId : array) { + if (StringUtils.isNotEmpty(String.valueOf(purchaseId))) { + PurchaseorderitemEntity purchaseorderitemEntity = purchaseorderitemService.getInfo(String.valueOf(purchaseId)); + if (ObjectUtils.isNotEmpty(purchaseorderitemEntity)) { + purchaseorderitemEntity.setIsTransfer("0"); + purchaseorderitemService.updateById(purchaseorderitemEntity); + } + } + } + } + saleorderitemService.delete(entity); QueryWrapper queryWrapperSalesorder_item0=new QueryWrapper<>(); queryWrapperSalesorder_item0.lambda().eq(Salesorder_item0Entity::getSalesOrderId,entity.getId()); salesorder_item0Service.remove(queryWrapperSalesorder_item0); diff --git a/SC-boot/linkage-scm/src/main/java/jnpf/vehicle/controller/VehicleController.java b/SC-boot/linkage-scm/src/main/java/jnpf/vehicle/controller/VehicleController.java index 87400ac4..cc065479 100644 --- a/SC-boot/linkage-scm/src/main/java/jnpf/vehicle/controller/VehicleController.java +++ b/SC-boot/linkage-scm/src/main/java/jnpf/vehicle/controller/VehicleController.java @@ -236,6 +236,14 @@ public class VehicleController { public ActionResult batchRemove(@PathVariable("ids") String ids){ String[] idList = ids.split(","); int i =0; + for (String allId : idList) { + QueryWrapper queryWrapper = new QueryWrapper<>(); + queryWrapper.lambda().eq(PoundlistEntity::getVehicleId, allId); + List poundlistEntityList = poundlistService.list(queryWrapper); + if (poundlistEntityList.size() > 0) { + return ActionResult.fail("该车辆已被使用,无法删除"); + } + } for (String allId : idList){ this.delete(allId); i++; diff --git a/SC-web/src/views/scm/basicInformation/purchaseorder/index.vue b/SC-web/src/views/scm/basicInformation/purchaseorder/index.vue index 680b8dcc..5ebd82c9 100644 --- a/SC-web/src/views/scm/basicInformation/purchaseorder/index.vue +++ b/SC-web/src/views/scm/basicInformation/purchaseorder/index.vue @@ -608,7 +608,7 @@ if(!flag){ this.$message({ type: 'error', - message: '此订单已经转销售', + message: '订单已经转销售', duration: 2500 }) return diff --git a/SC-web/src/views/scm/basicInformation/purchaseorder/receiptinForm.vue b/SC-web/src/views/scm/basicInformation/purchaseorder/receiptinForm.vue index 713740c4..1385ff14 100644 --- a/SC-web/src/views/scm/basicInformation/purchaseorder/receiptinForm.vue +++ b/SC-web/src/views/scm/basicInformation/purchaseorder/receiptinForm.vue @@ -708,8 +708,8 @@ }) if (!flag){ this.$message({ - message: res.msg, - type: 'success', + message: '库区不能为空', + type: 'error', duration: 2000 }) return diff --git a/SC-web/src/views/scm/basicInformation/receiptin/Form.vue b/SC-web/src/views/scm/basicInformation/receiptin/Form.vue index c7566a58..b5774748 100644 --- a/SC-web/src/views/scm/basicInformation/receiptin/Form.vue +++ b/SC-web/src/views/scm/basicInformation/receiptin/Form.vue @@ -642,14 +642,14 @@ if (item.reservoirareaName == null || item.reservoirareaName == ''){ flag = false; } - if (item.poundlistEntity.salesStatus > 0){ + if (item.poundlistEntity.salesStatus == '1' || item.poundlistEntity.salesStatus == '2' || item.poundlistEntity.salesStatus == '3'){ statusFlag = false; } }) if (!flag){ this.$message({ - message: res.msg, - type: 'success', + message: '库区不能为空', + type: 'error', duration: 2000 }) return diff --git a/SC-web/src/views/scm/basicInformation/receiptout/Form.vue b/SC-web/src/views/scm/basicInformation/receiptout/Form.vue index 87621f34..d3c7b680 100644 --- a/SC-web/src/views/scm/basicInformation/receiptout/Form.vue +++ b/SC-web/src/views/scm/basicInformation/receiptout/Form.vue @@ -556,6 +556,20 @@ }) }, request() { + var flag = true; + this.dataForm.receiptout_item0List.forEach((item,index) => { + if (item.reservoirareaName == null || item.reservoirareaName == ''){ + flag = false; + } + }) + if (!flag){ + this.$message({ + message: '库区不能为空', + type: 'error', + duration: 2000 + }) + return + } this.submitDisabled = true; var _data = this.dataList() if (!this.dataForm.id) { diff --git a/SC-web/src/views/scm/basicInformation/saleorder/arinvoicesForm.vue b/SC-web/src/views/scm/basicInformation/saleorder/arinvoicesForm.vue index a78b1114..ac3acd16 100644 --- a/SC-web/src/views/scm/basicInformation/saleorder/arinvoicesForm.vue +++ b/SC-web/src/views/scm/basicInformation/saleorder/arinvoicesForm.vue @@ -596,45 +596,45 @@ this.submitDisabled = true; var _data =this.dataList() debugger - // if (!this.dataForm.id) { - // request({ - // url: '/api/arinvoices/Arinvoices', - // method: 'post', - // data: _data - // }).then((res) => { - // this.$message({ - // message: res.msg, - // type: 'success', - // duration: 1000, - // onClose: () => { - // this.submitDisabled = false; - // this.visible = false - // this.$emit('refresh', true) - // } - // }) - // }).catch(() => { - // this.submitDisabled = false - // }) - // }else{ - // request({ - // url: '/api/arinvoices/Arinvoices/'+this.dataForm.id, - // method: 'PUT', - // data: _data - // }).then((res) => { - // this.$message({ - // message: res.msg, - // type: 'success', - // duration: 1000, - // onClose: () => { - // this.submitDisabled = false; - // this.visible = false - // this.$emit('refresh', true) - // } - // }) - // }).catch(() => { - // this.submitDisabled = false - // }) - // } + if (!this.dataForm.id) { + request({ + url: '/api/arinvoices/Arinvoices', + method: 'post', + data: _data + }).then((res) => { + this.$message({ + message: res.msg, + type: 'success', + duration: 1000, + onClose: () => { + this.submitDisabled = false; + this.visible = false + this.$emit('refresh', true) + } + }) + }).catch(() => { + this.submitDisabled = false + }) + }else{ + request({ + url: '/api/arinvoices/Arinvoices/'+this.dataForm.id, + method: 'PUT', + data: _data + }).then((res) => { + this.$message({ + message: res.msg, + type: 'success', + duration: 1000, + onClose: () => { + this.submitDisabled = false; + this.visible = false + this.$emit('refresh', true) + } + }) + }).catch(() => { + this.submitDisabled = false + }) + } }, addarinvoices_item1List(){ let item = { diff --git a/SC-web/src/views/scm/basicInformation/saleorder/receiptoutForm.vue b/SC-web/src/views/scm/basicInformation/saleorder/receiptoutForm.vue index f2e56577..7c56eb42 100644 --- a/SC-web/src/views/scm/basicInformation/saleorder/receiptoutForm.vue +++ b/SC-web/src/views/scm/basicInformation/saleorder/receiptoutForm.vue @@ -463,6 +463,20 @@ }) }, request() { + var flag = true; + this.dataForm.receiptout_item0List.forEach((item,index) => { + if (item.reservoirareaName == null || item.reservoirareaName == ''){ + flag = false; + } + }) + if (!flag){ + this.$message({ + message: '库区不能为空', + type: 'error', + duration: 2000 + }) + return + } this.submitDisabled = true; var _data = this.dataList() if (!this.dataForm.id) {