Browse Source

fix:更新代码

Eternity 5 months ago
parent
commit
404596b28e

+ 2 - 0
ruoyi-modules/ruoyi-commodityManagement/src/main/java/org/dromara/commodityManagement/controller/DaHuoNumberController.java

@@ -1,6 +1,7 @@
 package org.dromara.commodityManagement.controller;
 
 
+import cn.dev33.satoken.annotation.SaIgnore;
 import cn.hutool.core.collection.CollUtil;
 import jakarta.servlet.http.HttpServletResponse;
 import lombok.RequiredArgsConstructor;
@@ -24,6 +25,7 @@ import java.util.HashMap;
 /**
  * 大货编号管理接口
  */
+@SaIgnore
 @RestController
 @RequiredArgsConstructor
 @RequestMapping("/commodityManagement/daHuoNumber")

+ 19 - 1
ruoyi-modules/ruoyi-dataManagement/src/main/java/org/dromara/dataManagement/controller/SupplierController.java

@@ -11,9 +11,11 @@ import org.dromara.common.mybatis.core.page.PageQuery;
 import org.dromara.common.mybatis.core.page.TableDataInfo;
 import org.dromara.common.web.core.BaseController;
 import org.dromara.dataManagement.domain.bo.SupplierBo;
+import org.dromara.dataManagement.domain.bo.WorkShopBo;
 import org.dromara.dataManagement.domain.vo.SupplierExcelVo;
 import org.dromara.dataManagement.domain.vo.SupplierVo;
 import org.dromara.dataManagement.service.SupplierService;
+import org.springframework.validation.annotation.Validated;
 import org.springframework.web.bind.annotation.*;
 import org.springframework.web.multipart.MultipartFile;
 
@@ -37,6 +39,14 @@ public class SupplierController extends BaseController {
         return supplierService.selectPageSupplierList(supplierBo, pageQuery);
     }
 
+    /**
+     * 新增供应商信息
+     */
+    @PostMapping
+    public R<Void> insertSupplier(@RequestBody SupplierBo supplierBo){
+        return toAjax(supplierService.insertSupplier(supplierBo));
+    }
+
     /**
      * 下载供应商导入模版
      */
@@ -63,7 +73,15 @@ public class SupplierController extends BaseController {
      */
     @DeleteMapping("/delete/{ids}")
     public R<Void> deleteSupplierByIds(@PathVariable("ids") List<Integer> supplyertypeId) {
-        return toAjax(supplierService.deleteRecycleFactoryByIds(supplyertypeId));
+        if(supplierService.deleteRecycleFactoryByIds(supplyertypeId) > 0){
+            return R.ok();
+        }
+        return R.fail("不存在此工厂或此工厂已被删除");
+    }
+
+    @PutMapping
+    public R<Void> updateSupplier(@Validated @RequestBody SupplierBo supplierBo){
+        return toAjax(supplierService.updateSupplier(supplierBo));
     }
 
 }

+ 1 - 1
ruoyi-modules/ruoyi-dataManagement/src/main/java/org/dromara/dataManagement/domain/Supplier.java

