Browse Source

我的产品库功能方法更新

hejq 8 years ago
parent
commit
e37d5630f7

+ 1 - 1
src/main/java/com/uas/platform/b2b/dao/ProductDao.java

@@ -190,7 +190,7 @@ public interface ProductDao extends JpaSpecificationExecutor<Product>, JpaReposi
      * @param brand
      * @return
      */
-    public List<Product> findByTitleAndSpecAndBrandAndEnUU(String title, String spec, String brand, Long enUU);
+    public List<Product> findByTitleAndCmpCodeAndBrandAndEnUU(String title, String cmpcode, String brand, Long enUU);
 
 	/**
 	 * 通过uu查询非标准器件进行存储

+ 4 - 5
src/main/java/com/uas/platform/b2b/service/impl/ProductUsersServiceImpl.java

@@ -82,7 +82,7 @@ public class ProductUsersServiceImpl implements ProductUsersService {
         Long useruu =  SystemSession.getUser().getUserUU();
         List<ProductUsers> productUsers = productUsersDao.findByEnuuAndUseruuAndTitleAndSpecAndBrand(enuu, useruu, prodInfo.getTitle(), prodInfo.getSpec(), prodInfo.getBrand());
         if(CollectionUtils.isEmpty(productUsers)) {// 如果不存在则进行其他操作,存在不处理
-            List<Product> productList = productDao.findByTitleAndSpecAndBrandAndEnUU(prodInfo.getTitle(), prodInfo.getSpec(), prodInfo.getBrand(), SystemSession.getUser().getEnterprise().getUu());
+            List<Product> productList = productDao.findByTitleAndCmpCodeAndBrandAndEnUU(prodInfo.getTitle(), prodInfo.getCmpCode(), prodInfo.getBrand(), SystemSession.getUser().getEnterprise().getUu());
             if(!CollectionUtils.isEmpty(productList)) { // 如果存在,找出其中一个进行绑定
                 ProductUsers prod = new ProductUsers();
                 prod.setDate(new Date());
@@ -176,7 +176,6 @@ public class ProductUsersServiceImpl implements ProductUsersService {
                     if (row.getCell(2) != null) {
                         row.getCell(2).setCellType(Cell.CELL_TYPE_STRING);
                         product.setCmpCode(row.getCell(2).getStringCellValue().trim());
-                        product.setSpec(row.getCell(2).getStringCellValue().trim());
                     }
 
                     // 品牌
@@ -242,8 +241,8 @@ public class ProductUsersServiceImpl implements ProductUsersService {
                     List<ProductUsers> existProds = productUsersDao.findByEnuuAndUseruuAndTitleAndSpecAndBrand
                             (enuu, useruu, product.getTitle(), product.getSpec(), product.getBrand());
                     if(CollectionUtils.isEmpty(existProds)) {
-                        List<Product> prods = productDao.findByTitleAndSpecAndBrandAndEnUU(
-                                product.getTitle(), product.getSpec(), product.getBrand(), enuu);
+                        List<Product> prods = productDao.findByTitleAndCmpCodeAndBrandAndEnUU(
+                                product.getTitle(), product.getCmpCode(), product.getBrand(), enuu);
                         if (CollectionUtils.isEmpty(prods)) {
                             // 如果物料不存在,先生成物料信息
                             product.setEnUU(SystemSession.getUser().getEnterprise().getUu());
@@ -258,7 +257,7 @@ public class ProductUsersServiceImpl implements ProductUsersService {
                                 for(Role role : roles) {
                                     if(role.getName().equals("业务员") || role.getName().equals("销售经理")) {
                                         product.setIsSale(Constant.YES);
-                                    } else  if(role.getName().equals("采购员")) {
+                                    } else if(role.getName().equals("采购员")) {
                                         product.setIsPurchase(Constant.YES);
                                     }
                                 }

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

@@ -22232,6 +22232,7 @@ define(['toaster', 'charts', 'ngTable', 'common/services', 'common/directives',
             $scope.searchMethod = false;
             if(keyword != null && keyword != '') {
                 $scope.searchMethod = true;
+                $scope.tip = keyword;
             }
             $scope.tableParams.page(1);
             $scope.tableParams.reload();

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

@@ -11,7 +11,7 @@
 		<li ui-sref-active="active"><a ui-sref="approvalflow.product">物料信息</a></li>
 	</ul>
     <ul class="list-unstyled">
-        <li ui-sref-active="active"><a ui-sref="approvalflow.userProduct">个人产品库</a></li>
+        <li ui-sref-active="active"><a ui-sref="approvalflow.userProduct">我的产品库</a></li>
     </ul>
 	<ul class="list-unstyled">
 		<li ui-sref-active="active"><a ui-sref="approvalflow.user">人员信息</a></li>

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

@@ -68,7 +68,7 @@
             <div class="pro-list-tab row">
                 <div class="col-md-2"><em class="text-inverse">*</em>产品型号:</div>
                 <div class="col-md-4">
-                    <input type="text"  ng-model="prodInfo.spec" style="cursor: pointer;" required="true"
+                    <input type="text"  ng-model="prodInfo.cmpCode" style="cursor: pointer;" required="true"
                 		ng-change="getSimilarComponents(prodInfo.cmpCode)" name="title" ng-focus="onFocus('cmpCode')"
                 		typeahead="cmp.code for cmp in getSimilarComponents($viewValue)"
 						autocomplete="off" typeahead-on-select="onAssociateComponentClick($item, prodInfo)"

+ 3 - 3
src/main/webapp/resources/tpl/index/approvalFlow/userProduct.html

@@ -184,7 +184,7 @@
         <i></i>
     </div>
     <div class="pub-com_head">
-        <span>产品库</span>
+        <span>我的产品库</span>
         <div class="p-right">
             <a ng-click="addProduct()">新增</a>
             <a ng-click="uploadByBatch()" title="批量导入">批量导入</a>
@@ -194,7 +194,7 @@
         <div class="search-bg condition block"  style="padding: 20px 15px 0 15px;">
             <div class="row">
                 <div id="topSearch" style="float: left">
-                    <span class="text-muted"><i class="fa fa-search fa-lg"></i> 搜索"",为您找到结果:</span>
+                    <span class="text-muted"><i class="fa fa-search fa-lg"></i> 搜索"{{tip}}",为您找到结果:</span>
                   	  单据{{tableParams.total()}}条
                 </div>
                 <div class="col-xs-6" style="float: right;">
@@ -230,7 +230,7 @@
                     </div>
                 </td>
                 <td class="hover-show text-center">
-                	<span title="产品型号" ng-bind="::user.product.spec"></span>
+                	<span title="产品型号" ng-bind="::user.product.cmpCode"></span>
                 </td>
                <td class="text-center" title="{{user.product.brand}}" ng-bind="::user.product.brand" ng-if="user.product.standard != 1"></td>
                 <td class="text-center" title="{{user.product.pbranden}}" ng-bind="::user.product.pbranden" ng-if="user.product.standard == 1"></td>