Jelajahi Sumber

Merge remote-tracking branch 'origin/release-201845-hejq' into release-201845-hejq

shenjunjie 7 tahun lalu
induk
melakukan
a069d7c2ae

+ 54 - 22
src/main/java/com/uas/platform/b2b/service/impl/PurchaseApCheckServiceImpl.java

@@ -165,6 +165,7 @@ public class PurchaseApCheckServiceImpl implements PurchaseApCheckService {
 		PurchaseApCheck check = purchaseApCheckDao.findOne(id);
 		if (check != null) {
 			if (!CollectionUtils.isEmpty(check.getItems()) && check.getCheckStatus().equals("不同意")) {
+			    List<String> sqls = new ArrayList<>();
 				for (PurchaseApCheckItem item : check.getItems()) {
 					item.setCheckQty(0.0);
 					Double newYCheckQtyVal = item.getOldYCheckQty();
@@ -201,8 +202,17 @@ public class PurchaseApCheckServiceImpl implements PurchaseApCheckService {
 					}
 					String sql = "update " + sourceTable + " set " + yCheckQtyName + " = " + newYCheckQtyVal + " where "
 							+ idName + " = " + sourceIdVal;
-                    commonDao.getJdbcTemplate().execute(sql);
+                    sqls.add(sql);
 				}
+                if (!CollectionUtils.isEmpty(sqls)) {
+                    try {
+                        commonDao.getJdbcTemplate().batchUpdate(sqls.toArray(new String[sqls.size()]));
+                    } catch (RuntimeException e) {
+                        System.out.println("生成对账单批量更新来源数据失败: " + e.getMessage());
+                        throw new IllegalOperatorException("保存失败!");
+                    }
+                    return true;
+                }
 			}
 			check.setCheckStatus("已作废");
 			purchaseApCheckDao.save(check);
@@ -224,6 +234,7 @@ public class PurchaseApCheckServiceImpl implements PurchaseApCheckService {
 	@Override
 	public void updateYCheckQty(List<HashMap<String, Object>> list) {
 		if (!CollectionUtils.isEmpty(list)) {
+		    List<String> sqls = new ArrayList<>();
 			for (HashMap<String, Object> map : list) {
 				Set<String> keySet = map.keySet();
 				Double newYCheckQtyVal = null;
@@ -264,9 +275,15 @@ public class PurchaseApCheckServiceImpl implements PurchaseApCheckService {
 				}
 				String sql = "update " + sourceTable + " set " + yCheckQtyName + " = " + newYCheckQtyVal + " where "
 						+ idName + " = " + sourceIdVal;
-                commonDao.getJdbcTemplate().execute(sql);
-
+				sqls.add(sql);
 			}
+            if (!CollectionUtils.isEmpty(sqls)) {
+                try {
+                    commonDao.getJdbcTemplate().batchUpdate(sqls.toArray(new String[sqls.size()]));
+                } catch (RuntimeException e) {
+                    System.out.println("生成对账单批量更新来源数据失败: " + e.getMessage());
+                }
+            }
 		}
 	}
 
@@ -329,15 +346,21 @@ public class PurchaseApCheckServiceImpl implements PurchaseApCheckService {
 		}
 		updateSourceInfo(sources);
         items = purchaseApCheckItemDao.save(items);
-		// TODO 把items转成主记录的形式
         List<PurchaseApCheck> apChecks = new ArrayList<>();
         apChecks.add(items.get(0).getApCheck());
         saveUserOrders(apChecks);
 		return purchaseApCheck;
 	}
 
+    /**
+     * 更新来源表数据
+     *
+     * @param list 来源库信息
+     * @return 保存结果
+     */
 	public boolean updateSourceInfo(List<SourceForApcheck> list) {
 		if (!CollectionUtils.isEmpty(list)) {
+		    List<String> sqls = new ArrayList<>();
 			for (SourceForApcheck source : list) {
 				if (source.hasInfo()) {
 					String idName = null;
@@ -366,12 +389,18 @@ public class PurchaseApCheckServiceImpl implements PurchaseApCheckService {
 					}
 					String sql = "update " + source.getSourcetable() + " set " + yCheckQtyName + " = "
 							+ source.getNewYCheckQty() + " where " + idName + " = " + source.getSourceid();
-                    commonDao.getJdbcTemplate().execute(sql);
-				} else {
-					throw new IllegalOperatorException("保存失败!");
+                    sqls.add(sql);
 				}
 			}
-			return true;
+			if (!CollectionUtils.isEmpty(sqls)) {
+			    try {
+			        commonDao.getJdbcTemplate().batchUpdate(sqls.toArray(new String[sqls.size()]));
+                } catch (RuntimeException e) {
+                    System.out.println("生成对账单批量更新来源数据失败: " + e.getMessage());
+                    throw new IllegalOperatorException("保存失败!");
+                }
+                return true;
+            }
 		}
 		throw new IllegalOperatorException("保存失败!");
 	}
@@ -683,21 +712,23 @@ public class PurchaseApCheckServiceImpl implements PurchaseApCheckService {
      */
     @Override
     public List<ApCheckAmount> groupCountByCurrency(List<ApCheckAmount> totalTrades) {
-        Double rmbCount = totalTrades.stream().filter(tradeCount -> RMB.equals(tradeCount.getCurrency()))
-            .mapToDouble(ApCheckAmount::getCount).sum();
-        Double usdCount = totalTrades.stream().filter(tradeCount -> USD.equals(tradeCount.getCurrency()))
-            .mapToDouble(ApCheckAmount::getCount).sum();
-        Double hkdCount = totalTrades.stream().filter(tradeCount -> HKD.equals(tradeCount.getCurrency()))
-            .mapToDouble(ApCheckAmount::getCount).sum();
         List<ApCheckAmount> resultCounts = new ArrayList<>();
-        if (rmbCount > 0) {
-            resultCounts.add(new ApCheckAmount(RMB, DecimalUtils.decimalPoint(rmbCount, 2)));
-        }
-        if (usdCount > 0) {
-            resultCounts.add(new ApCheckAmount(USD, DecimalUtils.decimalPoint(usdCount, 2)));
-        }
-        if (hkdCount > 0) {
-            resultCounts.add(new ApCheckAmount(HKD, DecimalUtils.decimalPoint(hkdCount, 2)));
+        if (null != totalTrades && !CollectionUtils.isEmpty(totalTrades)) {
+            Double rmbCount = totalTrades.stream().filter(tradeCount -> null != tradeCount && RMB.equals(tradeCount.getCurrency()))
+                .mapToDouble(ApCheckAmount::getCount).sum();
+            Double usdCount = totalTrades.stream().filter(tradeCount -> null != tradeCount && USD.equals(tradeCount.getCurrency()))
+                .mapToDouble(ApCheckAmount::getCount).sum();
+            Double hkdCount = totalTrades.stream().filter(tradeCount -> null != tradeCount && HKD.equals(tradeCount.getCurrency()))
+                .mapToDouble(ApCheckAmount::getCount).sum();
+            if (rmbCount > 0) {
+                resultCounts.add(new ApCheckAmount(RMB, DecimalUtils.decimalPoint(rmbCount, 2)));
+            }
+            if (usdCount > 0) {
+                resultCounts.add(new ApCheckAmount(USD, DecimalUtils.decimalPoint(usdCount, 2)));
+            }
+            if (hkdCount > 0) {
+                resultCounts.add(new ApCheckAmount(HKD, DecimalUtils.decimalPoint(hkdCount, 2)));
+            }
         }
         return resultCounts;
     }
@@ -841,6 +872,7 @@ public class PurchaseApCheckServiceImpl implements PurchaseApCheckService {
                 totalTrades.addAll(trades);
                 threadsSignal.countDown();
             });
+        threadsSignal.await();
         return groupCountByCurrency(totalTrades);
     }
 }

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

@@ -84,8 +84,6 @@ public class UserServiceImpl implements UserService {
 	private MailService mailService;
 	@Autowired
 	private MessageConf messageConf;
-	@Autowired
-    private UserBaseInfoDao userBaseInfoDao;
 
 	static final String TEL_REGEXP = "^((\\(\\d{3}\\))|(\\d{3}\\-))?(13|15|18|17)\\d{9}$";
 
@@ -418,7 +416,7 @@ public class UserServiceImpl implements UserService {
 		model.put("userTel", user.getUserTel());
 		model.put("rootpath", AgentUtils.getHost(request));
 		if (user.getUserEmail() != null) {
-			mailService.send(messageConf.getTplInvitationForB2B(), user.getUserEmail(), model);
+			mailService.send(messageConf.getTplAfterBeAddedtoB2B(), user.getUserEmail(), model);
 		}
 		return user;
 	}

+ 1 - 1
src/main/resources/dev/sys.properties

@@ -17,7 +17,7 @@ productServiceUrl=https://test-product.uuzcc.cn
 inquiryServiceUrl=https://test-inquiry.uuzcc.cn
 
 #message service ip
-messageServiceIp=http://10.1.51.92:24001
+messageServiceIp=http://message.ubtob.com/
 
 #search url
 searchUrl=http://188.131.128.107:24005

+ 2 - 2
src/main/resources/ptest/sys.properties

@@ -3,8 +3,8 @@ b2b=http://192.168.100.13:8080
 manage=http://manage.ubtob.com
 manageInner=http://192.168.100.13:8080
 im=http://113.105.74.140:8092
-b2c=https://rel-b2c.uuzcc.cn
-registerUrl=https://tsso.usoftchina.com/register/enterpriseRegistration
+b2c=https://rel-mall.uuzcc.cn
+registerUrl=https://rel-sso.uuzcc.cn/register/enterpriseRegistration
 
 #report url
 reportPrintUrl=http://192.168.100.8:8080/report/print?userName=B2B%s&profile=${profile}&reportName=%s&whereCondition=%s

+ 30 - 30
src/main/webapp/resources/tpl/index/account/user.html

@@ -118,24 +118,24 @@
 							class="form-control input-sm" type="text" />
 					</div>
 				</div>
-				<div class="col-xs-3">
-					<span class="title">性别</span>
-					<div class="content" ng-show="!editing"
-						ng-bind="user.userSex == 'F' ? '女' : '男'"></div>
-					<div class="content" ng-show="editing">
-						<label class="radio-inline"><input ng-model="user.userSex"
-							value="F" type="radio" /> 女 </label> <label class="radio-inline"><input
-							ng-model="user.userSex" value="M" type="radio" /> 男 </label>
-					</div>
-				</div>
-				<div class="col-xs-6">
-					<span class="title">身份证号</span>
-					<div class="content" ng-show="!editing" ng-bind="user.userIdcode"></div>
-					<div class="content" ng-show="editing">
-						<input ng-model="user.userIdcode" class="form-control input-sm"
-							type="text" />
-					</div>
-				</div>
+				<!--<div class="col-xs-3">-->
+					<!--<span class="title">性别</span>-->
+					<!--<div class="content" ng-show="!editing"-->
+						<!--ng-bind="user.userSex == 'F' ? '女' : '男'"></div>-->
+					<!--<div class="content" ng-show="editing">-->
+						<!--<label class="radio-inline"><input ng-model="user.userSex"-->
+							<!--value="F" type="radio" /> 女 </label> <label class="radio-inline"><input-->
+							<!--ng-model="user.userSex" value="M" type="radio" /> 男 </label>-->
+					<!--</div>-->
+				<!--</div>-->
+				<!--<div class="col-xs-6">-->
+					<!--<span class="title">身份证号</span>-->
+					<!--<div class="content" ng-show="!editing" ng-bind="user.userIdcode"></div>-->
+					<!--<div class="content" ng-show="editing">-->
+						<!--<input ng-model="user.userIdcode" class="form-control input-sm"-->
+							<!--type="text" />-->
+					<!--</div>-->
+				<!--</div>-->
 			</div>
 			<div class="row row-sm item">
 				<div class="col-xs-3">
@@ -264,8 +264,8 @@
 						<th width="90">UU</th>
 						<th width="120">姓名</th>
 						<th width="80">性别</th>
-						<th width="170">身份证号</th>
-						<th width="170">电话</th>
+						<!--<th width="170">身份证号</th>-->
+						<!--<th width="170">电话</th>-->
 						<th width="200">邮箱</th>
 						<th width="70">客户分配</th>
 						<th colspan="2">角色</th>
@@ -279,14 +279,14 @@
 						<td class="text-center"><input ng-model="newUser.userName"
 							class="form-control input-sm" required type="text"
 							placeholder="用户名"></td>
-						<td class="text-center"><select ng-model="newUser.userSex"
-							class="form-control input-sm" ng-init="newUser.userSex='M'">
-								<option value="F">女</option>
-								<option value="M">男</option>
-						</select></td>
-						<td class="text-center"><input ng-model="newUser.userIdcode"
-							class="form-control input-sm" type="text" placeholder="身份证号">
-						</td>
+						<!--<td class="text-center"><select ng-model="newUser.userSex"-->
+							<!--class="form-control input-sm" ng-init="newUser.userSex='M'">-->
+								<!--<option value="F">女</option>-->
+								<!--<option value="M">男</option>-->
+						<!--</select></td>-->
+						<!--<td class="text-center"><input ng-model="newUser.userIdcode"-->
+							<!--class="form-control input-sm" type="text" placeholder="身份证号">-->
+						<!--</td>-->
 						<td class="text-center"
 							ng-class="{'has-error': userTelError, 'has-success': userTelSuccess}">
 							<input ng-model="newUser.userTel"
@@ -307,8 +307,8 @@
 					<tr ng-repeat="u in $data">
 						<td class="text-center" ng-bind="::u.userUU"></td>
 						<td class="text-center" ng-bind="::u.userName"></td>
-						<td class="text-center" ng-bind="::u.userSex == 'F' ? '女' : '男'"></td>
-						<td class="text-center" ng-bind="::u.userIdcode"></td>
+						<!--<td class="text-center" ng-bind="::u.userSex == 'F' ? '女' : '男'"></td>-->
+						<!--<td class="text-center" ng-bind="::u.userIdcode"></td>-->
 						<td class="text-center" ng-bind="::u.userTel"></td>
 						<td class="text-center" ng-bind="::u.userEmail"></td>
 						<td class="text-center row-operator2">

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

@@ -214,24 +214,24 @@
 							class="form-control input-sm" type="text" />
 					</div>
 				</div>
-				<div class="col-xs-4">
-					<span class="title">性别</span>
-					<div class="content" ng-show="!editing"
-						ng-bind="user.userSex == 'F' ? '女' : '男'"></div>
-					<div class="content" ng-show="editing">
-						<label class="radio-inline"><input ng-model="user.userSex"
-							value="F" type="radio" /> 女 </label> <label class="radio-inline"><input
-							ng-model="user.userSex" value="M" type="radio" /> 男 </label>
-					</div>
-				</div>
-				<div class="col-xs-4">
-					<span class="title">身份证号</span>
-					<div class="content" ng-show="!editing" ng-bind="user.userIdcode"></div>
-					<div class="content" ng-show="editing">
-						<input ng-model="user.userIdcode" class="form-control input-sm"
-							type="text" />
-					</div>
-				</div>
+				<!--<div class="col-xs-4">-->
+					<!--<span class="title">性别</span>-->
+					<!--<div class="content" ng-show="!editing"-->
+						<!--ng-bind="user.userSex == 'F' ? '女' : '男'"></div>-->
+					<!--<div class="content" ng-show="editing">-->
+						<!--<label class="radio-inline"><input ng-model="user.userSex"-->
+							<!--value="F" type="radio" /> 女 </label> <label class="radio-inline"><input-->
+							<!--ng-model="user.userSex" value="M" type="radio" /> 男 </label>-->
+					<!--</div>-->
+				<!--</div>-->
+				<!--<div class="col-xs-4">-->
+					<!--<span class="title">身份证号</span>-->
+					<!--<div class="content" ng-show="!editing" ng-bind="user.userIdcode"></div>-->
+					<!--<div class="content" ng-show="editing">-->
+						<!--<input ng-model="user.userIdcode" class="form-control input-sm"-->
+							<!--type="text" />-->
+					<!--</div>-->
+				<!--</div>-->
 			</div>
 			<div class="row row-sm item">
 				<div class="col-xs-4">
@@ -372,12 +372,12 @@
 					<tr class="header">
 						<th width="90">UU</th>
 						<th width="120">姓名</th>
-						<th width="80">性别</th>
+						<!--<th width="80">性别</th>-->
 						<!--<th width="170">身份证号</th>-->
 						<th width="170">电话</th>
 						<th width="150">邮箱</th>
-						<th width="120">角色</th>
-						<th>&nbsp;</th>
+						<th width="200">角色</th>
+						<!--<th>&nbsp;</th>-->
 						<th width="100">客户分配</th>
 					</tr>
 				</thead>
@@ -389,12 +389,12 @@
 						<td class="text-center"><input ng-model="newUser.userName"
 							class="form-control input-sm" required type="text"
 							placeholder="用户名"></td>
-						<td class="text-center"><select ng-model="newUser.userSex"
-							class="form-control input-sm" ng-init="newUser.userSex='M'" style="width: 80px;">
-								<option value="F">女</option>
-								<option value="M">男</option>
-						</select>
-						</td>
+						<!--<td class="text-center"><select ng-model="newUser.userSex"-->
+							<!--class="form-control input-sm" ng-init="newUser.userSex='M'" style="width: 80px;">-->
+								<!--<option value="F">女</option>-->
+								<!--<option value="M">男</option>-->
+						<!--</select>-->
+						<!--</td>-->
 						<!--<td class="text-center"><input ng-model="newUser.userIdcode"
 							class="form-control input-sm" type="text" placeholder="身份证号">
 						</td>-->
@@ -418,7 +418,7 @@
 					<tr ng-repeat="u in $data">
 						<td class="text-center" ng-bind="::u.userUU"></td>
 						<td class="text-center" ng-bind="::u.userName"></td>
-						<td class="text-center" ng-bind="::u.userSex == 'F' ? '女' : '男'"></td>
+						<!--<td class="text-center" ng-bind="::u.userSex == 'F' ? '女' : '男'"></td>-->
 						<!--<td class="text-center" ng-bind="::u.userIdcode"></td>-->
 						<td class="text-center" ng-bind="::u.userTel"></td>
 						<td class="text-center" ng-bind="::u.userEmail"></td>