Parcourir la source

Merge remote-tracking branch 'origin/dev' into dev

纪新园 il y a 2 ans
Parent
commit
9f4cfe44c8

+ 25 - 0
blade-service/blade-purchase-sales/src/main/java/org/springblade/purchase/sales/service/impl/BidingServiceImpl.java

@@ -269,6 +269,31 @@ public class BidingServiceImpl extends ServiceImpl<BidingMapper, Biding> impleme
 		if (paramValue.isSuccess() && paramValue.getData() != null) {
 			if (salesBiding.getStatus() == 0 && "0".equals(paramValue.getData())){
 				throw new SecurityException("订单未请核");
+			}else if (salesBiding.getStatus() == 0 && "1".equals(paramValue.getData())){
+				if (ObjectUtil.isNotEmpty(salesBiding.getLine())){
+					//根据航线编号获得航线名称
+					R<String> lineName = dictBizClient.getValue("dominant_route", salesBiding.getLine());
+					if (lineName.isSuccess() && lineName.getData() != null){
+						//根据航线名称获得岗位
+						R<String> postIds = sysClient.getPostIds(AuthUtil.getTenantId(), lineName.getData());
+						if (postIds.isSuccess() && postIds.getData() != null){
+							//获得当前请核人的岗位
+							R<User> user = userClient.userInfoById(AuthUtil.getUserId());
+							if (user.isSuccess() && user.getData() != null){
+								if (!user.getData().getPostId().contains(postIds.getData())){
+									throw new SecurityException("当前发布人岗位没有该航线,无法发布");
+								}
+							}else {
+
+								throw new SecurityException("用户信息异常,请联系管理员");
+							}
+						}else {
+							throw new SecurityException("岗位信息异常,请联系管理员");
+						}
+					}else {
+						throw new SecurityException("航线异常,请维护航线");
+					}
+				}
 			}
 		}
 		if (salesBiding.getStatus() == 7){