From 09ec12487aeafb9856515cecb014a9bb8928f04b Mon Sep 17 00:00:00 2001
From: wente <329538422@qq.com>
Date: 星期四, 05 十二月 2024 09:39:55 +0800
Subject: [PATCH] 修改
---
modules/mainPart/src/main/java/com/zt/life/modules/mainPart/basicInfo/controller/XhProductModelController.java | 38 +++++++-------------------------------
1 files changed, 7 insertions(+), 31 deletions(-)
diff --git a/modules/mainPart/src/main/java/com/zt/life/modules/mainPart/basicInfo/controller/XhProductModelController.java b/modules/mainPart/src/main/java/com/zt/life/modules/mainPart/basicInfo/controller/XhProductModelController.java
index 7f07865..09e47a7 100644
--- a/modules/mainPart/src/main/java/com/zt/life/modules/mainPart/basicInfo/controller/XhProductModelController.java
+++ b/modules/mainPart/src/main/java/com/zt/life/modules/mainPart/basicInfo/controller/XhProductModelController.java
@@ -105,12 +105,12 @@
@GetMapping("getProductList")
public Result<List<XhProductModel>> getProductList(Long shipId, Integer productType) {
- if(productType==2){
- shipId =null;
+ if (productType == 2) {
+ shipId = null;
}
List<XhProductModel> list = xhProductModelService.getProductList(shipId, productType - 1);
- if(productType == 5){
- List<XhProductModel> list2 = xhProductModelService.getProductList(shipId, productType - 2);
+ if (productType == 5) {
+ List<XhProductModel> list2 = xhProductModelService.getProductList(shipId, productType - 2);
list.addAll(list2);
}
return Result.ok(list);
@@ -155,27 +155,7 @@
public Result insert(@RequestBody XhProductModel xhProductModel) {
//鏁堥獙鏁版嵁
ValidatorUtils.validateEntity(xhProductModel, AddGroup.class, DefaultGroup.class);
-
- Integer no = xhProductModelService.getNo(xhProductModel.getPid(), xhProductModel.getProductType());
- if (xhProductModel.getSort() == null || xhProductModel.getSort() < no) {
- xhProductModel.setSort(no + 1);
- }
- if (xhProductModel.getProductType().equals("2")) {
- Long id = UUIDUtil.generateId();
- xhProductModel.setId(id);
- xhProductModel.setShipId(id);
-
- ParamData data = new ParamData();
- data.setShipId(id);
- data.setProductId(id);
-
- paramDataService.insert(data);
- }
-
- xhProductModelService.insert(xhProductModel);
- Map<Long, XhProductModel> imgMap = new HashMap<>();
- imgMap = (Map<Long, XhProductModel>) CacheUtils.get("sysImgCache", "sysImgCache");
- imgMap.put(xhProductModel.getId(), xhProductModel);
+ xhProductModelService.insertProduct(xhProductModel);
return Result.ok();
}
@@ -202,11 +182,7 @@
public Result update(@RequestBody XhProductModel xhProductModel) {
//鏁堥獙鏁版嵁
ValidatorUtils.validateEntity(xhProductModel, UpdateGroup.class, DefaultGroup.class);
- xhProductModelService.update(xhProductModel);
- Map<Long, XhProductModel> imgMap = new HashMap<>();
- imgMap = (Map<Long, XhProductModel>) CacheUtils.get("sysImgCache", "sysImgCache");
- imgMap.put(xhProductModel.getId(), xhProductModel);
-
+ xhProductModelService.updateProduct(xhProductModel);
return Result.ok();
}
@@ -226,7 +202,7 @@
imgMap = (Map<Long, XhProductModel>) CacheUtils.get("sysImgCache", "sysImgCache");
for (Long id : ids) {
Long[] list = xhProductModelService.getByPid(id);
- if (list.length > 0){
+ if (list.length > 0) {
this.deleteByProduct(list);
}
imgMap.remove(id);
--
Gitblit v1.9.1