@@ -61,7 +61,7 @@ public class Supplier extends TenantEntity {
     private double needGiveAccount;
 
     /**
-     * 状态
+     * 状态:0=关闭,1=正常
      */
     private String status;
 

+ 5 - 1
ruoyi-modules/ruoyi-dataManagement/src/main/java/org/dromara/dataManagement/domain/bo/SupplierBo.java

@@ -2,6 +2,7 @@ package org.dromara.dataManagement.domain.bo;
 
 
 import io.github.linpeilie.annotations.AutoMapper;
+import jakarta.validation.constraints.NotBlank;
 import lombok.Data;
 import lombok.EqualsAndHashCode;
 import org.dromara.common.mybatis.core.domain.BaseEntity;
@@ -20,16 +21,19 @@ public class SupplierBo extends BaseEntity {
     /**
      * 供应商编号
      */
+    @NotBlank(message = "供应商编号不能为空")
     private String supplyerCode;
 
     /**
      * 供应商名称
      */
+    @NotBlank(message = "供应商名称不能为空")
     private String supplyerName;
 
     /**
      * 首要联系人
      */
+    @NotBlank(message = "请完善联系人信息")
     private String firstConnectName;
 
     /**
@@ -63,7 +67,7 @@ public class SupplierBo extends BaseEntity {
     private double needGiveAccount;
 
     /**
-     * 状态
+     * 状态:0=关闭,1=正常
      */
     private String status;
 

+ 1 - 1
ruoyi-modules/ruoyi-dataManagement/src/main/java/org/dromara/dataManagement/domain/vo/SupplierVo.java

@@ -74,7 +74,7 @@ public class SupplierVo extends BaseEntity {
     private double needGiveAccount;
 
     /**
-     * 状态
+     * 状态:0=关闭,1=正常
      */
     @ExcelProperty(value = "状态", order = 11)
     private String status;

+ 4 - 0
ruoyi-modules/ruoyi-dataManagement/src/main/java/org/dromara/dataManagement/service/SupplierService.java

@@ -16,5 +16,9 @@ public interface SupplierService {
 
     int deleteRecycleFactoryByIds(List<Integer> supplyertypeId);
 
+    int insertSupplier(SupplierBo supplierBo);
+
     void insertImportExcel(ExcelResult<SupplierExcelVo> result);
+
+    int updateSupplier(SupplierBo supplierBo);
 }

+ 34 - 7
ruoyi-modules/ruoyi-dataManagement/src/main/java/org/dromara/dataManagement/service/impl/SupplierServiceImpl.java

@@ -9,6 +9,7 @@ import org.dromara.common.excel.core.ExcelResult;
 import org.dromara.common.mybatis.core.page.PageQuery;
 import org.dromara.common.mybatis.core.page.TableDataInfo;
 import org.dromara.dataManagement.domain.Supplier;
+import org.dromara.dataManagement.domain.WorkShop;
 import org.dromara.dataManagement.domain.bo.SupplierBo;
 import org.dromara.dataManagement.domain.vo.SupplierExcelVo;
 import org.dromara.dataManagement.domain.vo.SupplierVo;
@@ -16,7 +17,6 @@ import org.dromara.dataManagement.mapper.SupplierMapper;
 import org.dromara.dataManagement.service.SupplierService;
 import org.springframework.stereotype.Service;
 
-import java.util.ArrayList;
 import java.util.List;
 
 
@@ -44,15 +44,14 @@ public class SupplierServiceImpl implements SupplierService {
     }
 
     /**
-     * 批量删除供应商信息
-     * @param supplyertypeId
+     * 新增供应商信息
+     * @param supplierBo
      * @return
      */
     @Override
-    public int deleteRecycleFactoryByIds(List<Integer> supplyertypeId) {
-        QueryWrapper<Supplier> qw = new QueryWrapper<>();
-        qw.in("supplyertype_id",supplyertypeId);
-        return supplierMapper.delete(qw);
+    public int insertSupplier(SupplierBo supplierBo) {
+        Supplier supplier = MapstructUtils.convert(supplierBo, Supplier.class);
+        return supplierMapper.insert(supplier);
     }
 
     /**
@@ -61,7 +60,35 @@ public class SupplierServiceImpl implements SupplierService {
      */
     @Override
     public void insertImportExcel(ExcelResult<SupplierExcelVo> result) {
+        for (SupplierExcelVo supplierExcelVo : result.getList()){
+            Supplier supplier = MapstructUtils.convert(supplierExcelVo, Supplier.class);
+            supplierMapper.insert(supplier);
+        }
+    }
 
+    /**
+     * 修改供应商信息
+     * @param supplierBo
+     * @return
+     */
+    @Override
+    public int updateSupplier(SupplierBo supplierBo) {
+        Supplier supplier = MapstructUtils.convert(supplierBo,Supplier.class);
+        QueryWrapper<Supplier> qw = new QueryWrapper<>();
+        qw.eq("supplyertype_id",supplierBo.getSupplyertypeId());
+        return supplierMapper.updateById(supplier);
+    }
 
+    /**
+     * 批量删除供应商信息
+     * @param supplyertypeId
+     * @return
+     */
+    @Override
+    public int deleteRecycleFactoryByIds(List<Integer> supplyertypeId) {
+        QueryWrapper<Supplier> qw = new QueryWrapper<>();
+        qw.in("supplyertype_id",supplyertypeId);
+        return supplierMapper.delete(qw);
     }
+
 }

+ 3 - 3
ruoyi-modules/ruoyi-productionManagementOfBulkOrders/src/main/java/org/dromara/productionManagement/controller/ShaoHuaFactoryController.java

@@ -54,7 +54,7 @@ public class ShaoHuaFactoryController extends BaseController {
     }
 
     /**
-     * 删除烧花工厂信息
+     * 删除烧花工厂信息(放入回收站/软删除)
      * @param ids
      * @return
      */
@@ -97,7 +97,7 @@ public class ShaoHuaFactoryController extends BaseController {
     }
 
     /**
-     * 回收站删除(id删除)
+     * 回收站删除(id删除/硬删除
      * @param ids
      * @return
      */
@@ -111,7 +111,7 @@ public class ShaoHuaFactoryController extends BaseController {
     }
 
     /**
-     * 回收站删除(全部删除)
+     * 回收站删除(全部删除/硬删除
      * @return
      */
     @DeleteMapping("recycle/all")