Explorar o código

买卖家支付结算调整

hulh %!s(int64=8) %!d(string=hai) anos
pai
achega
fd53ba3dde

+ 12 - 1
src/main/java/com/uas/platform/b2c/fa/payment/dao/BankInfoDao.java

@@ -45,7 +45,7 @@ public interface BankInfoDao extends CrudRepository<BankInfo, Long>, JpaSpecific
 	 * @return list
 	 */
 	@Query(value = "select b from BankInfo b where b.enuu =:enuu and b.opraterUserType=:opraterUserType order by num")
-	List<BankInfo> findByEnuuAndTypeAndOpraterUserTypeOrderByNumAsc(@Param("enuu") Long enuu, @Param("opraterUserType") Integer opraterUserType);
+	List<BankInfo> findByEnuuAndOpraterUserTypeOrderByNumAsc(@Param("enuu") Long enuu, @Param("opraterUserType") Integer opraterUserType);
 
 	/**
 	 * 根据下面参数获取企业账户信息
@@ -103,6 +103,16 @@ public interface BankInfoDao extends CrudRepository<BankInfo, Long>, JpaSpecific
 	@Query("select count(b) from BankInfo b where b.enuu=:enuu and b.opraterUserType=:operateUserType and b.status in :status")
 	int getCountByEnuuAndStatus(@Param("enuu") Long enuu, @Param("operateUserType") Integer operateUserType, @Param("status") List<Integer> status);
 
+	/**
+	 * 获取平台的账户数
+	 *
+	 * @param enuu 企业enuu
+	 * @param operateUserType 操作人的类型
+	 * @return
+	 */
+	@Query("select count(b) from BankInfo b where b.enuu=:enuu and b.opraterUserType=:operateUserType and b.status=:status")
+	int getMallCountByEnuuAndStatus(@Param("enuu") Long enuu, @Param("operateUserType") Integer operateUserType, @Param("status") Integer status);
+
 	/**
 	 * 根据银行账号查询个人账号下的账户个数
 	 * @param useruu
@@ -139,4 +149,5 @@ public interface BankInfoDao extends CrudRepository<BankInfo, Long>, JpaSpecific
 	int getEnterpriseCountByNumberAndEnuu(@Param("enuu") Long enuu, @Param("opraterUserType") Integer opraterUserType,
 									 @Param("status") List<Integer> status, @Param("number") String number);
 
+	List<BankInfo> findByUseruuAndEnuuAndNumAndOpraterUserTypeAndStatus(Long useruu, Long enuu, Integer num, Integer opraterUserType, Integer status);
 }

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

@@ -227,27 +227,14 @@ public class BankInfoServiceImpl implements BankInfoService {
 	@Override
 	@Transactional
 	public BankInfo saveB2cAccount(BankInfo bankInfo, Integer operatorType, boolean isPersonal) {
-//		int size = 0;
-//		bankInfo.setOpraterUserType(Type.MALL.value());
-//		bankInfo.setEnuu(sysConf.getEnUU());
-//		bankInfo.setCreateTime(new Date());
-//		if(isPersonal) {
-//			bankInfo.setUseruu(sysConf.getAdminUU());
-//			bankInfo.setType((short)1);
-//		}else {
-//			bankInfo.setType((short)2);
-//		}
-//		if(bankInfo.getType() == 2) {
-//			size = bankInfoDao.getKindCountByEnuuAndStatus(bankInfo.getEnuu(), (short)2, Type.MALL.value(), Status.ALLOW.value());
-//		}else if(bankInfo.getType() == 1) {
-//			size = bankInfoDao.getKindCountByUseruuAndStatus(bankInfo.getUseruu(), bankInfo.getEnuu(), (short)1, Type.MALL.value(), Status.ALLOW.value());
-//		}else {
-//			new IllegalOperatorException("没有给账户设置对应的类型");
-//		}
-//		bankInfo.setNum(++size);
-//		bankInfo.setStatus(Status.ALLOW.value());
-//		return bankInfoDao.save(bankInfo);
-		return null;
+		int size = 0;
+		bankInfo.setOpraterUserType(Type.MALL.value());
+		bankInfo.setEnuu(sysConf.getEnUU());
+		bankInfo.setCreateTime(new Date());
+		size = bankInfoDao.getMallCountByEnuuAndStatus(bankInfo.getEnuu(),Type.MALL.value(), Status.ALLOW.value());
+		bankInfo.setNum(++size);
+		bankInfo.setStatus(Status.ALLOW.value());
+		return bankInfoDao.save(bankInfo);
 	}
 
 	@Override
@@ -306,8 +293,7 @@ public class BankInfoServiceImpl implements BankInfoService {
 		}else {
 			enuu = params[0];
 		}
-//		return bankInfoDao.findByEnuuAndTypeAndOpraterUserTypeOrderByNumAsc(enuu, (short)2, operatorUserType);
-		return null;
+		return bankInfoDao.findByEnuuAndOpraterUserTypeOrderByNumAsc(enuu, operatorUserType);
 	}
 
 	/**

+ 6 - 4
src/main/java/com/uas/platform/b2c/fa/payment/service/impl/BankTransferServiceImpl.java

@@ -436,10 +436,10 @@ public class BankTransferServiceImpl implements BankTransferService {
 		if (StringUtils.hasText(orderId)) {
 			Order order = orderDao.findByOrderid(orderId);
 			if (order != null && order.getBuyerenuu() != null) {
-//				List<BankInfo> bankInfos = bankInfoDao.findByUseruuAndEnuuAndNumAndTypeAndOpraterUserTypeAndStatus(order.getBuyeruu(), order.getBuyerenuu(), 1, (short) 2, Type.BUYER.value(), Status.ALLOW.value());
-//				if (!CollectionUtils.isEmpty(bankInfos)) {
-//					return bankInfos.get(0);
-//				}
+				List<BankInfo> bankInfos = bankInfoDao.findByUseruuAndEnuuAndNumAndOpraterUserTypeAndStatus(order.getBuyeruu(), order.getBuyerenuu(), 1, Type.BUYER.value(), Status.ALLOW.value());
+				if (!CollectionUtils.isEmpty(bankInfos)) {
+					return bankInfos.get(0);
+				}
 			}
 		}
 		return null;
@@ -462,6 +462,7 @@ public class BankTransferServiceImpl implements BankTransferService {
 			info.filter("operateType", type);
 			info.filter("collectenuu", SystemSession.getUser().getEnterprise().getUu());
 		}
+		info.expression(PredicateUtils.isNotNull("transferTime"));
 		filterPageInfo(info, keyword, fromDate, toDate);
 
 		Page<BankTransfer> pageBankTran = bankTransferDao.findAll(new Specification<BankTransfer>() {
@@ -496,6 +497,7 @@ public class BankTransferServiceImpl implements BankTransferService {
 			info.filter("operateType", type);
 			info.filter("collectenuu", SystemSession.getUser().getEnterprise().getUu());
 		}
+		info.expression(PredicateUtils.isNotNull("transferTime"));
 		info.sorting(Sort.Direction.DESC, "transferTime");
 		filterPageInfo(info, keyword, fromDate, toDate);
 		List<BankTransfer> list = bankTransferDao.findAll(new Specification<BankTransfer>() {

+ 1 - 1
src/main/java/com/uas/platform/b2c/fa/settlement/service/impl/SettlementServiceImpl.java

@@ -493,7 +493,7 @@ public class SettlementServiceImpl implements SettlementService {
 			transfer.setJsonPament(bankTransfer.getJsonPament());
 			transfer.setJsonReceive(bankTransfer.getJsonReceive());
 			transfer.setTranferCreateTime(new Date());
-			transfer.setTransferTime(bankTransfer.getTransferTime());
+			transfer.setTransferTime(new Date());
 			bankTransferList.add(transfer);
 
 			//转账和订单的关联信息

+ 9 - 1
src/main/webapp/resources/js/usercenter/controllers/forstore/buyer_pay_ctrl.js

@@ -182,7 +182,7 @@ define(['app/app'], function(app) {
 					toaster.pop("info", "请输入正确结束时间格式");
 					return;
 				}
-				if (!validateDate(text)){
+				if (text != '' && !validateDate(text)){
 					// $scope.endDate = text;
 					toaster.pop("info", "请输入正确结束时间格式");
 					return;
@@ -323,6 +323,14 @@ define(['app/app'], function(app) {
 		loadData();
 
 		$scope.search = function () {
+			if (!$scope.startDate && $scope.endDate){
+				toaster.pop("info", "请输入起始日期");
+				return ;
+			}
+			if ($scope.startDate && !$scope.endDate){
+				toaster.pop("info", "请输入结束日期");
+				return ;
+			}
 			loadPayHistory();
 		};
 

+ 8 - 3
src/main/webapp/resources/js/vendor/controllers/forstore/vendor_pay_ctrl.js

@@ -121,10 +121,14 @@ define(['app/app'], function(app) {
         };
 
         $scope.search = function () {
-            if (!$scope.startDate){
+            if (!$scope.startDate && $scope.endDate){
                 toaster.pop("info", "请输入起始日期");
                 return ;
             }
+            if ($scope.startDate && !$scope.endDate){
+                toaster.pop("info", "请输入结束日期");
+                return ;
+            }
             loadHistory();
         };
 
@@ -213,7 +217,7 @@ define(['app/app'], function(app) {
                     toaster.pop("info", "请输入正确结束时间格式");
                     return;
                 }
-                if (!validateDate(text)){
+                if (text != '' && !validateDate(text)){
                     // $scope.endDate = text;
                     toaster.pop("info", "请输入正确结束时间格式");
                     return;
@@ -630,7 +634,8 @@ define(['app/app'], function(app) {
                 return ;
             }
             $scope.param.page = page;
-            getData();
+            $scope.tradeRecordTableParams.page($scope.param.page);
+            $scope.tradeRecordTableParams.reload();
         };
 
         //当前页在前段的计算方式

+ 11 - 0
src/main/webapp/resources/view/admin/modal/creditCard_modal.html

@@ -69,6 +69,17 @@
 					<span ng-show="myForm.bank.$valid" class="text-success help-inline">正确</span>
 				</div>
 			</div>
+			<div class="row">
+				<label class="col-md-2"><strong class="text-inverse">* </strong>开户支行</label>
+				<div class="col-md-7">
+					<input ng-required="true" ng-model="creditCard.branchname" type="text" class="form-control" name="branch"
+						   placeholder="输入开户银行">
+				</div>
+				<div class="col-md-3">
+					<span ng-show="myForm.bank.$touched&&myForm.branch.$invalid" class="text-inverse help-inline">输入开户银行</span>
+					<span ng-show="myForm.bank.$valid" class="text-success help-inline">正确</span>
+				</div>
+			</div>
 			<div class="row">
 				<label class="col-md-2"><strong class="text-inverse">* </strong>银行账号</label>
 				<div class="col-md-7">

+ 2 - 2
src/main/webapp/resources/view/usercenter/forstore/pay_center.html

@@ -454,7 +454,7 @@
 									   class="form-control select-adder" placeholder="起始时间"
 									   datepicker-popup="yyyy-MM-dd"
 									   is-open="condition[0].open"
-									   max-date="endDate" current-text="今天" clear-text="清除" close-text="关闭"
+									   current-text="今天" clear-text="清除" close-text="关闭"
 									   datepicker-options="{formatDayTitle: 'yyyy年M月', formatMonth: 'M月', showWeeks: false}"
 									   ng-click="openDatePicker($event, condition, 0,1)"
 									   ng-blur="onDateCondition(1)"/>
@@ -467,7 +467,7 @@
 									   class="form-control select-adder" placeholder="结束时间"
 									   datepicker-popup="yyyy-MM-dd"
 									   is-open="condition[1].open"
-									   min-date="startDate" current-text="今天" clear-text="清除" close-text="关闭"
+									   current-text="今天" clear-text="清除" close-text="关闭"
 									   datepicker-options="{formatDayTitle: 'yyyy年M月', formatMonth: 'M月', showWeeks: false}"
 									   ng-click="openDatePicker($event, condition, 1, 2)"
 									   ng-change="onDateCondition(2)"/>

+ 2 - 2
src/main/webapp/resources/view/vendor/forstore/pay_center.html

@@ -645,7 +645,7 @@
                                        class="form-control select-adder" placeholder="起始时间"
                                        datepicker-popup="yyyy-MM-dd"
                                        is-open="condition[0].open"
-                                       max-date="endDate" current-text="今天" clear-text="清除" close-text="关闭"
+                                       current-text="今天" clear-text="清除" close-text="关闭"
                                        datepicker-options="{formatDayTitle: 'yyyy年M月', formatMonth: 'M月', showWeeks: false}"
                                        ng-click="openDatePicker($event, condition, 0,1)"
                                        ng-blur="onDateCondition(1)"/>
@@ -658,7 +658,7 @@
                                        class="form-control select-adder" placeholder="结束时间"
                                        datepicker-popup="yyyy-MM-dd"
                                        is-open="condition[1].open"
-                                       min-date="startDate" current-text="今天" clear-text="清除" close-text="关闭"
+                                       current-text="今天" clear-text="清除" close-text="关闭"
                                        datepicker-options="{formatDayTitle: 'yyyy年M月', formatMonth: 'M月', showWeeks: false}"
                                        ng-click="openDatePicker($event, condition, 1, 2)"
                                        ng-blur="onDateCondition(2)"/>