Explorar o código

优化采购代码

java110 %!s(int64=2) %!d(string=hai) anos
pai
achega
0c8b4b0d3f

+ 2 - 2
service-store/src/main/java/com/java110/store/cmd/purchase/PurchaseApplyCmd.java

@@ -160,14 +160,14 @@ public class PurchaseApplyCmd extends Cmd {
             resourceStore.put("originalStock", resourceStore.getString("stock"));
             resourceStore.put("originalStock", resourceStore.getString("stock"));
             JSONArray timeList = resourceStore.getJSONArray("times");
             JSONArray timeList = resourceStore.getJSONArray("times");
             PurchaseApplyDetailPo purchaseApplyDetailPo = BeanConvertUtil.covertBean(resourceStore, PurchaseApplyDetailPo.class);
             PurchaseApplyDetailPo purchaseApplyDetailPo = BeanConvertUtil.covertBean(resourceStore, PurchaseApplyDetailPo.class);
-            purchaseApplyDetailPo.setPurchaseQuantity(resourceStore.getString("stock"));
+            purchaseApplyDetailPo.setPurchaseQuantity(resourceStore.getString("quantity"));
             purchaseApplyDetailPo.setId(GenerateCodeFactory.getGeneratorId(GenerateCodeFactory.CODE_PREFIX_applyOrderId));
             purchaseApplyDetailPo.setId(GenerateCodeFactory.getGeneratorId(GenerateCodeFactory.CODE_PREFIX_applyOrderId));
             //获取采购参考价格
             //获取采购参考价格
             String consultPrice = null;
             String consultPrice = null;
             if (resourceStore.containsKey("timesId") && !StringUtil.isEmpty(resourceStore.getString("timesId"))) {
             if (resourceStore.containsKey("timesId") && !StringUtil.isEmpty(resourceStore.getString("timesId"))) {
                 for (int timesIndex = 0; timesIndex < timeList.size(); timesIndex++) {
                 for (int timesIndex = 0; timesIndex < timeList.size(); timesIndex++) {
                     JSONObject times = timeList.getJSONObject(timesIndex);
                     JSONObject times = timeList.getJSONObject(timesIndex);
-                    if (times.getString("timesId").toString().equals(resourceStore.getString("timesId").toString())) {
+                    if (times.getString("timesId").equals(resourceStore.getString("timesId"))) {
                         consultPrice = times.getString("price");
                         consultPrice = times.getString("price");
                     }
                     }
                 }
                 }