瀏覽代碼

Merge branch 'dev' into tenderInterface

dongbw 8 年之前
父節點
當前提交
5bfe486053

+ 11 - 2
src/main/java/com/uas/platform/b2b/erp/controller/UserSpaceDetailController.java

@@ -8,6 +8,7 @@ import com.uas.platform.b2b.erp.model.B2BVendor;
 import com.uas.platform.b2b.erp.model.PageInfo;
 import com.uas.platform.b2b.model.InvitationRecord;
 import com.uas.platform.b2b.model.SearchFilter;
+import com.uas.platform.b2b.model.User;
 import com.uas.platform.b2b.search.SearchService;
 import com.uas.platform.b2b.service.AddPartnerService;
 import com.uas.platform.b2b.service.InvitationRecordService;
@@ -110,8 +111,16 @@ public class UserSpaceDetailController {
 			} else {
 				pageParams.getFilters().put("in_enuu", SystemSession.getUser().getEnterprise().getUu());
 			}
-			if (pageInfo.getUseruu() != null && ifSelf == 1) { // 只看自己就加入自己uu过滤,查看所有就加入已激活状态,只显示已注册邀请。
-				pageParams.getFilters().put("in_useruu", pageInfo.getUseruu());
+			if (ifSelf == 1) { // 只看自己就加入自己uu过滤,查看所有就加入已激活状态,只显示已注册邀请。
+				if (pageInfo.getUseruu() != null) {
+					// 如果传入的uu在本企业找不到角色,就返回空
+					User user = userService.findUserByEnUUAndUserUU(SystemSession.getUser().getEnterprise().getUu(), pageInfo.getUseruu());
+					if (null == user) {
+						return records;
+					} else {
+						pageParams.getFilters().put("in_useruu", pageInfo.getUseruu());
+					}
+				}
 			} else {
 				pageParams.getFilters().put("in_active", Constant.YES);
 			}

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

@@ -61,6 +61,16 @@ public class B2BCustomer {
      */
     private Short customerswitch;
 
+    /**
+     * 行业
+     */
+    private String cu_industry;
+
+    /**
+     * 主营业务
+     */
+    private String cu_mainbusiness;
+
     public B2BCustomer(Vendor vendor) {
         this.setB2b_vendor_id(vendor.getId());
         this.setCustomerswitch(vendor.getCustswitch());
@@ -70,6 +80,8 @@ public class B2BCustomer {
             this.setCu_shortname(vendor.getMyEnterprise().getEnShortname());
             this.setCu_businesscode(vendor.getMyEnterprise().getEnBussinessCode());
             this.setCu_tel(vendor.getMyEnterprise().getEnTel());
+            this.setCu_mainbusiness(vendor.getMyEnterprise().getTags());
+            this.setCu_industry(vendor.getMyEnterprise().getProfession());
         }
         this.setCu_uu(String.valueOf(vendor.getMyEnUU()));
         if (vendor.getVendorUser() != null) {
@@ -172,4 +184,20 @@ public class B2BCustomer {
     public void setCustomerswitch(Short customerswitch) {
         this.customerswitch = customerswitch;
     }
+
+    public String getCu_industry() {
+        return cu_industry;
+    }
+
+    public void setCu_industry(String cu_industry) {
+        this.cu_industry = cu_industry;
+    }
+
+    public String getCu_mainbusiness() {
+        return cu_mainbusiness;
+    }
+
+    public void setCu_mainbusiness(String cu_mainbusiness) {
+        this.cu_mainbusiness = cu_mainbusiness;
+    }
 }

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

@@ -76,6 +76,16 @@ public class B2BVendor {
      */
     private Short servicerSwitch;
 
+    /**
+     * 主营业务
+     */
+    private String ve_businessrange;
+
+    /**
+     * 行业
+     */
+    private String ve_industry;
+
     public B2BVendor(Vendor vendor) {
         this.setB2b_vendor_id(vendor.getId());
         this.setVendorSwitch(vendor.getVendswitch());
@@ -86,6 +96,8 @@ public class B2BVendor {
             this.setVe_shortname(vendor.getVendorEnterprise().getEnShortname());
             this.setVe_webserver(vendor.getVendorEnterprise().getEnBussinessCode());
             this.setVe_tel(vendor.getVendorEnterprise().getEnTel());
+            this.setVe_industry(vendor.getVendorEnterprise().getProfession());
+            this.setVe_businessrange(vendor.getVendorEnterprise().getTags());
         }
         this.setVe_uu(String.valueOf(vendor.getVendEnUU()));
         if (vendor.getVendorUser() != null) {
@@ -205,4 +217,20 @@ public class B2BVendor {
     public void setVe_email(String ve_email) {
         this.ve_email = ve_email;
     }
+
+    public String getVe_businessrange() {
+        return ve_businessrange;
+    }
+
+    public void setVe_businessrange(String ve_businessrange) {
+        this.ve_businessrange = ve_businessrange;
+    }
+
+    public String getVe_industry() {
+        return ve_industry;
+    }
+
+    public void setVe_industry(String ve_industry) {
+        this.ve_industry = ve_industry;
+    }
 }

+ 50 - 22
src/main/java/com/uas/platform/b2b/model/Enterprise.java

@@ -245,29 +245,17 @@ public class Enterprise implements Serializable {
 	@Column(name = "en_prodpurc")
 	private Short prodpurc;
 
-	public String getEnManagement() {
-		return enManagement;
-	}
-
-	public void setEnManagement(String enManagement) {
-		this.enManagement = enManagement;
-	}
-
-	public String getEnProducts() {
-		return enProducts;
-	}
-
-	public void setEnProducts(String enProducts) {
-		this.enProducts = enProducts;
-	}
-
-	public String getEnInfo() {
-		return enInfo;
-	}
+	/**
+	 * 企业所属行业(注册时填写)
+	 */
+	@Column(name = "en_profession")
+	private String profession;
 
-	public void setEnInfo(String enInfo) {
-		this.enInfo = enInfo;
-	}
+	/**
+	 * 经营范围-标签
+	 */
+	@Column(name = "en_tags")
+	private String tags;
 
 	/**
 	 * en_info 公司简介
@@ -679,4 +667,44 @@ public class Enterprise implements Serializable {
 	public void setBusinesscodeimg(String businesscodeimg) {
 		this.businesscodeimg = businesscodeimg;
 	}
+
+	public String getEnManagement() {
+		return enManagement;
+	}
+
+	public void setEnManagement(String enManagement) {
+		this.enManagement = enManagement;
+	}
+
+	public String getEnProducts() {
+		return enProducts;
+	}
+
+	public void setEnProducts(String enProducts) {
+		this.enProducts = enProducts;
+	}
+
+	public String getEnInfo() {
+		return enInfo;
+	}
+
+	public void setEnInfo(String enInfo) {
+		this.enInfo = enInfo;
+	}
+
+	public String getProfession() {
+		return profession;
+	}
+
+	public void setProfession(String profession) {
+		this.profession = profession;
+	}
+
+	public String getTags() {
+		return tags;
+	}
+
+	public void setTags(String tags) {
+		this.tags = tags;
+	}
 }

+ 2 - 1
src/main/java/com/uas/platform/b2b/service/impl/PurchaseInquiryServiceImpl.java

@@ -292,7 +292,8 @@ public class PurchaseInquiryServiceImpl implements PurchaseInquiryService {
 			throw new Exception("文件太大");
 		}
 		attach = attachDao.save(attach);
-		Set<Attach> attachSet = inquiryItem.getAttaches();
+		// 避免出现无附件的情况
+		Set<Attach> attachSet = inquiryItem.getAttaches() != null ? inquiryItem.getAttaches() : new HashSet<Attach>();
 		attachSet.add(attach);
 		inquiryItem.setAttaches(attachSet);
 		inquiryItem = purchaseInquiryItemDao.save(inquiryItem);

+ 17 - 0
src/main/java/com/uas/platform/b2b/temporary/model/UserSpaceDetail.java

@@ -48,6 +48,8 @@ public class UserSpaceDetail implements Serializable {
 	private String area;
 	private String industry;
 	private String domain;
+	private String profession;
+	private String tags;
 
 	@NotEmpty(message = "{us.admin.name.null}")
 	private String adminName;
@@ -457,4 +459,19 @@ public class UserSpaceDetail implements Serializable {
 		this.current = current;
 	}
 
+	public String getProfession() {
+		return profession;
+	}
+
+	public void setProfession(String profession) {
+		this.profession = profession;
+	}
+
+	public String getTags() {
+		return tags;
+	}
+
+	public void setTags(String tags) {
+		this.tags = tags;
+	}
 }

+ 26 - 10
src/main/webapp/resources/js/index/app.js

@@ -3653,7 +3653,7 @@ define(['toaster', 'charts', 'ngTable', 'common/services', 'common/directives',
                 if ((i > 0 ? r.lapQty : 1) || r.price) {
                     replies.push(r);
                 }
-                if (i > 0 && r.lapQty <= item.replies[i - 1].lapQty) {
+                if (i > 0 && r.lapQty <= item.replies[i - 1].lapQty || r.lapQty == null) {
                     valid = false;
                     validLapQty = r.lapQty;
                 }
@@ -3661,7 +3661,11 @@ define(['toaster', 'charts', 'ngTable', 'common/services', 'common/directives',
             item.replies = replies;
             $scope.loading = true;
             if (!valid) {
-                toaster.pop('info', '提示', '分段' + validLapQty + '小于等于了上一分段数,不能保存!');
+                if (validLapQty) {
+                    toaster.pop('info', '提示', '分段' + validLapQty + '小于等于了上一分段数,不能保存!');
+                } else {
+                    toaster.pop('info', '提示', '分段数量不合法,不能保存!');
+                }
                 $scope.loading = false;
             } else {
                 var file = item.myFiles, file = file && file.length > 0 ? file[0] : null;
@@ -3854,7 +3858,11 @@ define(['toaster', 'charts', 'ngTable', 'common/services', 'common/directives',
             }, function(response) {
                 toaster.pop('error', '提示', response.data);
             });
-        }
+        };
+
+        $scope.deleteAttach = function (attaches, index) {
+            attaches.splice(index, 1);
+        };
 
         $scope.onReplyClick = function (item, withSteps) {
             if (item.vendFromDate instanceof Date) {
@@ -3871,7 +3879,7 @@ define(['toaster', 'charts', 'ngTable', 'common/services', 'common/directives',
             var valid = true;
             var validLapQty = 0;
             angular.forEach(item.replies, function (r, i) {
-                if (i > 0 && r.lapQty <= item.replies[i - 1].lapQty) {
+                if (i > 0 && r.lapQty <= item.replies[i - 1].lapQty || r.lapQty == null) {
                     valid = false;
                     validLapQty = r.lapQty;
                 }
@@ -3881,7 +3889,11 @@ define(['toaster', 'charts', 'ngTable', 'common/services', 'common/directives',
             item.replies = replies;
             $scope.loading = true;
             if (!valid) { // 不合法时给出提示
-                toaster.pop('info', '提示', '分段' + validLapQty + '小于等于了上一分段数,不能保存!');
+                if (validLapQty) {
+                    toaster.pop('info', '提示', '分段' + validLapQty + '小于等于了上一分段数,不能保存!');
+                } else {
+                    toaster.pop('info', '提示', '分段数量不合法,不能保存!');
+                }
                 $scope.loading = false;
             } else {
                 var file = item.myFiles, file = file && file.length > 0 ? file[0] : null;
@@ -3890,16 +3902,19 @@ define(['toaster', 'charts', 'ngTable', 'common/services', 'common/directives',
                     file: file,
                     method: 'POST',
                     data: {
-                        itemId: item.id
+                        item: item
+                    }
+                }).success(function (data) {
+                    if (data.item) {
+                        item = data.item;
                     }
-                }).success(function (attach) {
-
                 });
                 if (withSteps) {
                     PurcInquiry.reply({itemId: item.id, token: $scope.token}, item, function () {
                         $scope.loading = false;
                         toaster.pop('info', '提示', '报价成功');
-                        loadData();
+                        // loadData();
+                        window.location.reload();
                     }, function (response) {
                         $scope.loading = false;
                         toaster.pop('error', '询价失效', response.data);
@@ -3908,7 +3923,8 @@ define(['toaster', 'charts', 'ngTable', 'common/services', 'common/directives',
                     PurcInquiry.saveItem({itemId: item.id, token: $scope.token}, item, function () {
                         $scope.loading = false;
                         toaster.pop('info', '提示', '保存成功');
-                        loadData();
+                        // loadData();
+                        window.location.reload();
                     }, function (response) {
                         $scope.loading = false;
                         toaster.pop('error', '保存失败', response.data);

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

@@ -329,7 +329,7 @@
 						</div>
 					</div>
 					<div class="com-text col-xs-6">
-						<span class="title">企业传真</span> 
+						<span class="title">企业传真</span>
 						<div ng-show="!connectionEditing" class="content" ng-bind="::enterprise.enFax"></div>
 						<div class="content" ng-show="connectionEditing">
 							<div class="input-group input-group-xs" style="width: 320px;">

+ 4 - 0
src/main/webapp/resources/tpl/index/baseInfo/customersInfo.html

@@ -174,6 +174,10 @@
 								<div class="col-md-3"><span class="text-muted">法定代表人:</span><span ng-bind="::customer.myEnterprise.enCorporation"></span></div>
 								<div class="col-md-3"><span class="text-muted">企业UU:</span><span ng-bind="::customer.myEnterprise.uu"></span></div>
 							</div>
+							<div class="row">
+								<div ng-if="::customer.myEnterprise.profession" class="col-md-3"><span class="text-muted">行业:</span><span ng-bind="::customer.myEnterprise.profession"></span></div>
+								<div ng-if="::customer.myEnterprise.tags" class="col-md-7"><span class="text-muted">主营业务:</span><span ng-bind="::customer.myEnterprise.tags"></span></div>
+							</div>
 							<div class="row">
 								<div class="col-md-3"><span class="text-muted">联系人:</span><span ng-bind="::customer.myUser.userName"></span></div>
 								<div class="col-md-3"><span class="text-muted">电话:</span><span ng-bind="::customer.myUser.userTel"></span></div>

+ 4 - 0
src/main/webapp/resources/tpl/index/baseInfo/myRequest.html

@@ -371,6 +371,10 @@
 					<div ng-if="::request.enterprise.enCorporation" class="col-md-3"><span class="text-muted">法定代表人:</span><span ng-bind="::request.enterprise.enCorporation"></span></div>
 					<div ng-if="::request.enterprise.uu" class="col-md-4"><span class="text-muted">企业UU:</span><span ng-bind="::request.enterprise.uu"></span></div>
 				</div>
+				<div class="row">
+					<div ng-if="::request.enterprise.profession" class="col-md-3"><span class="text-muted">行业:</span><span ng-bind="::request.enterprise.profession"></span></div>
+					<div ng-if="::request.enterprise.tags" class="col-md-7"><span class="text-muted">主营业务:</span><span ng-bind="::request.enterprise.tags"></span></div>
+				</div>
 				<div class="row">
 					<div ng-if="::request.contact.userName" class="col-md-3"><span class="text-muted">联系人:</span><span ng-bind="::request.contact.userName"></span></div>
 					<div ng-if="::request.contact.userTel" class="col-md-3"><span class="text-muted">联系电话:</span><span ng-bind="::request.contact.userTel"></span></div>

+ 4 - 0
src/main/webapp/resources/tpl/index/baseInfo/newPartner.html

@@ -373,6 +373,10 @@
                 <span class="text-icon" ng-if="request.statusCode==310 && request.method==1">未通过</span>
                 <span class="text-icon" ng-if="request.statusCode==313 && request.method == 0">已同意</span>
                 <span class="text-icon" ng-if="request.statusCode==310 && request.method==0">已拒绝</span>
+                <div class="row">
+                    <div ng-if="::request.enterprise.profession" class="col-md-3"><span class="text-muted">行业:</span><span ng-bind="::request.enterprise.profession"></span></div>
+                    <div ng-if="::request.enterprise.tags" class="col-md-7"><span class="text-muted">主营业务:</span><span ng-bind="::request.enterprise.tags"></span></div>
+                </div>
                 <div class="row">
                     <div ng-if="::request.contact.userName" class="col-md-3"><span class="text-muted">联系人:</span><span ng-bind="::request.contact.userName"></span></div>
                     <div ng-if="::request.contact.userTel" class="col-md-3"><span class="text-muted">联系电话:</span><span ng-bind="::request.contact.userTel"></span></div>

+ 4 - 0
src/main/webapp/resources/tpl/index/baseInfo/searchresult.html

@@ -357,6 +357,10 @@
 				<div class="row">
 					<span class="col-md-3"><span class="text-muted">营业执照:</span><span ng-bind="::enterprise.businessCode" ></span></span>
 					<span class="col-md-3" ng-if="::enterprise.industry != null"><span class="text-muted">企业类型:</span><span class="text-muted" ng-bind="::enterprise.industry"></span></span>
+					<div ng-if="::enterprise.profession" class="col-md-3"><span class="text-muted">行业:</span><span ng-bind="::enterprise.profession"></span></div>
+				</div>
+				<div class="row">
+					<div ng-if="::enterprise.tags" class="col-md-10"><span class="text-muted">主营业务:</span><span ng-bind="::enterprise.tags"></span></div>
 				</div>
 				<div class="row">
 					<span  ng-if="::enterprise.adminName != null" class="col-md-3"><span class="text-muted">管理员:</span><em ng-bind-html="::enterprise.adminName| getkey:keyword"></em></span>

+ 4 - 0
src/main/webapp/resources/tpl/index/baseInfo/servicerInfo.html

@@ -191,6 +191,10 @@
 								<div class="col-md-3"><span class="text-muted">法定代表人:</span><span ng-bind="::vendor.vendorEnterprise.enCorporation"></span></div>
 								<div class="col-md-3"><span class="text-muted">企业UU:</span><span ng-bind="::vendor.vendorEnterprise.uu"></span></div>
 							</div>
+							<div class="row">
+								<div ng-if="::vendor.vendorEnterprise.profession" class="col-md-3"><span class="text-muted">行业:</span><span ng-bind="::vendor.vendorEnterprise.profession"></span></div>
+								<div ng-if="::vendor.vendorEnterprise.tags" class="col-md-7"><span class="text-muted">主营业务:</span><span ng-bind="::vendor.vendorEnterprise.tags"></span></div>
+							</div>
 							<div class="row">
 								<div class="col-md-3"><span class="text-muted">联系人:</span><span ng-bind="::vendor.vendorUser.userName"></span></div>
 								<div class="col-md-3"><span class="text-muted">电话:</span><span ng-bind="::vendor.vendorUser.userTel"></span></div>

+ 4 - 0
src/main/webapp/resources/tpl/index/baseInfo/vendorsInfo.html

@@ -193,6 +193,10 @@
 								<div class="col-md-3"><span class="text-muted">法定代表人:</span><span ng-bind="::vendor.vendorEnterprise.enCorporation"></span></div>
 								<div class="col-md-3"><span class="text-muted">企业UU:</span><span ng-bind="::vendor.vendorEnterprise.uu"></span></div>
 							</div>
+							<div class="row">
+								<div ng-if="::vendor.vendorEnterprise.profession" class="col-md-3"><span class="text-muted">行业:</span><span ng-bind="::vendor.vendorEnterprise.profession"></span></div>
+								<div ng-if="::vendor.vendorEnterprise.tags" class="col-md-7"><span class="text-muted">主营业务:</span><span ng-bind="::vendor.vendorEnterprise.tags"></span></div>
+							</div>
 							<div class="row">
 								<div class="col-md-3"><span class="text-muted">联系人:</span><span ng-bind="::vendor.vendorUser.userName"></span></div>
 								<div class="col-md-3"><span class="text-muted">电话:</span><span ng-bind="::vendor.vendorUser.userTel"></span></div>

+ 12 - 12
src/main/webapp/resources/tpl/index/sale/inquiry_detail.html

@@ -127,8 +127,12 @@
 						<div ng-show="inquiryItem.remark">
 							备注:{{::inquiryItem.remark}}
 						</div>
-						<div ng-if="inquiryItem.attaches.length && !inquiryItem.$editing" class="text-muted">
-							附件:<a class="file" ng-repeat="attach in inquiryItem.attaches" href="file/{{attach.id}}">{{::attach.name}}</a>
+						<div ng-if="inquiryItem.attaches.length" class="text-muted">
+							<i class="fa fa-paperclip fa-fw" style="color: #ffa340; font-size: 18px;"></i>报价附件:
+							<div ng-repeat="attach in inquiryItem.attaches">
+								<a class="file" href="file/{{attach.id}}">{{::attach.name}}&nbsp;</a>
+								<a ng-show="inquiryItem.$editing" ng-click="deleteAttach(inquiryItem.attaches, $index)" title="删除附件"><i class="fa fa-trash-o fa-lg"></i></a>
+							</div>
 						</div>
 						<div class="form-group" ng-if="inquiryItem.$editing"
 							 style="width: 150px;">
@@ -146,6 +150,12 @@
 							<span ng-if="!inquiryItem.leadtime" class="text-inverse"> 必填*</span>
 							<div style="margin-left: 50px;" class="text-bold text-inverse" ng-show="!leadtimeVerify">请填数字!</div>
 						</div>
+						<div class="input-group form-group" ng-if="inquiryItem.$editing" style="width: 100%;
+    margin-bottom: 0;position: relative;top: -14px;">
+							<div class="input-group-addon">上传附件:</div>
+							<input type="file" ng-model="inquiryItem.myFiles" ng-file-select
+								   ng-multiple="false" class="form-control input-sm input-group" name="file" style="width: 200px;    line-height: 29px;">
+						</div>
 					</td>
 					<td class="text-center">
 						<span ng-bind="::inquiryItem.product.unit"></span>
@@ -354,16 +364,6 @@
 						</div>
 					</td>
 				</tr>
-				<tr>
-					<td colspan="11" style="border-top: 0;padding-left: 61px;">
-						<div class="input-group form-group" ng-if="inquiryItem.$editing && !inquiryItem.attaches.length" style="width: 100%;
-    margin-bottom: 0;position: relative;top: -14px;">
-							<div class="input-group-addon">上传附件:</div>
-							<input type="file" ng-model="inquiryItem.myFiles" ng-file-select
-								   ng-multiple="false" class="form-control input-sm input-group" name="file" style="width: 200px;    line-height: 29px;">
-						</div>
-					</td>
-				</tr>
 				</tbody>
 			</table>
 			<!--<table class="block table table-default table-striped">-->