gydx_2024_lyh 2 months ago
parent
commit
53bf37159d

+ 3 - 0
src/main/java/com/gydx/controller/RuleManagementController.java

@@ -1,6 +1,7 @@
 package com.gydx.controller;
 
 
+import com.gydx.demo.SetId;
 import com.gydx.service.RuleManagementService;
 import com.gydx.vo.FoodRuleVO;
 import org.springframework.beans.factory.annotation.Autowired;
@@ -19,6 +20,8 @@ public class RuleManagementController {
 
     @RequestMapping("/addRule")
     public void addRule(FoodRuleVO foodRuleVO) {
+        SetId setId = new SetId();
+        foodRuleVO.setFoodRuleID(setId.RRRRule());
         ruleManagementService.addRule(foodRuleVO);
     }
     @RequestMapping("/deleteRule")

+ 7 - 0
src/main/java/com/gydx/demo/SetId.java

@@ -11,4 +11,11 @@ public class SetId {
         return prefix + number;
     }
 
+    public String RRRRule() {
+        String prefix = "R";
+        Random random = new Random();
+        int number = random.nextInt(900000) + 100000;
+        return prefix + number;
+    }
+
 }

+ 1 - 1
src/main/java/com/gydx/mapper/VendorManagementMapper.java

@@ -15,6 +15,6 @@ public interface VendorManagementMapper {
 
     public void deleteSupplier(FoodSupplierVO foodSupplierVO);
 
-    public List<FoodSupplierVO> querySupplier(FoodSupplierVO foodSupplierVO);
+    public List querySupplier(FoodSupplierVO foodSupplierVO);
 
 }

+ 1 - 1
src/main/resources/mapper/RuleManagementMapper.xml

@@ -19,7 +19,7 @@
             RoundSpacingTime = case when #{RoundSpacingTime} is not null then #{RoundSpacingTime} else RoundSpacingTime end where FoodRuleID = #{FoodRuleID}
     </update>
     <delete id="deleteRule">
-        delete from FoodRule where FoodRuleId = #{FoodRuleID}
+        delete from FoodRule where FoodRuleID = #{FoodRuleID}
     </delete>
     <select id="queryRule" resultMap="rulerm">
         select * from FoodRule

+ 1 - 1
src/main/resources/mapper/VendorManagementMapper.xml

@@ -25,6 +25,6 @@
 
 
     <select id="querySupplier" resultMap="rmlyh" parameterMap="pmlyh">
-        select * from FoodSupplier
+        select item.FoodSupplierName,item.FoodSupplierLink,item.FoodSupplierStatus,item.FoodSupplierID from FoodSupplier item
     </select>
 </mapper>