From d5423654470d4249d44e8d7efe952374153b47b3 Mon Sep 17 00:00:00 2001 From: liuxiaoxu <1793812695@qq.com> Date: Wed, 15 May 2024 17:27:50 +0800 Subject: [PATCH] =?UTF-8?q?[feat]=E5=93=81=E8=B4=A8=E7=AE=A1=E7=90=86:=20?= =?UTF-8?q?=E9=80=80=E6=A3=80=E7=AE=A1=E7=90=86=20=E6=96=B0=E5=A2=9E?= =?UTF-8?q?=E9=80=80=E6=A3=80=E5=A4=84=E7=90=86=E5=8A=9F=E8=83=BD=20return?= =?UTF-8?q?Inspection.html=20=E9=80=80=E6=A3=80=E7=AE=A1=E7=90=86=E5=88=97?= =?UTF-8?q?=E8=A1=A8=E6=96=B0=E5=A2=9E=E9=80=80=E6=A3=80=E5=A4=84=E7=90=86?= =?UTF-8?q?=E6=8C=89=E9=92=AE=20=E6=96=B0=E5=A2=9E=E9=80=80=E6=A3=80?= =?UTF-8?q?=E5=A4=84=E7=90=86=E9=A1=B5=E9=9D=A2returnInspectionProcessing.?= =?UTF-8?q?html=20detail.html=E9=A1=B5=E9=9D=A2=E6=96=B0=E5=A2=9E=E4=B8=89?= =?UTF-8?q?=E4=B8=AA=E5=AD=97=E6=AE=B5?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../QualityReturnInspectionController.java | 23 +- .../IQualityReturnInspectionService.java | 5 + .../QualityReturnInspectionServiceImpl.java | 42 ++ .../quality/returnInspection/detail.html | 21 +- .../returnInspection/returnInspection.html | 9 +- .../returnInspectionProcessing.html | 426 ++++++++++++++++++ 6 files changed, 522 insertions(+), 4 deletions(-) create mode 100644 ruoyi-admin/src/main/resources/templates/quality/returnInspection/returnInspectionProcessing.html diff --git a/ruoyi-admin/src/main/java/com/ruoyi/quality/controller/QualityReturnInspectionController.java b/ruoyi-admin/src/main/java/com/ruoyi/quality/controller/QualityReturnInspectionController.java index f3d4c61a..87308f3d 100644 --- a/ruoyi-admin/src/main/java/com/ruoyi/quality/controller/QualityReturnInspectionController.java +++ b/ruoyi-admin/src/main/java/com/ruoyi/quality/controller/QualityReturnInspectionController.java @@ -126,7 +126,7 @@ public class QualityReturnInspectionController extends BaseController } /** - * 修改保存退检管理单 + * 修改保存退检管理单详情 */ @RequiresPermissions("quality:returnInspection:detail") @Log(title = "物料退检单", businessType = BusinessType.UPDATE) @@ -137,6 +137,27 @@ public class QualityReturnInspectionController extends BaseController return toAjax(qualityReturnInspectionService.detailQualityReturnInspection(erpMaterialReturnInspection)); } + /** + * 修改物料退检单 + */ + @GetMapping("/processing/{id}") + public String processing(@PathVariable("id") Long id, ModelMap mmap) + { + ErpMaterialReturnInspection erpMaterialReturnInspection = qualityReturnInspectionService.selectQualityReturnInspectionById(id); + mmap.put("erpMaterialReturnInspection", erpMaterialReturnInspection); + return prefix + "/returnInspectionProcessing"; + } + /** + * 修改保存物料退检单 + */ + @RequiresPermissions("quality:returnInspection:processing") + @Log(title = "物料退检单", businessType = BusinessType.UPDATE) + @PostMapping("/processing") + @ResponseBody + public AjaxResult processingSave(ErpMaterialReturnInspection erpMaterialReturnInspection) + { + return toAjax(qualityReturnInspectionService.processingQualityReturnInspection(erpMaterialReturnInspection)); + } } diff --git a/ruoyi-admin/src/main/java/com/ruoyi/quality/service/IQualityReturnInspectionService.java b/ruoyi-admin/src/main/java/com/ruoyi/quality/service/IQualityReturnInspectionService.java index 83c50ce1..90676fe7 100644 --- a/ruoyi-admin/src/main/java/com/ruoyi/quality/service/IQualityReturnInspectionService.java +++ b/ruoyi-admin/src/main/java/com/ruoyi/quality/service/IQualityReturnInspectionService.java @@ -55,4 +55,9 @@ public interface IQualityReturnInspectionService * 退检管理详情 * */ int detailQualityReturnInspection(ErpMaterialReturnInspection erpMaterialReturnInspection); + + /* + * 退检处理 + * */ + int processingQualityReturnInspection(ErpMaterialReturnInspection erpMaterialReturnInspection); } diff --git a/ruoyi-admin/src/main/java/com/ruoyi/quality/service/impl/QualityReturnInspectionServiceImpl.java b/ruoyi-admin/src/main/java/com/ruoyi/quality/service/impl/QualityReturnInspectionServiceImpl.java index f7c77a47..0c3343ee 100644 --- a/ruoyi-admin/src/main/java/com/ruoyi/quality/service/impl/QualityReturnInspectionServiceImpl.java +++ b/ruoyi-admin/src/main/java/com/ruoyi/quality/service/impl/QualityReturnInspectionServiceImpl.java @@ -6,6 +6,7 @@ import java.util.stream.Collectors; import cn.hutool.core.collection.CollectionUtil; import com.ruoyi.common.core.redis.RedisCache; +import com.ruoyi.common.exception.BusinessException; import com.ruoyi.common.utils.DateUtils; import com.ruoyi.common.utils.ShiroUtils; import com.ruoyi.erp.domain.ErpMaterialReturnInspection; @@ -145,4 +146,45 @@ public class QualityReturnInspectionServiceImpl implements IQualityReturnInspect public int detailQualityReturnInspection(ErpMaterialReturnInspection erpMaterialReturnInspection) { return 1; } + + /* + * 退检处理 + * */ + @Override + public int processingQualityReturnInspection(ErpMaterialReturnInspection erpMaterialReturnInspection) { + String returnInspectionNo = erpMaterialReturnInspection.getReturnInspectionNo(); + ErpMaterialReturnInspectionDetail detailQueryObj = new ErpMaterialReturnInspectionDetail(); + detailQueryObj.setReturnInspectionNo(returnInspectionNo); + List oldDetails = materialReturnInspectionDetailService.selectErpMaterialReturnInspectionDetailList(detailQueryObj); + List oldDetailIds = new ArrayList<>(); + if(CollectionUtil.isNotEmpty(oldDetails)){ + oldDetailIds = oldDetails.stream().map(t->t.getId()).collect(Collectors.toList()); + }else{ + materialReturnInspectionDetailService.deleteByReturnInspectionNo(returnInspectionNo); + } + List inspectionDetails = erpMaterialReturnInspection.getInspectionDetails(); + List finalOldDetailIds = oldDetailIds; + inspectionDetails.forEach(detail->{ + Long id = detail.getId(); + if(finalOldDetailIds.contains(id)){ + materialReturnInspectionDetailService.updateErpMaterialReturnInspectionDetail(detail); + finalOldDetailIds.remove(id); + }else{ + detail.setReturnInspectionNo(returnInspectionNo); + materialReturnInspectionDetailService.insertErpMaterialReturnInspectionDetail(detail); + } + }); + if(CollectionUtil.isNotEmpty(finalOldDetailIds)){ + materialReturnInspectionDetailService.deleteErpMaterialReturnInspectionDetailByIdList(finalOldDetailIds); + } + + String loginName = ShiroUtils.getLoginName(); + erpMaterialReturnInspection.setUpdateBy(loginName); + erpMaterialReturnInspection.setUpdateTime(DateUtils.getNowDate()); + if (erpMaterialReturnInspection.getIsClosed().equals("1")){ + throw new BusinessException("已经结案,不可以再上传复检"); + } + int updateFlag = erpMaterialReturnInspectionMapper.updateErpMaterialReturnInspection(erpMaterialReturnInspection); + return updateFlag; + } } diff --git a/ruoyi-admin/src/main/resources/templates/quality/returnInspection/detail.html b/ruoyi-admin/src/main/resources/templates/quality/returnInspection/detail.html index 783b2be5..8f9310d2 100644 --- a/ruoyi-admin/src/main/resources/templates/quality/returnInspection/detail.html +++ b/ruoyi-admin/src/main/resources/templates/quality/returnInspection/detail.html @@ -90,6 +90,7 @@ \ No newline at end of file diff --git a/ruoyi-admin/src/main/resources/templates/quality/returnInspection/returnInspectionProcessing.html b/ruoyi-admin/src/main/resources/templates/quality/returnInspection/returnInspectionProcessing.html new file mode 100644 index 00000000..a33ae8ee --- /dev/null +++ b/ruoyi-admin/src/main/resources/templates/quality/returnInspection/returnInspectionProcessing.html @@ -0,0 +1,426 @@ + + + + + + + +
+
+
+
+ +
+ +
+ +
+
+
+
+
+ +
+ +
+
+
+
+
+
+
+ +
+
+ + +
+
+
+
+
+
+ +
+ + +
+
+
+
+
+
+
+ +
+
+ + +
+
+
+
+
+
+
+ + + + + + +
+
+
+
+
+
+
+ + + + + + + + + + + + \ No newline at end of file