Procházet zdrojové kódy

Merge remote-tracking branch 'origin/release-201824-wangcz' into release-201824-wangcz

wangcz před 7 roky
rodič
revize
abd3fd6d2a

+ 7 - 5
src/main/java/com/uas/platform/b2c/fa/payment/service/impl/BankInfoServiceImpl.java

@@ -243,12 +243,14 @@ public class BankInfoServiceImpl implements BankInfoService {
 			bankInfos = bankInfoDao.findByUseruuAndAccountTypeAndDissociativeAndStatusOrderByNumAsc(baInfo.getUseruu(), baInfo.getAccountType(), baInfo.getDissociative(), Status.ALLOW.value());
 		} else {
 			bankInfos = bankInfoDao.findSupBankList(baInfo.getEnuu(), baInfo.getDissociative(), baInfo.getAccountType(), statusList);
-			BankInfo firstItem = bankInfos.get(0);
-			if (firstItem.getStatus() == Status.ALLOW.value()){
-				firstItem.setStatus(Status.EXPIRED.value());
+			if (AccountType.RECEIVE_TYPE.equals(baInfo.getAccountType())) {
+				BankInfo firstItem = bankInfos.get(0);
+				if (firstItem.getStatus() == Status.ALLOW.value()){
+					firstItem.setStatus(Status.EXPIRED.value());
+				}
+				baInfo.setStatus(Status.ALLOW.value());
+				bankInfoDao.save(baInfo);
 			}
-			baInfo.setStatus(Status.ALLOW.value());
-			bankInfoDao.save(baInfo);
 		}
 		setDefaultAccountAssist(bankInfos, id);
 	}

+ 4 - 6
src/main/java/com/uas/platform/b2c/logistics/dao/AddressDao.java

@@ -21,12 +21,11 @@ public interface AddressDao extends JpaSpecificationExecutor<Address>, JpaReposi
 	 * 根据uu号,类型 查找收货地址
 	 *
 	 * @param useruu  the useruu 个人uu
-	 * @param enuu    the enuu 企业uu
 	 * @param type    the type 类型,发货,收货
 	 * @param usetype the usetype 使用类型,1 个人,2 企业
 	 * @return list 返回查找的address列表
 	 */
-	public List<Address> findByUseruuAndEnuuAndTypeAndUsetypeOrderByNumAsc(Long useruu, Long enuu, Integer type, Short usetype);
+	public List<Address> findByUseruuAndTypeAndUsetypeOrderByNumAsc(Long useruu, Integer type, Short usetype);
 
 	/**
 	 * 根据uu号,enuu为空类型 查找收货地址
@@ -34,11 +33,10 @@ public interface AddressDao extends JpaSpecificationExecutor<Address>, JpaReposi
 	 * @param useruu       the useruu 个人uu
 	 * @param type         the type 类型 发货,收货
 	 * @param usetype      the usetype 使用类型,1 个人,2 企业
-	 * @param dissociative the dissociative 是否个人用户
 	 * @return list 返回查找的address列表
 	 */
 //	@Query("select a from Address a where a.useruu=:useruu and a.enuu is null and a.type=:type and a.usetype=:usetype")
-	public List<Address> findByUseruuAndTypeAndUsetypeAndDissociative(Long useruu, Integer type, Short usetype, Integer dissociative);
+	List<Address> findByUseruuAndTypeAndUsetype(Long useruu, Integer type, Short usetype);
 
 	/**
 	 * 根据企业uu号,类型查询平台收货地址
@@ -48,7 +46,7 @@ public interface AddressDao extends JpaSpecificationExecutor<Address>, JpaReposi
 	 * @param usertype the usertype 使用类型
 	 * @return list 返回查找的address列表
 	 */
-	public List<Address> findByEnuuAndTypeAndUsetypeOrderByNumAsc(Long enuu, Integer type, Short usertype);
+	List<Address> findByEnuuAndTypeAndUsetypeOrderByNumAsc(Long enuu, Integer type, Short usertype);
 
 	/**
 	 * 根据企业uu号默认地址,类型查询平台收货地址
@@ -59,7 +57,7 @@ public interface AddressDao extends JpaSpecificationExecutor<Address>, JpaReposi
 	 * @param usertype the usertype 使用类型
 	 * @return list 返回查找的address列表
 	 */
