Browse Source

商城对接公共询价服务接口

liusw 8 years ago
parent
commit
56d9dc5523

+ 13 - 1
src/main/java/com/uas/platform/b2c/trade/seek/service/impl/SeekPurchaseBomServiceImpl.java

@@ -248,6 +248,11 @@ public class SeekPurchaseBomServiceImpl implements SeekPurchaseBomService{
         if (!StringUtils.isEmpty(amountValue)) {
             try {
                 Double amount = Double.valueOf(StringUtilB2C.replaceLineBreak(StringUtilB2C.getStr(amountValue)));
+                if (amount <= 0) {
+                    amount = 1d;
+                } else if (amount >= 100000000){
+                    amount = 99999999d;
+                }
                 seekPurchaseByBatch.setAmount(amount);
             } catch (NumberFormatException e) {
                 seekPurchaseByBatch.setAmount(null);
@@ -272,6 +277,11 @@ public class SeekPurchaseBomServiceImpl implements SeekPurchaseBomService{
         if (!StringUtils.isEmpty(unitPriceValue)) {
             try {
                 Double unitPrice = Double.valueOf(StringUtilB2C.replaceLineBreak(StringUtilB2C.getStr(unitPriceValue)));
+                if (unitPrice <= 0) {
+                    unitPrice = 1d;
+                } else if (unitPrice >= 10000) {
+                    unitPrice = 9999d;
+                }
                 seekPurchaseByBatch.setUnitPrice(unitPrice);
             } catch (NumberFormatException e) {
                 seekPurchaseByBatch.setUnitPrice(null);
@@ -288,6 +298,7 @@ public class SeekPurchaseBomServiceImpl implements SeekPurchaseBomService{
         if (!StringUtils.isEmpty(encapsulationValue)) {
             try {
                 String encapsulation = StringUtilB2C.replaceLineBreak(StringUtilB2C.getStr(encapsulationValue));
+                encapsulation = com.uas.platform.b2c.fa.payment.utils.StringUtils.cutOutString(encapsulation, 20);
                 seekPurchaseByBatch.setEncapsulation(encapsulation);
             } catch (Exception e) {
                 seekPurchaseByBatch.setEncapsulation(null);
@@ -301,6 +312,7 @@ public class SeekPurchaseBomServiceImpl implements SeekPurchaseBomService{
         if (!StringUtils.isEmpty(produceDateValue)) {
             try {
                 String produceDate = StringUtilB2C.replaceLineBreak(StringUtilB2C.getStr(produceDateValue));
+                produceDate = com.uas.platform.b2c.fa.payment.utils.StringUtils.cutOutString(produceDate, 20);
                 seekPurchaseByBatch.setProduceDate(produceDate);
             } catch (Exception e) {
                 seekPurchaseByBatch.setProduceDate(null);
@@ -449,7 +461,7 @@ public class SeekPurchaseBomServiceImpl implements SeekPurchaseBomService{
         inquiry.setAmount(deleteBatchList.size());
         SimpleDateFormat sdf = new SimpleDateFormat("yyyyMMddsss");
         try {
-            inquiry.setCode("MALL" + sdf.parse(sdf.format(new Date())));
+            inquiry.setCode("MALL" + sdf.parse(sdf.format(new Date())).getTime());
         } catch (Exception e) {
             e.printStackTrace();
         }

+ 1 - 1
src/main/webapp/resources/js/common/query/seekPurchase.js

@@ -44,7 +44,7 @@ define([ 'ngResource' ], function() {
         method: 'GET'
       },
       findOneBom: {
-          url: 'seek/findOneBom',
+          url: 'http://10.1.51.88:8080/inquiry/public/findInquiryById',
           method: 'GET'
       },
       saveBomName: {

+ 1 - 1
src/main/webapp/resources/js/usercenter/controllers/forstore/bom_detail_ctrl.js

@@ -18,7 +18,7 @@ define(['app/app'], function (app) {
 
                 var getBomInfo = function () {
                     if ($stateParams.id) {
-                      seekPurchase.findOneBom({bomId: $stateParams.id}, function (data) {
+                      seekPurchase.findOneBom({id: $stateParams.id}, function (data) {
                         $scope.bomInfo = data;
                       }, function (response) {
                         toaster.pop('error', response.data);

+ 1 - 1
src/main/webapp/resources/js/usercenter/controllers/forstore/seek_purchase_ctrl.js

@@ -53,7 +53,7 @@ define(['app/app'], function (app) {
               // param.isMallGoods = $scope.isMallGoods;
               // param.deadline = $scope.deadline;
               param.keyword = $scope.keyWord;
-              param._state = "agreed";
+              param.state = "todo";
               param.overdue = $scope.overdue;
               param.fromDate = $scope.startDate
                   ? $scope.startDate.getTime() : null;

+ 19 - 10
src/main/webapp/resources/view/usercenter/forstore/bomDetail.html

@@ -425,14 +425,15 @@
             <a href="user#/seekPurchase?type=bomManage">&lt;返回BOM列表</a>
             <div>
                 <p class="BOM-name-area" ng-show="!isEditName">
-                    <span ng-bind="bomInfo.name"></span>
-                    <a ng-click="setIsEditName(true)">编辑BOM名称</a>
+                    <span ng-bind="bomInfo.remark"></span>
+                    <!--<a ng-click="setIsEditName(true)">编辑BOM名称</a>-->
                 </p>
                 <p class="BOM-edit" ng-show="isEditName">
                     <input type="text" class="form-control" ng-change="onBomNameChange()" ng-model="bomName">
                     <a ng-click="setIsEditName(false)">取消</a>
                     <a ng-click="saveBomName()">确认</a>
                 </p>
+                <!--
                 <div class="fr">
                     <b>配单分析:</b><span>本单共<span class="blue-text" ng-bind="bomInfo.productAmount || 0"></span>个产品,<span class="red-text" ng-bind="bomInfo.offerAmount || 0"></span>个有报价。</span>
                     <br/>
@@ -443,9 +444,11 @@
                     </div>
                     <b class="red-text" ng-bind="bomInfo.goodsAmount || 0"></b>个有现货
                 </div>
+                -->
             </div>
         </div>
         <!--搜索时间筛选-->
+        <!--
         <div class="screen">
             <div class="fl">
                 <label class="com-check-box">
@@ -495,6 +498,7 @@
                 </div>
             </div>
         </div>
+        -->
         <!--<div class="upload-content">-->
         <!--<input type="text" name="txt" id="upload_text" />-->
         <!--<i>选择文件</i>-->
@@ -505,13 +509,14 @@
             <thead>
             <tr>
                 <th width="165">发布时间</th>
-                <th width="125">型号</th>
-                <th width="77">品牌</th>
+                <th width="206">型号</th>
+                <th width="169">品牌</th>
                 <th width="93">采购数量</th>
                 <th width="78">单价预算</th>
                 <th width="70">封装</th>
                 <th width="105">生产日期</th>
                 <th width="123">截止时间</th>
+                <!--
                 <th width="81">
                     <select class="select-adder form-control" ng-model="searchStatus" ng-change="onSearch(searchStatus)">
                         <option value="0">全部</option>
@@ -519,16 +524,18 @@
                         <option value="201">已报价</option>
                         <option value="202">已采纳</option>
                     </select>
+                    状态
                 </th>
                 <th width="92">操作</th>
+                -->
             </tr>
             </thead>
-            <tbody ng-repeat="seek in seekListData.content">
+            <tbody ng-repeat="seek in bomInfo.inquiryItems">
             <tr class="default-row">
-                <td ng-bind="seek.releaseDate | date:'yyyy-MM-dd HH:mm:ss'"></td>
-                <td ng-bind="seek.code || '-'" title="{{seek.code}}"></td>
-                <td ng-bind="seek.brand || '-'" title="{{seek.brand}}"></td>
-                <td ng-bind="seek.amount || '-'"></td>
+                <td ng-bind="seek.date | date:'yyyy-MM-dd HH:mm:ss'"></td>
+                <td ng-bind="seek.cmpCode || '-'" title="{{seek.cmpCode}}"></td>
+                <td ng-bind="seek.inbrand || '-'" title="{{seek.inbrand}}"></td>
+                <td ng-bind="seek.needquantity || '-'"></td>
                 <td>
                     <span>{{seek.currency + seek.unitPrice | currencyStr}}</span>
                 </td>
@@ -536,6 +543,7 @@
                 <td ng-bind="seek.produceDate || '-'" title="{{seek.produceDate}}">2012-12-12</td>
                 <td class="left-time" ng-if="seek.remainingTime > 0">剩余&nbsp;<span ng-bind="getDay(seek.remainingTime)" ng-if="getDay(seek.remainingTime) > 0" class="red-text"></span><i ng-if="getDay(seek.remainingTime) > 0">&nbsp;天&nbsp;</i><span ng-if="getDay(seek.remainingTime) <= 0" ng-bind="getHours(seek.remainingTime)" class="red-text">5</span><i ng-if="getDay(seek.remainingTime) <= 0">&nbsp;小时</i></td>
                 <td class="left-time" ng-if="seek.remainingTime <= 0"><span style="color: red;">已截止</span></td>
+                <!--
                 <td ng-switch="seek.status">
                     <span ng-switch-when="200" style="color:red;">待报价</span>
                     <span ng-switch-when="201">已报价</span>
@@ -546,6 +554,7 @@
                     <span ng-if="!seek.offerAmount && seek.goodsAmount>0" ng-show="!seek.$status || seek.$status == 0" ng-click="setSeekStatus(seek, 1)">查看现货&nbsp;<i class="fa fa-angle-double-down"></i></span>
                     <span ng-show="seek.$status && (seek.$status == 1 || seek.$status == 2)" ng-click="setSeekStatus(seek, 0)">收起&nbsp;<i class="fa fa-angle-double-up"></i></span>
                 </td>
+                -->
             </tr>
             <tr class="expand-row" ng-if="seek.$status == 1 || seek.$status == 2">
                 <td colspan="10">
@@ -646,7 +655,7 @@
             <tr class="pager-row">
                 <td colspan="10">
                     <div>
-                        显示&nbsp;{{(seekListData.number - 1 ) * seekListData.size + 1}}-{{seekListData.number * seekListData.size}}&nbsp;条,共&nbsp;{{seekListData.totalElements}}&nbsp;条
+                        <!--显示&nbsp;{{(seekListData.number - 1 ) * seekListData.size + 1}}-{{seekListData.number * seekListData.size}}&nbsp;条,-->共&nbsp;{{bomInfo.inquiryItems.length}}&nbsp;条
                     </div>
                 </td>
             </tr>

+ 2 - 0
src/main/webapp/resources/view/usercenter/forstore/seekPurchase.html

@@ -899,6 +899,7 @@
                 </label>
             </div>
         </div>
+        <!--
         <div class="screen">
             <div class="sreach fr">
                 <span>发布时间&nbsp;</span>
@@ -935,6 +936,7 @@
                 </div>
             </div>
         </div>
+        -->
         <table ng-table="bomTableParams">
             <tbody>
             <tr ng-repeat="bom in $data">