wjj hai 3 semanas
pai
achega
067e705502

+ 11 - 5
fs-service/src/main/java/com/fs/his/service/impl/FsPackageOrderServiceImpl.java

@@ -670,10 +670,20 @@ public class FsPackageOrderServiceImpl implements IFsPackageOrderService
     @Transactional
     public R createOrder1(FsPackageOrderCreateParam param) {
         logger.info("创建订单传参:{}",param);
+        FsUserAddress address = null;
         FsUser user=userService.selectFsUserByUserId(param.getUserId());
         if(user.getStatus()!=1){
             return R.error("非法用户操作");
         }
+        FsUserInformationCollection collection = userInformationCollectionMapper.selectFsUserInformationCollectionById(param.getCollectionId());
+        if (collection != null) {
+            if (collection.getIsPackage() == 1 &&  !(collection.getAmount().compareTo(new BigDecimal(0))==1) && collection.getPayType() == 2) {
+                address = userAddressService.selectFsUserAddressByDefault(param.getUserId());
+                if (address == null) {
+                    return R.error("联系销售添加默认收货地址");
+                }
+            }
+        }
         FsPatient patient=null;
         FsDoctor doctor=null;
         FsPackage fsPackage=fsPackageMapper.selectFsPackageByPackageId(param.getPackageId());
@@ -814,7 +824,6 @@ public class FsPackageOrderServiceImpl implements IFsPackageOrderService
 
             //用户信息采集分享
             if(param.getCollectionId() != null) {
-                FsUserInformationCollection collection = userInformationCollectionMapper.selectFsUserInformationCollectionById(param.getCollectionId());
                 //更新用户采集信息订单表
                 if(collection != null) {
                     FsUserInformationCollection collectionUser = new FsUserInformationCollection();
@@ -842,10 +851,7 @@ public class FsPackageOrderServiceImpl implements IFsPackageOrderService
                         mapOrder.setDiscountMoney((BigDecimal)moneys.get("discountMoney"));
                         mapOrder.setPayRemain((BigDecimal)moneys.get("payRemain"));
                         //地址处理
-                        FsUserAddress address = userAddressService.selectFsUserAddressByDefault(param.getUserId());
-                        if (address == null) {
-                            return R.error("联系销售添加默认收货地址");
-                        }
+
                         Map<String, String> myMap = new HashMap<>();
                         myMap.put("userName", address.getRealName().trim());
                         myMap.put("userPhone", address.getPhone().trim());