Browse Source

Merge branch 'master' of ssh://10.10.101.21/source/platform-b2b into dev

hejq 7 years ago
parent
commit
ca183fc0b9

+ 7 - 1
db/ddl.sql

@@ -87,4 +87,10 @@ insert into sale$distribute (pd_distribute, pd_istransfer, pd_useruu, pd_vdid)
 and not exists (select 1 from sale$distribute where ve_id = pd_vdid);
 
 update `sale$distribute` set pd_useruu = 1000004274 where pd_useruu = 2000012807 and
-pd_vdid in (select ve_id from `purc$vendors` where ve_myenuu = 10042875);
+pd_vdid in (select ve_id from `purc$vendors` where ve_myenuu = 10042875);
+
+-- date: 2018-12-25 9:10
+-- author: hejq
+-- content: 供应商客户关系表增加对账总额字段
+alter table `purc$vendors`
+  add column apcheck_count VARCHAR(200) default '' comment '对账总额(已对账和未对账之和)';

+ 3 - 8
src/main/java/com/uas/platform/b2b/controller/UserController.java

@@ -127,14 +127,9 @@ public class UserController {
 	 */
 	@RequestMapping(value = "/emailEnable", method = RequestMethod.GET)
 	public ResponseEntity<Boolean> emailEnable(String email) {
-		if (email == null) {
-			throw new IllegalOperatorException("邮箱不能为空");
-		} else {
-			HttpHeaders headers = new HttpHeaders();
-			headers.add("Content-Type", "application/text; charset=utf-8");
-			return new ResponseEntity<Boolean>(userService.isEmailUseable(email.replaceAll("\\s*", "")), headers,
-					HttpStatus.OK);
-		}
+        HttpHeaders headers = new HttpHeaders();
+        headers.add("Content-Type", "application/text; charset=utf-8");
+        return new ResponseEntity<>(Boolean.TRUE, headers, HttpStatus.OK);
 	}
 
 	/**

+ 28 - 0
src/main/java/com/uas/platform/b2b/model/Vendor.java

@@ -179,6 +179,12 @@ public class Vendor implements Serializable {
 	@Column(name = "todo_apchek_count")
     private String totalCountString;
 
+    /**
+     * 对账总额
+     */
+	@Column(name = "apcheck_count")
+    private String countString;
+
     /**
      * 最近一次对账时间
      */
@@ -239,6 +245,12 @@ public class Vendor implements Serializable {
 	@Transient
     private List<ApCheckAmount> totalCount;
 
+    /**
+     * 对账总额
+     */
+	@Transient
+    private List<ApCheckAmount> apCheckAmounts;
+
 	public Long getId() {
 		return id;
 	}
@@ -492,6 +504,22 @@ public class Vendor implements Serializable {
         this.totalCountString = totalCountString;
     }
 
+    public String getCountString() {
+        return countString;
+    }
+
+    public void setCountString(String countString) {
+        this.countString = countString;
+    }
+
+    public List<ApCheckAmount> getApCheckAmounts() {
+        return apCheckAmounts;
+    }
+
+    public void setApCheckAmounts(List<ApCheckAmount> apCheckAmounts) {
+        this.apCheckAmounts = apCheckAmounts;
+    }
+
     public InquiryVendorInfo covert() {
 		InquiryVendorInfo info = new InquiryVendorInfo();
 		info.setB2b_id(this.id);

+ 23 - 5
src/main/java/com/uas/platform/b2b/service/PurchaseApCheckService.java

@@ -61,23 +61,26 @@ public interface PurchaseApCheckService {
 	/**
 	 * 根据ID获取生成的应收对账单
 	 * 
-	 * @param id
-	 * @return
+	 * @param id 单据id
+	 * @return 对账数据
 	 */
     PurchaseApCheck findById(Long id);
 
 	/**
 	 * 根据来源表的ID更新来源单据已转数
+     * @param list 单据数据
 	 */
     void updateYCheckQty(List<HashMap<String, Object>> list);
 
 	/**
 	 * 删除新生成的应收对账单
+     * @param id 单据id
 	 */
     void deleteApCheck(Long id);
 
 	/**
 	 * 提交生成的应收对账单
+     * @param id  单据id
 	 */
     boolean updateApCheckStatus(Long id);
 
@@ -97,6 +100,7 @@ public interface PurchaseApCheckService {
 	 * @param pageInfo
 	 * @param keyword
 	 *            查找关键字
+     * @param searchFilter 过滤条件
 	 * @return
 	 */
     Page<PurchaseApCheckTodo> findTodoByPageInfo(PageInfo pageInfo, String keyword, SearchFilter searchFilter);
@@ -107,6 +111,7 @@ public interface PurchaseApCheckService {
 	 * @param pageInfo
 	 * @param keyword
 	 *            查找关键字
+     * @param searchFilter 过滤条件
 	 * @return
 	 */
     Page<PurchaseApCheckDone> findDoneByPageInfo(PageInfo pageInfo, String keyword, SearchFilter searchFilter);
@@ -121,9 +126,9 @@ public interface PurchaseApCheckService {
 	/**
 	 * 通过sourceTable和sourceId判断是否存在未对账的单据
 	 * 
-	 * @param sourceTable
-	 * @param sourceId
-	 * @return
+	 * @param sourceTable 来源记录表
+	 * @param sourceId 来源id
+	 * @return 对账明细
 	 */
     List<PurchaseApCheckItem> findBySourceTableAndSourceId(String sourceTable, Long sourceId);
 
@@ -143,6 +148,7 @@ public interface PurchaseApCheckService {
      * @param fromDate 开始时间
      * @param endDate 截止时间
      * @return 搜索结果
+     * @throws InterruptedException
      */
     SPage<Vendor> getCustomerInfo(PageParams params, String keyword, String checkDate,  Long fromDate, Long endDate) throws InterruptedException;
 
@@ -152,9 +158,20 @@ public interface PurchaseApCheckService {
      * @param enUU 企业UU
      * @param customerUU 客户企业UU
      * @return 统计结果
+     * @throws InterruptedException 中断异常
      */
     List<ApCheckAmount> getDueTrade(Long enUU, Long customerUU) throws InterruptedException;
 
+    /**
+     * 获取总的对账金额
+     *
+     * @param vendorUU 供应商UU
+     * @param customerUU 客户UU
+     * @return 统计结果
+     * @throws InterruptedException 中断异常
+     */
+    List<ApCheckAmount> getAllApCheckAmount(Long vendorUU, Long customerUU) throws InterruptedException;
+
     /**
      * 获取指定月份应收金额(总额)
      *
@@ -164,6 +181,7 @@ public interface PurchaseApCheckService {
      * @param fromDate 开始时间
      * @param endDate 截止时间
      * @return 统计结果
+     * @throws InterruptedException 中断异常
      */
     List<ApCheckAmount> getThisMonthTrade(Long enUU, Long customerUU, String checkDate, Long fromDate, Long endDate) throws InterruptedException;
 

+ 45 - 2
src/main/java/com/uas/platform/b2b/service/impl/PurchaseApCheckServiceImpl.java

@@ -221,8 +221,6 @@ public class PurchaseApCheckServiceImpl implements PurchaseApCheckService {
 			}
 			check.setCheckStatus("已作废");
 			purchaseApCheckDao.save(check);
-			// 更新对账数据
-            updateTodoApCheckCount(check.getEnUu(), check.getCustUu(), null);
 			return true;
 		}
 		return false;
@@ -910,4 +908,49 @@ public class PurchaseApCheckServiceImpl implements PurchaseApCheckService {
         }
         return null;
     }
+
+    /**
+     * 获取总的对账金额
+     *
+     * @param vendorUU   供应商UU
+     * @param customerUU 客户UU
+     * @return 统计结果
+     */
+    @Override
+    public List<ApCheckAmount> getAllApCheckAmount(Long vendorUU, Long customerUU) throws InterruptedException {
+        List<ApCheckAmount> totalTrades = new ArrayList<>();
+        final CountDownLatch threadsSignal = new CountDownLatch(5);
+        // 货款调账
+        executor.submitTask(() -> {
+            List<ApCheckAmount> trades = commonDao.query(ApCheckAllCountSqls.ADJUSTMENT_COUNT_SQL, ApCheckAmount.class, vendorUU, customerUU);
+            totalTrades.addAll(trades);
+            threadsSignal.countDown();
+        });
+        // 采购验收
+        executor.submitTask(() -> {
+            List<ApCheckAmount> trades = commonDao.query(ApCheckAllCountSqls.SALE_ACCEPT_COUNT_SQL, ApCheckAmount.class, vendorUU, customerUU);
+            totalTrades.addAll(trades);
+            threadsSignal.countDown();
+        });
+        // 采购验退
+        executor.submitTask(() -> {
+            List<ApCheckAmount> trades = commonDao.query(ApCheckAllCountSqls.SALE_RETURN_COUNT_SQL, ApCheckAmount.class, vendorUU, customerUU);
+            totalTrades.addAll(trades);
+            threadsSignal.countDown();
+        });
+        // 委外验收
+        executor.submitTask(() -> {
+            List<ApCheckAmount> trades = commonDao.query(ApCheckAllCountSqls.MAKE_ACCEPT_COUNT_SQL, ApCheckAmount.class, vendorUU, customerUU);
+            totalTrades.addAll(trades);
+            threadsSignal.countDown();
+        });
+        // 委外验退
+        executor.submitTask(() -> {
+            List<ApCheckAmount> trades = commonDao.query(ApCheckAllCountSqls.MAKE_RETURN_COUNT_SQL, ApCheckAmount.class, vendorUU, customerUU);
+            totalTrades.addAll(trades);
+            threadsSignal.countDown();
+        });
+        threadsSignal.await();
+        return groupCountByCurrency(totalTrades);
+    }
 }

+ 1 - 6
src/main/java/com/uas/platform/b2b/service/impl/UserServiceImpl.java

@@ -380,11 +380,6 @@ public class UserServiceImpl implements UserService {
 		if (users.size() > 0) {
 			throw new IllegalOperatorException("电话号码重复,建议输入您自己的手机号");
 		}
-		List<User> users2 = userDao.findUserByUserEmail(user.getUserEmail().trim());
-		if (users2.size() > 0) {
-			throw new IllegalOperatorException("邮箱地址重复,建议输入您自己的电子邮箱地址");
-		}
-
 		try {
 			Long userUU = addUserToAccountCenter(user);
 			user.setUserUU(userUU);
@@ -405,7 +400,7 @@ public class UserServiceImpl implements UserService {
 		}
 
 		// 发送邮件
-		Map<String, Object> model = new HashMap<String, Object>();
+		Map<String, Object> model = new HashMap<>(8);
 		model.put("userName", user.getUserName());
 		model.put("userUU", user.getUserUU());
 		model.put("userEmail", user.getUserEmail());

+ 32 - 1
src/main/webapp/resources/js/index/app.js

@@ -9700,6 +9700,14 @@ define(['toaster', 'charts', 'ngTable', 'common/services', 'common/directives',
                                 }
                             })
                             list.thisMonthDoneCount = _MonthDoneCountArr
+
+                            var _apCheckAmounts = []
+                            list.apCheckAmounts && list.apCheckAmounts.forEach(function(item) {
+                                if (item.amount > 0) {
+                                    _apCheckAmounts.push(item)
+                                }
+                            })
+                            list.apCheckAmounts = _apCheckAmounts
                         })
                         if (page) {
                             params.total(page.totalElement);
@@ -9985,6 +9993,14 @@ define(['toaster', 'charts', 'ngTable', 'common/services', 'common/directives',
                         })
                         data.thisMonthDoneCount = _MonthDoneCountArr
 
+                        var _apCheckAmounts = []
+                        data.apCheckAmounts && data.apCheckAmounts.forEach(function(item) {
+                            if (item.amount > 0) {
+                                _apCheckAmounts.push(item)
+                            }
+                        })
+                        data.apCheckAmounts = _apCheckAmounts
+
                         $scope.dataInfo = data
                         $scope.data = data.details;
                         $scope.checkboxes.checked = true;
@@ -10592,6 +10608,13 @@ define(['toaster', 'charts', 'ngTable', 'common/services', 'common/directives',
                             })
                             list.thisMonthDoneCount = _MonthDoneCountArr
 
+                            var _apCheckAmounts = []
+                            list.apCheckAmounts && list.apCheckAmounts.forEach(function(item) {
+                                if (item.amount > 0) {
+                                    _apCheckAmounts.push(item)
+                                }
+                            })
+                            list.apCheckAmounts = _apCheckAmounts
                         })
                         if (page) {
                             params.total(page.totalElement);
@@ -10888,6 +10911,14 @@ define(['toaster', 'charts', 'ngTable', 'common/services', 'common/directives',
                             })
                             data.thisMonthDoneCount = _MonthDoneCountArr
 
+                            var _apCheckAmounts = []
+                            data.apCheckAmounts && data.apCheckAmounts.forEach(function(item) {
+                                if (item.amount > 0) {
+                                    _apCheckAmounts.push(item)
+                                }
+                            })
+                            data.apCheckAmounts = _apCheckAmounts
+
                             $scope.dataInfo = data
                             $scope.data = data.details;
                             $scope.checkboxes.checked = true;
@@ -25543,7 +25574,7 @@ define(['toaster', 'charts', 'ngTable', 'common/services', 'common/directives',
                     { "roleName" : "企业信息", "roleId" : "role5-1-1", 'link' : '#/approvalFlow/enterprise', "children" : [] },
                     { "roleName" : "物料信息", "roleId" : "role5-1-2", 'link' : '#/approvalFlow/product', "children" : [] },
                     { "roleName" : "我的产品库", "roleId" : "role5-1-3", 'link' : '#/approvalFlow/userProduct', "children" : [] },
-                    { "roleName" : "人员信息", "roleId" : "role5-1-4", 'link' : '#/approvalFlow/user', "children" : [] },
+                    { "roleName" : "员工管理", "roleId" : "role5-1-4", 'link' : '#/approvalFlow/user', "children" : [] },
                     { "roleName" : "角色权限", "roleId" : "role5-1-5", 'link' : '#/approvalFlow/role', "children" : [] },
                     { "roleName" : "审批流", "roleId" : "role5-1-6", 'link' : '#/approvalFlow/flow', "children" : [] },
                     { "roleName" : "操作日志", "roleId" : "role5-1-7", 'link' : '#/approvalFlow/log', "children" : [] }

+ 1 - 2
src/main/webapp/resources/tpl/index/approvalFlow/user.html

@@ -193,7 +193,7 @@
 	</div>
 </div>
 <div class="pane base-info">
-	<div class="com_head"><span>人员信息</span></div>
+	<div class="com_head"><span>员工管理</span></div>
 	<div class="title-div" style="border-bottom: 1px dashed #3f84f6;">
 		<span class="f14">我的个人资料</span>
 		<div class="pull-right">
@@ -407,7 +407,6 @@
 						<td class="text-center"
 							ng-class="{'has-error': userEmailError, 'has-success': userEmailSuccess}">
 							<input ng-model="newUser.userEmail" ng-pattern="/^\w+([-+.]\w+)*@\w+([-.]\w+)*\.\w+([-.]\w+)*$/"
-							ng-blur="emailValid(newUser.userEmail)" required
 							name="newUserEmail" class="form-control input-sm" type="text"
 							placeholder="邮箱">
 						</td>

+ 33 - 12
src/main/webapp/resources/tpl/index/fa/apCheck.html

@@ -334,11 +334,12 @@
 			<table class="order-table block order-table2" ng-table="tableParams" width="100%" style="table-layout:fixed">
 				<thead>
 					<tr class="header">
-						<th width="200">客户名称</th>
-						<th width="170">本月应收</th>
-						<th width="170">本月未对</th>
-						<th width="170">本月已对</th>
-						<th width="170">应收总额</th>
+						<th width="180">客户名称</th>
+						<th width="140">本月应收</th>
+						<th width="140">本月未对</th>
+						<th width="140">本月已对</th>
+						<!--<th width="140">本月已收</th>-->
+						<th width="140">应收总额</th>
 						<th width="80">操作</th>
 					</tr>
 				</thead>
@@ -366,6 +367,13 @@
 					</td>
 					<td ng-if="check.thisMonthDoneCount.length === 0">-</td>
 
+					<!--<td ng-if="check.apCheckAmounts.length > 0">-->
+						<!--<div ng-repeat="count in check.apCheckAmounts">-->
+							<!--<span ng-if="count.amount > 0">{{count.currency}}:{{count.amount | number:2}}</span>-->
+						<!--</div>-->
+					<!--</td>-->
+					<!--<td ng-if="check.apCheckAmounts.length === 0">-</td>-->
+
 					<td ng-if="check.totalCount.length > 0">
 						<div ng-repeat="count in check.totalCount">
 							<span ng-if="count.amount > 0">{{count.currency}}:{{count.amount | number:2}}</span>
@@ -481,7 +489,7 @@
 				</tbody>
 				<tbody ng-if="tableParams.total() == 0">
 				<tr>
-					<td colspan="6">
+					<td colspan="5">
 						<div id="empty">
 							<div class="left_img">
 								<a><img src="static/img/empty/uas_empty.png"></a>
@@ -521,27 +529,40 @@
 						</label>
 					</div>
 					<div style="text-align: left;margin-top: 20px">
-						<label>本期间对总额:</label>
+						<label>本期间对总额:</label>
 						<label style="text-align:left;vertical-align: top;">
-							<div ng-if="dataInfo.thisMonthDoneCount.length > 0" ng-repeat="count in dataInfo.thisMonthDoneCount">
+							<div ng-if="dataInfo.thisMonthTodoCount.length > 0" ng-repeat="count in dataInfo.thisMonthTodoCount">
 								<span>{{count.currency}}:{{count.amount | number:2}}</span>
 							</div>
-							<div ng-if="dataInfo.thisMonthDoneCount.length === 0">
+							<div ng-if="dataInfo.thisMonthTodoCount.length === 0">
 								0
 							</div>
 						</label>
 					</div>
 					<div style="text-align: left;margin-top: 20px">
-						<label>本期间对总额:</label>
+						<label>本期间对总额:</label>
 						<label style="text-align:left;vertical-align: top;">
-							<div ng-if="dataInfo.thisMonthTodoCount.length > 0" ng-repeat="count in dataInfo.thisMonthTodoCount">
+							<div ng-if="dataInfo.thisMonthDoneCount.length > 0" ng-repeat="count in dataInfo.thisMonthDoneCount">
 								<span>{{count.currency}}:{{count.amount | number:2}}</span>
 							</div>
-							<div ng-if="dataInfo.thisMonthTodoCount.length === 0">
+							<div ng-if="dataInfo.thisMonthDoneCount.length === 0">
 								0
 							</div>
 						</label>
 					</div>
+
+					<!--<div style="text-align: left;margin-top: 20px">-->
+						<!--<label>本期间已收总额:</label>-->
+						<!--<label style="text-align:left;vertical-align: top;">-->
+							<!--<div ng-if="dataInfo.apCheckAmounts.length > 0" ng-repeat="count in dataInfo.apCheckAmounts">-->
+								<!--<span>{{count.currency}}:{{count.amount | number:2}}</span>-->
+							<!--</div>-->
+							<!--<div ng-if="dataInfo.apCheckAmounts.length === 0">-->
+								<!--0-->
+							<!--</div>-->
+						<!--</label>-->
+					<!--</div>-->
+
 					<div style="text-align: left;margin-top: 20px">
 						<label>应收总额:</label>
 						<label style="text-align:left;vertical-align: top;">

+ 33 - 11
src/main/webapp/resources/tpl/index/fa/arCheck.html

@@ -312,11 +312,12 @@
 			<table class="order-table block order-table2" ng-table="tableParams" width="100%" style="table-layout:fixed">
 				<thead>
 				<tr class="header">
-					<th width="200">应付供应商名称</th>
-					<th width="170">本月应付</th>
-					<th width="170">本月未对</th>
-					<th width="170">本月已对</th>
-					<th width="170">应付总额</th>
+					<th width="180">应付供应商名称</th>
+					<th width="140">本月应付</th>
+					<th width="140">本月未对</th>
+					<th width="140">本月已对</th>
+					<!--<th width="140">本月已付</th>-->
+					<th width="140">应付总额</th>
 					<th width="80">操作</th>
 				</tr>
 				</thead>
@@ -344,6 +345,13 @@
 					</td>
 					<td ng-if="check.thisMonthDoneCount.length === 0">-</td>
 
+					<!--<td ng-if="check.apCheckAmounts.length > 0">-->
+						<!--<div ng-repeat="count in check.apCheckAmounts">-->
+							<!--<span ng-if="count.amount > 0">{{count.currency}}:{{count.amount | number:2}}</span>-->
+						<!--</div>-->
+					<!--</td>-->
+					<!--<td ng-if="check.apCheckAmounts.length === 0">-</td>-->
+
 					<td ng-if="check.totalCount.length > 0">
 						<div ng-repeat="count in check.totalCount">
 							<span ng-if="count.amount > 0">{{count.currency}}:{{count.amount | number:2}}</span>
@@ -447,28 +455,42 @@
 					</div>
 
 					<div style="text-align: left;margin-top: 20px">
-						<label>本期间对总额:</label>
+						<label>本期间对总额:</label>
 						<label style="text-align:left;vertical-align: top;">
-							<div ng-if="dataInfo.thisMonthDoneCount.length > 0" ng-repeat="count in dataInfo.thisMonthDoneCount">
+							<div ng-if="dataInfo.thisMonthTodoCount.length > 0" ng-repeat="count in dataInfo.thisMonthTodoCount">
 								<span>{{count.currency}}:{{count.amount | number:2}}</span>
 							</div>
-							<div ng-if="dataInfo.thisMonthDoneCount.length === 0">
+							<div ng-if="dataInfo.thisMonthTodoCount.length === 0">
 								0
 							</div>
 						</label>
 					</div>
+
 					<div style="text-align: left;margin-top: 20px">
-						<label>本期间对总额:</label>
+						<label>本期间对总额:</label>
 						<label style="text-align:left;vertical-align: top;">
-							<div ng-if="dataInfo.thisMonthTodoCount.length > 0" ng-repeat="count in dataInfo.thisMonthTodoCount">
+							<div ng-if="dataInfo.thisMonthDoneCount.length > 0" ng-repeat="count in dataInfo.thisMonthDoneCount">
 								<span>{{count.currency}}:{{count.amount | number:2}}</span>
 							</div>
-							<div ng-if="dataInfo.thisMonthTodoCount.length === 0">
+							<div ng-if="dataInfo.thisMonthDoneCount.length === 0">
 								0
 							</div>
 						</label>
 					</div>
 
+					<!--<div style="text-align: left;margin-top: 20px">-->
+						<!--<label>本期间已付总额:</label>-->
+						<!--<label style="text-align:left;vertical-align: top;">-->
+							<!--<div ng-if="dataInfo.apCheckAmounts.length > 0" ng-repeat="count in dataInfo.apCheckAmounts">-->
+								<!--<span>{{count.currency}}:{{count.amount | number:2}}</span>-->
+							<!--</div>-->
+							<!--<div ng-if="dataInfo.apCheckAmounts.length === 0">-->
+								<!--0-->
+							<!--</div>-->
+						<!--</label>-->
+					<!--</div>-->
+
+
 					<div style="text-align: left;margin-top: 20px">
 						<label>应付总额:</label>
 						<label style="text-align:left;vertical-align: top;">