-	public List<Address> findByEnuuAndTypeAndNumAndUsetypeOrderByNumAsc(Long enuu, Integer type, Integer num, Short usertype);
+	List<Address> findByEnuuAndTypeAndNumAndUsetypeOrderByNumAsc(Long enuu, Integer type, Integer num, Short usertype);
 
 	/**
 	 * 2016年5月4日 下午8:11:30

+ 9 - 14
src/main/java/com/uas/platform/b2c/logistics/service/impl/AddressServiceImpl.java

@@ -2,6 +2,7 @@ package com.uas.platform.b2c.logistics.service.impl;
 
 import com.uas.platform.b2c.common.account.model.User;
 import com.uas.platform.b2c.core.config.SysConf;
+import com.uas.platform.b2c.core.constant.ShortConstant;
 import com.uas.platform.b2c.core.support.SystemSession;
 import com.uas.platform.b2c.logistics.dao.AddressDao;
 import com.uas.platform.b2c.logistics.model.Address;
@@ -43,7 +44,7 @@ public class AddressServiceImpl implements AddressService {
 			int type = address.getType();
 			short usertype = address.getUsetype();
 			if(usertype == 1) {//个人地址信息
-				addresses = addressDao.findByUseruuAndEnuuAndTypeAndUsetypeOrderByNumAsc(address.getUseruu(), address.getEnuu(), type, (short)1);
+				addresses = addressDao.findByUseruuAndTypeAndUsetypeOrderByNumAsc(address.getUseruu(), type, (short)1);
 			}else {//企业的地址信息
 				addresses = addressDao.findByEnuuAndTypeAndUsetypeOrderByNumAsc(address.getEnuu(), type, (short)2);
 			}
@@ -76,8 +77,9 @@ public class AddressServiceImpl implements AddressService {
 		Long useruu = address.getUseruu();
 		int type = address.getType();
 		List<Address> addresses = null;
-		if (Type.Address_Shipping_Code.value() == address.getType()) {
-			addresses = addressDao.findByUseruuAndEnuuAndTypeAndUsetypeOrderByNumAsc(useruu, address.getEnuu(), type, (short)1);
+		if (address.getUsetype().equals(ShortConstant.YES_SHORT)) {
+			//个人账户
+			addresses = addressDao.findByUseruuAndTypeAndUsetypeOrderByNumAsc(useruu, type, (short)1);
 		} else {
 			addresses = addressDao.findByEnuuAndTypeAndUsetypeOrderByNumAsc(address.getEnuu(), type, (short)2);
 		}
@@ -180,18 +182,11 @@ public class AddressServiceImpl implements AddressService {
 	@Override
 	public List<Address> findShipingAdd(Long useruu, Boolean send, Long enuu) {
 		List<Address> address = new ArrayList<Address>();
-		if (send) {
-			if (enuu != null) {
-				address = addressDao.findByEnuuAndTypeAndUsetypeOrderByNumAsc(enuu, Type.Address_Sending_Code.value(), (short)2);
-			} else {
-				address = addressDao.findByUseruuAndTypeAndUsetypeAndDissociative(useruu, Type.Address_Sending_Code.value(), (short)2, Type.PERSONAL.value());
-			}
+		Integer type = send ? Type.Address_Sending_Code.value() :Type.Address_Shipping_Code.value();
+		if (enuu != null) {
+			address = addressDao.findByEnuuAndTypeAndUsetypeOrderByNumAsc(enuu, type, (short)2);
 		} else {
-			if (enuu != null) {
-				address = addressDao.findByUseruuAndEnuuAndTypeAndUsetypeOrderByNumAsc(useruu, enuu, Type.Address_Shipping_Code.value(), (short) 1);
-			} else {
-				address = addressDao.findByUseruuAndTypeAndUsetypeAndDissociative(useruu, Type.Address_Shipping_Code.value(), (short)1, Type.PERSONAL.value());
-			}
+			address = addressDao.findByUseruuAndTypeAndUsetype(useruu, type, (short)1);
 		}
 		return address;
 	}

+ 4 - 3
src/main/webapp/resources/view/usercenter/forstore/seekPurchase.html

@@ -1182,7 +1182,7 @@
                 <th width="260">品牌/物料名称</th>
                 <th width="260">型号/规格</th>
                 <th width="110">采购数量(PCS)</th>
-                <th width="120">状态/截止{{tab == 'waitOffer' ? '时间' : '日期'}}</th>
+                <th width="120">截止日期</th>
                 <th width="140">操作</th>
             </tr>
             </thead>
@@ -1224,12 +1224,13 @@
                     <div class="row-wrap">
                         <!--<div ng-bind="seek.endDate | date:'yyyy-MM-dd'"></div>
                         <div class="date-bottom-item" ng-bind="seek.endDate | date:'HH:mm:ss'"></div>-->
-                        <span ng-if="seek.offerAmount == 0" style="color:red;">待报价</span>
+                        <!--<span ng-if="seek.offerAmount == 0" style="color:red;">待报价</span>-->
                         <span ng-if="seek.agreed == 0 && seek.offerAmount > 0">已报价</span>
                         <span ng-if="seek.agreed == 1" style="color:green;">已采纳</span>
                         <div ng-if="tab == 'offered'" class="date-bottom-item" ng-bind="seek.endDate | date:'yyyy-MM-dd'"></div>
                         <div ng-if="tab == 'waitOffer'">
-                            <div class="remain" ng-if="seek.remainingTime > 0">剩余&nbsp;<span ng-bind="getDay(seek.remainingTime)" ng-if="getDay(seek.remainingTime) > 0" class="red-text"></span><i ng-if="getDay(seek.remainingTime) > 0">&nbsp;天&nbsp;</i><span ng-if="getDay(seek.remainingTime) <= 0" ng-bind="getHours(seek.remainingTime)" class="red-text">5</span><i ng-if="getDay(seek.remainingTime) <= 0">&nbsp;小时</i></div>
+                            <!--<div class="remain" ng-if="seek.remainingTime > 0">剩余&nbsp;<span ng-bind="getDay(seek.remainingTime)" ng-if="getDay(seek.remainingTime) > 0" class="red-text"></span><i ng-if="getDay(seek.remainingTime) > 0">&nbsp;天&nbsp;</i><span ng-if="getDay(seek.remainingTime) <= 0" ng-bind="getHours(seek.remainingTime)" class="red-text">5</span><i ng-if="getDay(seek.remainingTime) <= 0">&nbsp;小时</i></div>-->
+                            <div class="date-bottom-item" ng-if="seek.remainingTime > 0" ng-bind="seek.endDate | date:'yyyy-MM-dd'"></div>
                             <div class="remain" ng-if="seek.remainingTime <= 0"><span>已截止</span></div>
                             <div class="remain" ng-if="seek.remainingTime == null"><span>-</span></div>
                         </div>