chao 3 rokov pred
rodič
commit
527478ddc6

+ 1 - 1
src/main/java/com/caimei/modules/order/dao/NewShopOrderDao.java

@@ -46,7 +46,7 @@ public interface NewShopOrderDao extends CrudDao<NewShopOrder> {
 
 
     void updatePayShopAmount(NewShopOrder shopOrder);
     void updatePayShopAmount(NewShopOrder shopOrder);
 
 
-    List<NewShopOrder> findByShopOrderIDs(@Param("shopOrderIDs") String[] shopOrderIDs);
+    List<NewShopOrder> findByShopOrderIDs(@Param("shopOrderIDs") List<String> shopOrderIDs);
 
 
     void updatePaying(@Param("shopOrderID") String shopOrderID, @Param("paying")  String paying);
     void updatePaying(@Param("shopOrderID") String shopOrderID, @Param("paying")  String paying);
 
 

+ 4 - 1
src/main/java/com/caimei/modules/order/service/CmPayShopService.java

@@ -271,7 +271,10 @@ public class CmPayShopService extends CrudService<CmPayShopDao, CmPayShop> {
         if (StringUtil.isNoneEmpty(cmPayShop.getId())) {  //详情
         if (StringUtil.isNoneEmpty(cmPayShop.getId())) {  //详情
             List<CmPayShopRecord> payRecords = cmPayShopRecordDao.findByPayShopID(cmPayShop.getId());
             List<CmPayShopRecord> payRecords = cmPayShopRecordDao.findByPayShopID(cmPayShop.getId());
             List<String> ids = payRecords.stream().map(CmPayShopRecord::getShopOrderID).collect(Collectors.toList());
             List<String> ids = payRecords.stream().map(CmPayShopRecord::getShopOrderID).collect(Collectors.toList());
-            List<NewShopOrder> csos = newShopOrderDao.findByShopOrderIDs(ids.toArray(new String[ids.size()]));
+            List<NewShopOrder> csos = new ArrayList<>();
+            if (null != ids && ids.size() > 0) {
+                csos = newShopOrderDao.findByShopOrderIDs(ids);
+            }
             for (NewShopOrder so : csos) {
             for (NewShopOrder so : csos) {
                 CmPayShopRecord cmPayShopRecord = payRecords.stream().filter(p -> p.getShopOrderID().equals(so.getShopOrderID().toString())).findAny().get();
                 CmPayShopRecord cmPayShopRecord = payRecords.stream().filter(p -> p.getShopOrderID().equals(so.getShopOrderID().toString())).findAny().get();
                 // 供应商已退金额
                 // 供应商已退金额

+ 31 - 26
src/main/java/com/caimei/modules/order/service/NewShopOrderService.java

@@ -387,34 +387,39 @@ public class NewShopOrderService extends CrudService<NewShopOrderDao, NewShopOrd
     }
     }
 
 
     public NewShopOrder getShopOrderInfo(String shopOrderID) {
     public NewShopOrder getShopOrderInfo(String shopOrderID) {
-        String[] ids = {shopOrderID};
-        List<NewShopOrder> csos = newShopOrderDao.findByShopOrderIDs(ids);
-        NewShopOrder shopOrder = csos.get(0);
-        //统计该子订单的主的收款金额和收款状态
-        NewOrder newOrder = newOrderDao.get(shopOrder.getOrderID().toString());
-        if (null != newOrder) {
-            shopOrder.setReceiptStatus(newOrder.getReceiptStatus());
+        if (StringUtils.isNotBlank(shopOrderID)) {
+            List<String> ids = new ArrayList<>();
+            ids.add(shopOrderID);
+            List<NewShopOrder> csos = newShopOrderDao.findByShopOrderIDs(ids);
+            NewShopOrder shopOrder = csos.get(0);
+            //统计该子订单的主的收款金额和收款状态
+            NewOrder newOrder = newOrderDao.get(shopOrder.getOrderID().toString());
+            if (null != newOrder) {
+                shopOrder.setReceiptStatus(newOrder.getReceiptStatus());
+            } else {
+                shopOrder.setReceiptStatus("1");
+            }
+            Double receiptTotalFee = cmReceiptOrderRelationDao.findPayFeeByOrderID(shopOrder.getOrderID().toString());
+            shopOrder.setReceiptTotalFee(receiptTotalFee);
+            List<NewOrderProduct> orderProductList = newOrderProductDao.findByShopOrderID(shopOrder.getShopOrderID());
+            shopOrder.setNewOrderProducts(orderProductList);
+            if (shopOrder.getPayedShopAmount() == null) {
+                shopOrder.setPayedShopAmount(0D);
+            }
+            //主订单退款(退货)总金额
+            shopOrder.setReturnedPurchaseTotalFee(getOrderReturnedPurchaseFee(shopOrder));
+            //经理折扣
+            shopOrder.setDiscountTotalFee(newOrder.getDiscountFee());
+            //机构运费
+            shopOrder.setFreight(newOrder.getFreight());
+            //机构运费是否已退
+            Integer returnedFreightNum = newOrderProductDao.countReturnedFreightProduct(shopOrder.getOrderID());
+            Boolean returnedFreightFlag = returnedFreightNum == null ? false : returnedFreightNum > 0 ? true : false;
+            shopOrder.setReturnedFreightFlag(returnedFreightFlag);
+            return shopOrder;
         } else {
         } else {
-            shopOrder.setReceiptStatus("1");
+            return new NewShopOrder();
         }
         }
-        Double receiptTotalFee = cmReceiptOrderRelationDao.findPayFeeByOrderID(shopOrder.getOrderID().toString());
-        shopOrder.setReceiptTotalFee(receiptTotalFee);
-        List<NewOrderProduct> orderProductList = newOrderProductDao.findByShopOrderID(shopOrder.getShopOrderID());
-        shopOrder.setNewOrderProducts(orderProductList);
-        if (shopOrder.getPayedShopAmount() == null) {
-            shopOrder.setPayedShopAmount(0D);
-        }
-        //主订单退款(退货)总金额
-        shopOrder.setReturnedPurchaseTotalFee(getOrderReturnedPurchaseFee(shopOrder));
-        //经理折扣
-        shopOrder.setDiscountTotalFee(newOrder.getDiscountFee());
-        //机构运费
-        shopOrder.setFreight(newOrder.getFreight());
-        //机构运费是否已退
-        Integer returnedFreightNum = newOrderProductDao.countReturnedFreightProduct(shopOrder.getOrderID());
-        Boolean returnedFreightFlag = returnedFreightNum == null ? false : returnedFreightNum > 0 ? true : false;
-        shopOrder.setReturnedFreightFlag(returnedFreightFlag);
-        return shopOrder;
     }
     }
 
 
     public Page<NewOrder> findPaymentOrderList(Page<NewOrder> page, NewOrder newOrder) {
     public Page<NewOrder> findPaymentOrderList(Page<NewOrder> page, NewOrder newOrder) {

+ 7 - 5
src/main/resources/mappings/modules/order/ShopOrderMapper.xml

@@ -67,7 +67,7 @@
     		a.orderPromotionsId AS orderPromotionsId,
     		a.orderPromotionsId AS orderPromotionsId,
     		a.differenceType AS differenceType,
     		a.differenceType AS differenceType,
     		a.differencePrice AS differencePrice,
     		a.differencePrice AS differencePrice,
-    		proportional AS proportional,
+    		a.proportional AS proportional,
     		a.promotionFullReduction As promotionFullReduction,
     		a.promotionFullReduction As promotionFullReduction,
     		a.zeroCostFlag AS zeroCostFlag
     		a.zeroCostFlag AS zeroCostFlag
 	</sql>
 	</sql>
@@ -867,10 +867,12 @@
 		left join cm_order co on co.orderID = a.orderID
 		left join cm_order co on co.orderID = a.orderID
 		left join shop s on s.shopID = a.shopID
 		left join shop s on s.shopID = a.shopID
 		left join club c on c.userID = a.userID
 		left join club c on c.userID = a.userID
-		where a.shopOrderID in
-		<foreach collection="shopOrderIDs" separator="," item="shopOrderID" open="(" close=")">
-			#{shopOrderID}
-		</foreach>
+		<if test="shopOrderIDs != null and shopOrderIDs.size() > 0">
+			where a.shopOrderID in
+			<foreach collection="shopOrderIDs" separator="," item="shopOrderID" open="(" close=")">
+				#{shopOrderID}
+			</foreach>
+		</if>
 	</select>
 	</select>
 
 
 	<update id="updatePaying">
 	<update id="updatePaying">