瀏覽代碼

代码被覆盖,重新编写

guq 7 年之前
父節點
當前提交
61b58932bf

+ 3 - 1
applications/commons/commons-server/src/main/java/com/usoftchina/saas/commons/controller/MaxnumberController.java

@@ -7,6 +7,7 @@ import com.usoftchina.saas.commons.service.MaxnumberService;
 import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.web.bind.annotation.PostMapping;
 import org.springframework.web.bind.annotation.PostMapping;
 import org.springframework.web.bind.annotation.RequestMapping;
 import org.springframework.web.bind.annotation.RequestMapping;
+import org.springframework.web.bind.annotation.RequestParam;
 import org.springframework.web.bind.annotation.RestController;
 import org.springframework.web.bind.annotation.RestController;
 
 
 import java.util.HashMap;
 import java.util.HashMap;
@@ -31,7 +32,8 @@ public class MaxnumberController {
     }
     }
 
 
     @PostMapping("/pushMaxnubmer")
     @PostMapping("/pushMaxnubmer")
-    public String pushMaxnubmer(Integer count, String code, String caller) {
+    public String pushMaxnubmer(@RequestParam("count") Integer count, @RequestParam("code") String code,
+                                @RequestParam("caller") String caller) {
         return maxnumberService.pushMaxnubmer(count, code, caller);
         return maxnumberService.pushMaxnubmer(count, code, caller);
     }
     }
 }
 }

+ 6 - 0
applications/purchase/purchase-server/src/main/resources/mapper/PurchaseMapper.xml

@@ -413,4 +413,10 @@
     </if>
     </if>
   </where>
   </where>
   </select>
   </select>
+  <select id="validateCodeWhenInsert" resultMap="int" parameterType="string" >
+    select count(1) from purchase where pu_code = #{code}
+  </select>
+  <select id="validateCodeWhenInsert" resultMap="int" >
+    select count(1) from purchase where pu_code = #{0} and pu_id != #{1}
+  </select>
 </mapper>
 </mapper>