瀏覽代碼

订单优化

大大的豆芽 3 周之前
父節點
當前提交
fb38469a0d

+ 7 - 1
yiqi-core/src/main/java/com/yiqi/order/service/impl/OrderClothServiceImpl.java

@@ -976,6 +976,12 @@ public class OrderClothServiceImpl extends ServiceImpl<OrderClothMapper, OrderCl
         orderCloth.setPayStatus(PayStatus.WAITING_TO_PAY.getCode());
         // 取衣方式
         orderCloth.setSendClothWay(orderClothDTO.getSendClothWay());
+        //
+        if (StringUtils.isEmpty(orderCloth.getContactPhone()) && orderCloth.getAppUserId() != null) {
+            AppUser appUser = appUserService.getById(orderCloth.getAppUserId());
+            orderCloth.setContactPhone(appUser.getPhoneNumber());
+            orderCloth.setContactName(appUser.getRealName());
+        }
     }
 
     /**
@@ -1009,7 +1015,7 @@ public class OrderClothServiceImpl extends ServiceImpl<OrderClothMapper, OrderCl
             }
             orderCloth.setFactoryId(sysStore.getFactoryId());
         } else {
-            orderCloth.setFactoryId(SecurityUtils.getLoginUser().getOrgId());
+            throw new ServiceException("工厂没有权限");
         }
     }
 

+ 2 - 2
yiqi-core/src/main/resources/mapper/order/OrderClothItemMapper.xml

@@ -616,10 +616,10 @@
             and cl.factory_id = #{factoryId}
         </if>
         <if test="appUserName != null and appUserName != ''">
-            and cl.app_user_name = #{appUserName}
+            and cl.contact_name = #{appUserName}
         </if>
         <if test="appUserPhoneNumber != null and appUserPhoneNumber != ''">
-            and cl.app_user_phone_number = #{appUserPhoneNumber}
+            and cl.contact_phone = #{appUserPhoneNumber}
         </if>
         <if test="washCode != null and washCode != ''">
             and item.wash_code = #{washCode}